Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saved Questions permission setting not saved #10499

Closed
timmclaughlin opened this issue Aug 6, 2019 · 17 comments
Closed

Saved Questions permission setting not saved #10499

timmclaughlin opened this issue Aug 6, 2019 · 17 comments
Labels
Administration/Permissions Collection or Data permissions Type:Bug Product defects

Comments

@timmclaughlin
Copy link

timmclaughlin commented Aug 6, 2019

Upgraded to 0.33preview2 from 0.32 and now my users with limited access cannot query any data - it just spins on "Loading..." They can login and see the saved questions in their intended collection the same as previous versions, but after clicking the saved question, the data cannot be queried. I tried to set the "Saved Questions" permission for All Users in the Permissions UI since it was showing as that they had no access to the data, but that fails with the following error (there seems to be a separate UI bug mentioned here: #5610 (comment)).
image

Logs show after clicking Save Changes:
Aug 04 12:54:52 ERROR metabase.middleware.log :: PUT /api/permissions/graph 500 7 ms (0 DB calls)
{:value
[{:revision 8,
:groups
{7 {3 {:native :none, :schemas :none}},
1 {3 {:native :none, :schemas :none}, -1337 {:native nil, :schemas :all}},
4 {3 {:native :none, :schemas :none}},
6 {3 {:native :none, :schemas :none}},
12 {3 {:native :none, :schemas :none}},
2 {3 {:native :write, :schemas :all}},
11 {3 {:native :none, :schemas :none}},
9 {3 {:native :none, :schemas :none}},
5 {3 {:native :write, :schemas :all}},
10 {3 {:native :none, :schemas :none}},
8 {3 {:native :none, :schemas :none}}}}],
:error [(named {:groups {1 {(not ("Integer greater than zero" -1337)) invalid-key}}} new-graph)],
:message "Input to update-graph! does not match schema: \n\n\t [(named {:groups {1 {(not ("Integer greater than zero" -1337)) invalid-key}}} new-graph)] \n\n",
:type clojure.lang.ExceptionInfo,
:stacktrace
("--> models.permissions$fn__26804$update_graph_BANG___26813.invoke(permissions.clj:603)"
"api.permissions$fn__61776.invokeStatic(permissions.clj:80)"
"api.permissions$fn__61776.invoke(permissions.clj:68)"
"middleware.auth$enforce_authentication$fn__45957.invoke(auth.clj:14)"
"routes$fn__63780$fn__63781.doInvoke(routes.clj:56)"
"middleware.exceptions$catch_uncaught_exceptions$fn__45861.invoke(exceptions.clj:104)"
"middleware.exceptions$catch_api_exceptions$fn__45858.invoke(exceptions.clj:92)"
"middleware.log$log_api_call$fn__45779$fn__45780.invoke(log.clj:170)"
"middleware.log$log_api_call$fn__45779.invoke(log.clj:164)"
"middleware.security$add_security_headers$fn__45822.invoke(security.clj:105)"
"middleware.json$wrap_json_body$fn__46040.invoke(json.clj:61)"
"middleware.json$wrap_streamed_json_response$fn__46058.invoke(json.clj:97)"
"middleware.session$bind_current_user$fn__46172$fn__46173.invoke(session.clj:193)"
"middleware.session$do_with_current_user.invokeStatic(session.clj:176)"
"middleware.session$do_with_current_user.invoke(session.clj:170)"
"middleware.session$bind_current_user$fn__46172.invoke(session.clj:192)"
"middleware.session$wrap_current_user_id$fn__46161.invoke(session.clj:161)"
"middleware.session$wrap_session_id$fn__46146.invoke(session.clj:123)"
"middleware.auth$wrap_api_key$fn__45965.invoke(auth.clj:27)"
"middleware.misc$maybe_set_site_url$fn__45924.invoke(misc.clj:58)"
"middleware.misc$bind_user_locale$fn__45927.invoke(misc.clj:74)"
"middleware.misc$add_content_type$fn__45912.invoke(misc.clj:30)"
"middleware.misc$disable_streaming_buffering$fn__45949.invoke(misc.clj:119)"
"middleware.misc$wrap_gzip$fn__45942.invoke(misc.clj:101)")}

@timmclaughlin timmclaughlin added the Type:Bug Product defects label Aug 6, 2019
@flamber
Copy link
Contributor

flamber commented Aug 6, 2019

Hi @timmclaughlin
When it just spins with "loading...", do you see any errors in the browser console or Metabase log?

@timmclaughlin
Copy link
Author

timmclaughlin commented Aug 7, 2019 via email

@flamber
Copy link
Contributor

flamber commented Aug 7, 2019

@timmclaughlin I was trying to get you to post the javascript error. And you should upgrade to 0.33.0-RC1, while I would recommend not to run test releases in production, that's a bit too late.

@timmclaughlin
Copy link
Author

@flamber Posted the error above. Didn't realize that email lost the images. Won't do that again. Also upgraded to RC1 and no changes to either the Javascript error, nor the attempted saving of the permissions.

@flamber
Copy link
Contributor

flamber commented Aug 8, 2019

@timmclaughlin
Which browser are you using?
You cannot change permissions of "Saved Questions". And it should be hidden. #5610
I'm fairly sure you're seeing some other errors, like no data permissions, but without the exact error it's difficult to point to the right bug.
Otherwise, you could try to backup your metadata and then downgrade to 0.32.10

@timmclaughlin
Copy link
Author

@flamber I am using Chrome and Safari both on OS X and see the same problem. The thing is that this used to work before I upgraded no problems, and it seems like it should work still now because the user has View permissions on the collection and can see the Questions, they just won't load.

Are you saying that you should always have access to Saved Questions if you can see them in the Collection? That would make sense to me...

I'll try to downgrade.

@flamber
Copy link
Contributor

flamber commented Aug 19, 2019

@timmclaughlin
Remember to backup before upgrade/downgrade!
You say "they just won't load" - do you see any errors in the Metabase log or browser console?
I think you might be seeing an issue, where saved questions are not loaded, when the user has no Data/SQL permissions. But more information would be really helpful.
But I'm fairly sure you can totally ignore the errors in Admin > Permissions.

@timmclaughlin
Copy link
Author

@flamber I suspect you are correct about the permission issue, but I see no errors in the server side log and only see the Javascript errors that I posted earlier.

@flamber
Copy link
Contributor

flamber commented Aug 19, 2019

@timmclaughlin Okay, ignore Admin > Permissions. The problem is not there.
You wrote "user has View permissions on the collection and can see the Questions, they just won't load" - what does that mean? Do they see an error?

@timmclaughlin
Copy link
Author

@flamber No, it hangs on the screen with the "Loading" spinner, I'm guessing due to the Javascript errors that I posted above. I suspect that it never even hits the server, or if it does so, it never causes an error because I would see that in the logs.

@flamber
Copy link
Contributor

flamber commented Aug 19, 2019

@timmclaughlin
Which version are you using now?
The javascript error in the first post only happens, when you're saving changes on Admin > Permissions page. Users don't have access to that.
Open an icognito window, open the browser console so you'll see all errors from the beginning, and then start by logging in as a user and clicking into questions you know will fail.
I'm fairly sure it might be a fix of several errors like "React Error" and "Permissions denied".

@timmclaughlin
Copy link
Author

timmclaughlin commented Aug 19, 2019

@flamber
This is what I get when I try to view the question as the limited access user. There is no problem for the user with sufficient privileges.
image

@flamber
Copy link
Contributor

flamber commented Aug 19, 2019

@timmclaughlin I'm almost certain that you're seeing issue #10402, which hopefully will be fixed before 0.33.0. But you option right now is to downgrade to 0.32.10 or give users data permissions.
Please close this issue 👍

@timmclaughlin
Copy link
Author

@flamber yeah it sure looks like it. Sorry for the dupe.

@timmclaughlin
Copy link
Author

@flamber FYI, I did try to give them data permissions, but there is a bug there as well, that I described earlier. It won't save the permissions.

@mazameli
Copy link
Contributor

Yep, we're actively looking at #10402 at the moment.

@flamber
Copy link
Contributor

flamber commented Aug 19, 2019

@timmclaughlin Maz already re-opened issue #5617, since you should not even see "Saved Questions" under Permissions, so that part will be tracked there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Administration/Permissions Collection or Data permissions Type:Bug Product defects
Projects
None yet
Development

No branches or pull requests

4 participants