ktecho opened a new issue #14892:
URL: https://github.com/apache/superset/issues/14892


   When executing the Superset importers, they always returns exit code 0 even 
if there where errors. This way it's very difficult to automatize the 
processes. Right now I'm using this two commands: 
   
   ```
   superset import-datasources -p datasources.yaml
   superset import-dashboards -p dashboard.json
   ```
   
   But randomly they're failing, maybe because Superset is not yet ready, or 
whatever, so I wanted to implement retries and error handling, but the exit 
code is always 0.
   
   To try to reproduce the problem, I broke the datasources.yaml file by hand 
(I put this in the first line `data99bases:`) and tried to import it. As you 
see, the exit code is 0:
   
   ```
   root@ip-172-31-52-216:/# superset import-datasources -p datasources.yaml
   logging was configured successfully
   INFO:superset.utils.logging_configurator:logging was configured successfully
   /usr/local/lib/python3.8/dist-packages/flask_caching/__init__.py:201: 
UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively 
disabled.
     warnings.warn(
   Error when importing dataset
   Traceback (most recent call last):
     File "/usr/local/lib/python3.8/dist-packages/superset/cli.py", line 537, 
in import_datasources
       ImportDatasetsCommand(contents, sync_columns, sync_metrics).run()
     File 
"/usr/local/lib/python3.8/dist-packages/superset/datasets/commands/importers/v0.py",
 line 300, in run
       self.validate()
     File 
"/usr/local/lib/python3.8/dist-packages/superset/datasets/commands/importers/v0.py",
 line 333, in validate
       raise IncorrectVersionError(f"{file_name} has no valid keys")
   superset.commands.importers.exceptions.IncorrectVersionError: 
datasources.yaml has no valid keys
   ERROR:superset.cli:Error when importing dataset
   Traceback (most recent call last):
     File "/usr/local/lib/python3.8/dist-packages/superset/cli.py", line 537, 
in import_datasources
       ImportDatasetsCommand(contents, sync_columns, sync_metrics).run()
     File 
"/usr/local/lib/python3.8/dist-packages/superset/datasets/commands/importers/v0.py",
 line 300, in run
       self.validate()
     File 
"/usr/local/lib/python3.8/dist-packages/superset/datasets/commands/importers/v0.py",
 line 333, in validate
       raise IncorrectVersionError(f"{file_name} has no valid keys")
   superset.commands.importers.exceptions.IncorrectVersionError: 
datasources.yaml has no valid keys
   
   root@ip-172-31-52-216:/# echo $?
   0
   ```
   
   ### Expected results
   
   The command ending with exit code different to zero.
   
   ### Actual results
   
   The command ended with exit code 0.
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   #### How to reproduce the bug
   
   1. Go to '...'
   2. Click on '....'
   3. Scroll down to '....'
   4. See error
   
   ### Environment
   
   - Superset 1.1.0
   - python version: Python 3.8.5
   - node.js version: None.


-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to