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 2022/03/01 10:46:17 UTC

[GitHub] [superset] codek opened a new issue #18980: Export Databases from the CLI does not work

codek opened a new issue #18980:
URL: https://github.com/apache/superset/issues/18980


   As you can see here, you cannot export the dashboards via the "superset export-dashboards" command
   
   https://stackoverflow.com/questions/69641720/superset-exporting-and-importing-the-dashboards-using-cli-for-versioning-contro
   
   I have also reproduced this, in a vanilla apache/superset image.
   
   I do have the examples deployed, i wonder if it's something in the examples that is breaking it?
   
   #### How to reproduce the bug
   
   1. bring up the docker superset image
   2. connect to docker
   3. execute superset export-databases
   
   ### Expected results
   
   a file is generated (?) <-- the doco is unclear whether this is a zip or a json.
   
   ### Actual results
   
   it explodes
   
   #### Screenshots
   
   see stack trace in stackoverflow link
   
   
   ### Environment
   
   (please complete the following information):
   
   Superset 0.0.0dev
   Python 3.8.12
   
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   root@a0da58753de3:/app# superset export-dashboards > dashboards.yaml
   logging was configured successfully
   2022-03-01 10:02:59,282:INFO:superset.utils.logging_configurator:logging was configured successfully
   2022-03-01 10:02:59,309:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
   /usr/local/lib/python3.8/site-packages/flask_caching/__init__.py:201: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
     warnings.warn(
   Starting export
   2022-03-01 10:03:06,558:INFO:superset.utils.dashboard_import_export:Starting export
   Traceback (most recent call last):
     File "/usr/local/bin/superset", line 33, in <module>
       sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')())
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
       return self.main(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 586, in main
       return super(FlaskGroup, self).main(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
       rv = self.invoke(ctx)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
       return ctx.invoke(self.callback, **ctx.params)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
       return callback(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
       return f(get_current_context(), *args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 426, in decorator
       return __ctx.invoke(f, *args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
       return callback(*args, **kwargs)
     File "/app/superset/cli/importexport.py", line 207, in export_dashboards
       data = dashboard_import_export.export_dashboards(db.session)
     File "/app/superset/utils/dashboard_import_export.py", line 33, in export_dashboards
       data = Dashboard.export_dashboards(dashboard_ids)
     File "/app/superset/models/dashboard.py", line 391, in export_dashboards
       json_metadata = json.loads(dashboard.json_metadata)
     File "/usr/local/lib/python3.8/json/__init__.py", line 341, in loads
       raise TypeError(f'the JSON object must be str, bytes or bytearray, '
   TypeError: the JSON object must be str, bytes or bytearray, not NoneType
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   Add any other context about the problem here.
   


-- 
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] ephod commented on issue #18980: Export Databases from the CLI does not work

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


   I had a similar problem regarding `superset export-dashboards`, this solved my issue. I don't have enough time to create a patch, but this is the change might help you.
   
   ```python
   for slc in dashboard.slices: 
       if slc.datasource is None: 
           logger.info("Datasource is none") 
           continue
   ```
   
   https://github.com/apache/superset/blob/d645579cdd64b7fe7f9dde4a8da000dd7db51ce9/superset/models/dashboard.py#L374


-- 
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] ephod edited a comment on issue #18980: Export Databases from the CLI does not work

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


   I had a similar problem regarding `superset export-dashboards`, this solved my issue. I don't have enough time to create a patch, but this change might help you.
   
   ```python
   for slc in dashboard.slices: 
       if slc.datasource is None: 
           logger.info("Datasource is none") 
           continue
   ```
   
   https://github.com/apache/superset/blob/d645579cdd64b7fe7f9dde4a8da000dd7db51ce9/superset/models/dashboard.py#L374


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