You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/29 01:51:58 UTC

[GitHub] [superset] liuxp311 opened a new issue #12824: Error running SQL Lab

liuxp311 opened a new issue #12824:
URL: https://github.com/apache/superset/issues/12824


   Error running SQL Lab
   
   ### Expected results
   Error messageļ¼š
   
   Database Error
   Instance <Query at 0x1b00c574070> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/13/bhk3)
   
   ### Actual results
   
   
   Unable to query
   
   #### Screenshots
   
   Database Error
   Instance <Query at 0x1b00c574070> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/13/bhk3)
   
   #### How to reproduce the bug
   
   1. open sql lab
   2. run
   3. Scroll down to '....'
   4. See error  :
   Database Error
   Instance <Query at 0x1b00c574070> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/13/bhk3)
   ### Environment
   
   (please complete the following information):
   
   - superset version: `superset version  1.0.0`
   - python version: `python --version3.8.6`
   - node.js version: `node -v12 1.8`
   
   ### Checklist
   
   
   ### Additional context
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] eugeniamz commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
eugeniamz commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-770338857


   which database do you use? 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] beautah commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
beautah commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-770387050


   I'm seeing the same issue using an oracle db connection, my python version is 3.8.4, using conda for env, but same set up otherwise.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-781766366


   ok


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 closed issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 closed issue #12824:
URL: https://github.com/apache/superset/issues/12824


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] mohimirza edited a comment on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
mohimirza edited a comment on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-776115082


   @liuxp311 @beautah @jokus-pokus
   
   The problem seems to be caused by SIGALRM. Here is a workaround which has worked for me.
   In **Lib\site-packages\superset\utils\core.py** replace:
   
   ```
     def __enter__(self):
         try:
             signal.signal(signal.SIGALRM, self.handle_timeout)
             signal.alarm(self.seconds)
         except ValueError as e:
             logger.warning("timeout can't be used in the current context")
             logger.exception(e)
   
     def __exit__(self, type, value, traceback):
         try:
             signal.alarm(0)
         except ValueError as e:
             logger.warning("timeout can't be used in the current context")
             logger.exception(e)
   
   ```
   
   with
   
   ```
       def __enter__(self):
           try:
               #signal.signal(signal.SIGALRM, self.handle_timeout)
               #signal.alarm(self.seconds)
               pass
           except ValueError as e:
               logger.warning("timeout can't be used in the current context")
               logger.exception(e)
   
       def __exit__(self, type, value, traceback):
           try:
               #signal.alarm(0)
               pass
           except ValueError as e:
               logger.warning("timeout can't be used in the current context")
               logger.exception(e)
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] mohimirza commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
mohimirza commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-776115082


   @liuxp311 @beautah The problem seems to be caused by SIGALRM. Here is a workaround which has worked for me.
   In **Lib\site-packages\superset\utils\core.py** replace:
   
   ```
     def __enter__(self):
         try:
             signal.signal(signal.SIGALRM, self.handle_timeout)
             signal.alarm(self.seconds)
         except ValueError as e:
             logger.warning("timeout can't be used in the current context")
             logger.exception(e)
   
     def __exit__(self, type, value, traceback):
         try:
             signal.alarm(0)
         except ValueError as e:
             logger.warning("timeout can't be used in the current context")
             logger.exception(e)
   
   ```
   
   with
   
   ```
       def __enter__(self):
           try:
               #signal.signal(signal.SIGALRM, self.handle_timeout)
               #signal.alarm(self.seconds)
               pass
           except ValueError as e:
               logger.warning("timeout can't be used in the current context")
               logger.exception(e)
   
       def __exit__(self, type, value, traceback):
           try:
               #signal.alarm(0)
               pass
           except ValueError as e:
               logger.warning("timeout can't be used in the current context")
               logger.exception(e)
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-770341533


   > which database do you use?
   
   1)mysql or sqlite,the same question,2)Environment:Virtual environment python -m venv venv


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-774670344


   @ryw :can help to solve this question?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-770316200


   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\superset\views\base.py", line 180, in wraps
       return f(self, *args, **kwargs)
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\superset\utils\log.py", line 164, in wrapper
       value = f(*args, **kwargs)
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\superset\views\core.py", line 2418, in sql_json
       return self.sql_json_exec(request.json, log_params)
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\superset\views\core.py", line 2564, in sql_json_exec
       return self._sql_json_sync(
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\superset\views\core.py", line 2403, in _sql_json_sync
       logger.exception("Query %i failed unexpectedly", query.id)
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\sqlalchemy\orm\attributes.py", line 294, in __get__
       return self.impl.get(instance_state(instance), dict_)
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\sqlalchemy\orm\attributes.py", line 725, in get
       value = state._load_expired(state, passive)
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\sqlalchemy\orm\state.py", line 652, in _load_expired
       self.manager.deferred_scalar_loader(self, toload)
     File "c:\users\13264\desktop\test\python\superset\venv\lib\site-packages\sqlalchemy\orm\loading.py", line 942, in load_scalar_attributes
       raise orm_exc.DetachedInstanceError(
   sqlalchemy.orm.exc.DetachedInstanceError: Instance <Query at 0x22638334df0> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/13/bhk3)
   INFO:werkzeug:127.0.0.1 - - [31/Jan/2021 10:48:14] "POST /superset/sql_json/ HTTP/1.1" 500 -
   INFO:werkzeug:127.0.0.1 - - [31/Jan/2021 10:48:14] "GET /superset/queries/1612060970962.423 HTTP/1.1" 200 -
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] beautah commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
beautah commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-776204065


   Nice! Thanks for that @mohimirza , but I've decided to go ahead and get this set up on my linux server and keep it within the realm of supported devices, might just have to use this trick to have a working local development version though, it certainly works!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-774670216


   @eugeniamz :can help to solve this question?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] jokus-pokus commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
jokus-pokus commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-773104267


   Same issue here using a SQL Server and Apache Superset on Windows.
   Everything works fine but i cant query in SQL Lab.
   What can i do there to bound my query to a Session?
   
   Thanks in advance!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-770341509


   1)mysql or sqlite,the same question,2)Environment:Virtual environment    python -m venv venv


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] jokus-pokus commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
jokus-pokus commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-773104267


   Same issue here using a SQL Server and Apache Superset on Windows.
   Everything works fine but i cant query in SQL Lab.
   What can i do there to bound my query to a Session?
   
   Thanks in advance!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] liuxp311 commented on issue #12824: Error running SQL Lab

Posted by GitBox <gi...@apache.org>.
liuxp311 commented on issue #12824:
URL: https://github.com/apache/superset/issues/12824#issuecomment-781766307






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org