The data explorer is only available to admins

AI-generated summary

Users alex56 and manuel reported encountering the message “The data explorer is only available to admins” despite having admin permissions, with manuel also noting a PostgreSQL warning about type casting. pfaffman asked if users were admins and whether they’d upgraded to PostgreSQL 12 or migrated the database, but manuel confirmed no changes were made on a fresh 2.6.0.beta3 install. sam suggested waiting 10 seconds to bypass rate-limiting issues, but alex56 confirmed this didn’t help. riking explained that the error message appears for any page-load failure, not just permission issues, and proposed improving client-side error reporting. A fix was submitted (riking) to separate permission checks from general error handling, ensuring the admin-only message only triggers when permissions are truly the issue, while other errors are reported appropriately.

After update our forum we got the following message on the data-explorer plugin

The data explorer is only available to admins.

Could you please help us to fix an issue

1 like

I just did an upgrade and don’t have this problem. Are you sure that the user trying to access data-explorer is an admin?

1 like

Sure. I have admin permission

I have seen this bug due to the rate limiter… if you wait 10 seconds and reload the page does data explorer show up.

3 likes

I did it but not luck

I’m getting this same error. I’m running 2.6.0.beta2 as development version.

When I enable the plugin and try to access it at /admin/plugins/explorer, I get this console message:

Warning: no type cast defined for type “name” with oid 19. Please cast this type explicitly to TEXT to be safe for future changes.

2 likes

Have you upgraded to pg12?

Have you migrated the database?

2 likes

No, I didn’t change anything.

In fact, I just installed a new instance ( 2.6.0.beta3 / docker 19.03.13 / on Debian bullseye) and get the warning right away when running d/rake autospec or trying to access the plugin. I don’t know if it’s related in any way, but that’s the only warning i see.

Taking a look, the “The data explorer is only available to admins.” message shows up for any error encountered while loading up the page.

https://github.com/discourse/discourse-data-explorer/blob/master/assets/javascripts/discourse/routes/admin-plugins-explorer.js.es6#L33-L37

This was sensible when there was a very small list of things that could go wrong, but the fix here is probably better clientside error reporting.

6 likes

Change is up - the existing text is now triggered by an explicit check of admin permissions, and standard error handling is used for any failed requests.

https://github.com/discourse/discourse-data-explorer/pull/84/files

6 likes

This topic was automatically closed after 2 days. New replies are no longer allowed.