Make sure these boxes are checked before submitting your issue - thank you!

- [x] I have checked the superset logs for python stacktraces and included it 
here as text if any
- [x] I have reproduced the issue with at least the latest released version of 
superset
- [x] I have checked the issue tracker for the same issue and I haven't found 
one similar
----
### Goal 
I want to grant log-out users with Public Roles to use SQL Lab > SQL Editor to 
query databases. 

### Superset version
0.26.3

### Expected results
Users can use SQL Editor to make query and get result without login.

### Actual results
Both preview for tables and SQL queries returned the same error showed below.

![image](https://user-images.githubusercontent.com/3454980/44620044-fc065880-a8c8-11e8-8385-54aefe9b5bcf.png)


Raw Text:
```html
<html> <body> <h1>Sorry, something went wrong</h1> <h3>500 - Internal Server 
Error</h3> <hr> <h2>Stacktrace</h2> <hr> <code> <pre> Traceback (most recent 
call last): File &#34;/usr/local/lib/python3.5/dist-packages/flask/app.py&#34;, 
line 1982, in wsgi_app response = self.full_dispatch_request() File 
&#34;/usr/local/lib/python3.5/dist-packages/flask/app.py&#34;, line 1614, in 
full_dispatch_request rv = self.handle_user_exception(e) File 
&#34;/usr/local/lib/python3.5/dist-packages/flask/app.py&#34;, line 1517, in 
handle_user_exception reraise(exc_type, exc_value, tb) File 
&#34;/usr/local/lib/python3.5/dist-packages/flask/_compat.py&#34;, line 33, in 
reraise raise value File 
&#34;/usr/local/lib/python3.5/dist-packages/flask/app.py&#34;, line 1612, in 
full_dispatch_request rv = self.dispatch_request() File 
&#34;/usr/local/lib/python3.5/dist-packages/flask/app.py&#34;, line 1598, in 
dispatch_request return self.view_functions[rule.endpoint](**req.view_args) 
File &#34;/usr/local/lib/pytho
 n3.5/dist-packages/flask_appbuilder/security/decorators.py&#34;, line 52, in 
wraps return f(self, *args, **kwargs) File 
&#34;/usr/local/lib/python3.5/dist-packages/superset/models/core.py&#34;, line 
903, in wrapper value = f(*args, **kwargs) File 
&#34;/usr/local/lib/python3.5/dist-packages/superset/views/core.py&#34;, line 
2403, in sql_json user_id=int(g.user.get_id()), TypeError: int() argument must 
be a string, a bytes-like object or a number, not &#39;NoneType&#39; </pre> 
</code> </body> </html>
```

Seems that there is not a valid user for executing query, but still don't know 
how to solve it.( Judged by the error `sql_json user_id=int(g.user.get_id()), 
TypeError: int() argument must be a string, a bytes-like object or a number, 
not &#39;NoneType&#39;`)

### Steps to reproduce
- Setup a Superset using Docker image listed on official 
README[](https://hub.docker.com/r/amancevice/superset/) 
- Create a Admin user
- Login with the user and add ALL permission to `Public` role from `Security` > 
`List Roles` menu
- Log out and click `SQL Lab` > `SQL Editor` menu
- Make sure `Database`, `Schema`, `Tables` are listed properly
- Make a casual SQL query
- Error



[ Full content available at: 
https://github.com/apache/incubator-superset/issues/5727 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to