Querying JSON with SQL shows: Failed to read the 'sessionStorage' property

Hey @Paulo

now i get from the json query

Failed to read the 'sessionStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.

how can I solve it?

1 Like

Could you share a screenshot showing the query and the error?

Screenshot 2024-10-10 at 23.26.10

on the json query

Are you able to share the actual query? Are you referencing sessionStorage?

Hey @Paulo

This JSon query:

WITH
  nogroupeddata AS (
    SELECT
      CASE
        WHEN {{ breakdown.value }} = 'dt' THEN dt
        WHEN {{ breakdown.value }} = 'country' THEN country
        WHEN {{ breakdown.value }} = 'device' THEN device
        WHEN {{ breakdown.value }} = 'start_date' THEN start_date
        ELSE 'Unknown Breakdown'
      END AS breakdowns,
      CAST(spend AS DOUBLE) AS spend,
      CAST(revenue AS DOUBLE) AS revenue,
      CAST(profit AS DOUBLE) AS profit
      results,
      impressions
    FROM
      {{ raw.data }}
  )
SELECT
  breakdowns,
  SUM(spend) AS spend,
  SUM(revenue) AS revenue,
  SUM(results) AS results,
  SUM(impressions) AS impressions
FROM
  nogroupeddata
GROUP BY
  breakdowns
order by
  spend desc

After running a few times, the error has appeared:

Failed to read the 'sessionStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.

That is an odd error.

  1. raw is just the SQL query, right?
  2. Maybe it was just a UI error. Does it go away with a hard refresh?
  3. Was this a one time error or is it happening consistently?
  4. Are we referencing sessionStorage in any other queries?

Hey @Paulo

  1. Raw is the Athena SQL query
  2. Hard refresh doesn't help...
  3. it's happening consistently
  4. I don't reference sessionStorage at all...

Thanks for expanding on the issue, I'm trying to reproduce it on my end.

  1. Is this happening on Cloud or Self-hosted?
  2. What browser are we using?

Hey @Paulo

  1. Cloud
  2. Chrome
1 Like

Following -- seeing the same thing, also Retool Cloud using Chrome. Cleared cookies / local storage and still happens. Other browsers, Firefox and Safari, are both working, so we're using that as a workaround for now.

Error for us is in the Retool Query SQL with JSON resource, Failed to read the 'sessionStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.

*Query JSON with SQL --

Hi @npr, thank you for joining the forum and jumping directly on this issue!

I'm still unable to reproduce:

What type of Resource are we using before querying JSON with SQL? Is it also Athena?

For us it's PostgreSQL, not Athena; the weird thing is we have multiple Query JSON with SQL queries across multiple apps, and they were all working for us on and before 10/9, but stopped working for us the morning of 10/10. Also strange that they are only breaking in Chrome, and not Firefox or Safari. Have an email thread going with one of your colleagues but they flagged this thread so I figured I'd chime in here.

Thank you for providing the specific dates; this will assist us in pinpointing the root of the issue.

Could we try updating Chrome to the latest version?
Everything seems to be working fine on v129.0.6668.101.

I'm using the latest version of chrome and still the same issue

Hey @Paulo
I've tried logging in via Safari, and it seems it works.
But on Chrome it doesn't, I've tried deleting cookies, hard-refreshing on Chrome and everything, but still I get on Chrome:

Failed to read the 'sessionStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.

Thanks for the update, we've raised this issue internally. It definitely looks like is browser related but updating to 130.x did not fix it either.

It's fixed for me now, removing a Chrome plugin did it for me -- thanks for the suggestion!

1 Like