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/09/07 16:04:00 UTC

[GitHub] [superset] aniaan opened a new issue #16623: Error creating Elasticsearch Dataset, raise NoSuchTable Exception

aniaan opened a new issue #16623:
URL: https://github.com/apache/superset/issues/16623


   Error creating Elasticsearch Dataset, raise NoSuchTable Exception
   ### Expected results
   create success
   
   ### Actual results
   
   create error
   
   #### Screenshots
   
   <img width="717" alt="select-es-alias" src="https://user-images.githubusercontent.com/40813941/132374057-81da6fe3-13ae-42b6-98eb-0efca0ee9067.png">
   <img width="964" alt="create-error" src="https://user-images.githubusercontent.com/40813941/132374088-0f1924b6-c374-4005-a3bd-6664d8559c7d.png">
   
   
   
   ### Environment
   
   (please complete the following information):
   
   docker: apache/superset:latest
   
   - superset version: `superset version`
   - python version: `python --version`
   - node.js version: `node -v`
   - any feature flags active:
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are 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.
   
   ### Additional context
   By troubleshooting, I found that the error occurs when I select ES-view (actually alias), and is created correctly if the real Index is selected.
   
   https://github.com/apache/superset/blob/37c2020035b2c4a3121a0afbc2e2312a3d348ac0/superset/connectors/sqla/utils.py#L37-L47
   
   Here the check of whether the table_name exists in the schema is performed, without considering the case when table_name=view, the check here should be `table_name in tables or table_name in views`
   
   cc: @junlincc @zhaoyongjie 
   
   <details>
   <summary>traceback</summary>
   
   Traceback (most recent call last):
     File "/app/superset/datasets/commands/create.py", line 51, in run
       dataset.fetch_metadata(commit=False)
     File "/app/superset/connectors/sqla/models.py", line 1499, in fetch_metadata
       new_columns = self.external_metadata()
     File "/app/superset/connectors/sqla/models.py", line 663, in external_metadata
       database=self.database, table_name=self.table_name, schema_name=self.schema,
     File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
       raise NoSuchTableError
   sqlalchemy.exc.NoSuchTableError: ()
   2021-09-07 23:39:39,426:WARNING:superset.datasets.commands.create:()
   Traceback (most recent call last):
     File "/app/superset/datasets/commands/create.py", line 51, in run
       dataset.fetch_metadata(commit=False)
     File "/app/superset/connectors/sqla/models.py", line 1499, in fetch_metadata
       new_columns = self.external_metadata()
     File "/app/superset/connectors/sqla/models.py", line 663, in external_metadata
       database=self.database, table_name=self.table_name, schema_name=self.schema,
     File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
       raise NoSuchTableError
   sqlalchemy.exc.NoSuchTableError: ()
   Error creating model DatasetRestApi: Dataset could not be created.
   Traceback (most recent call last):
     File "/app/superset/datasets/commands/create.py", line 51, in run
       dataset.fetch_metadata(commit=False)
     File "/app/superset/connectors/sqla/models.py", line 1499, in fetch_metadata
       new_columns = self.external_metadata()
     File "/app/superset/connectors/sqla/models.py", line 663, in external_metadata
       database=self.database, table_name=self.table_name, schema_name=self.schema,
     File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
       raise NoSuchTableError
   sqlalchemy.exc.NoSuchTableError: ()
   The above exception was the direct cause of the following exception:
   Traceback (most recent call last):
     File "/app/superset/datasets/api.py", line 251, in post
       new_model = CreateDatasetCommand(g.user, item).run()
     File "/app/superset/datasets/commands/create.py", line 65, in run
       raise DatasetCreateFailedError() from ex
   superset.datasets.commands.exceptions.DatasetCreateFailedError: Dataset could not be created.
   2021-09-07 23:39:39,428:ERROR:superset.datasets.api:Error creating model DatasetRestApi: Dataset could not be created.
   Traceback (most recent call last):
     File "/app/superset/datasets/commands/create.py", line 51, in run
       dataset.fetch_metadata(commit=False)
     File "/app/superset/connectors/sqla/models.py", line 1499, in fetch_metadata
       new_columns = self.external_metadata()
     File "/app/superset/connectors/sqla/models.py", line 663, in external_metadata
       database=self.database, table_name=self.table_name, schema_name=self.schema,
     File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
       raise NoSuchTableError
   sqlalchemy.exc.NoSuchTableError: ()
   The above exception was the direct cause of the following exception:
   Traceback (most recent call last):
     File "/app/superset/datasets/api.py", line 251, in post
       new_model = CreateDatasetCommand(g.user, item).run()
     File "/app/superset/datasets/commands/create.py", line 65, in run
       raise DatasetCreateFailedError() from ex
   
   </details>
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] zhaoyongjie closed issue #16623: Error creating Elasticsearch Dataset, raise NoSuchTable Exception

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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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