bene-tleilax-werdna commented on issue #30351:
URL: https://github.com/apache/superset/issues/30351#issuecomment-3207842626

   We get this using the [Bitnami helm chart's 
](https://github.com/apache/superset/issues/30351) image, which runs 5.0.0.
   
   The logs on the web server pod also state:
   ```
   ERROR:superset.commands.database.validate_sql:Unable to execute 'ecpg', you 
likely need to install it.'
   Traceback (most recent call last):
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/pgsanity/ecpg.py", 
line 12, in check_syntax
       proc = subprocess.Popen(args, shell=False,
     File "/opt/bitnami/python/lib/python3.10/subprocess.py", line 971, in 
__init__
       self._execute_child(args, executable, preexec_fn, close_fds,
     File "/opt/bitnami/python/lib/python3.10/subprocess.py", line 1863, in 
_execute_child
       raise child_exception_type(errno_num, err_msg, err_filename)
   FileNotFoundError: [Errno 2] No such file or directory: 'ecpg'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/opt/bitnami/superset/superset/commands/database/validate_sql.py", 
line 69, in run
       errors = self._validator.validate(sql, catalog, schema, self._model)
     File "/opt/bitnami/superset/superset/sql_validators/postgres.py", line 42, 
in validate
       valid, error = check_string(sql, add_semicolon=True)
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/pgsanity/pgsanity.py", 
line 54, in check_string
       success, msg = ecpg.check_syntax(prepped_sql)
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/pgsanity/ecpg.py", 
line 20, in check_syntax
       raise OSError(msg)
   OSError: Unable to execute 'ecpg', you likely need to install it.'
   WARNING:superset.views.error_handling:SupersetErrorException
   Traceback (most recent call last):
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/pgsanity/ecpg.py", 
line 12, in check_syntax
       proc = subprocess.Popen(args, shell=False,
     File "/opt/bitnami/python/lib/python3.10/subprocess.py", line 971, in 
__init__
       self._execute_child(args, executable, preexec_fn, close_fds,
     File "/opt/bitnami/python/lib/python3.10/subprocess.py", line 1863, in 
_execute_child
       raise child_exception_type(errno_num, err_msg, err_filename)
   FileNotFoundError: [Errno 2] No such file or directory: 'ecpg'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/opt/bitnami/superset/superset/commands/database/validate_sql.py", 
line 69, in run
       errors = self._validator.validate(sql, catalog, schema, self._model)
     File "/opt/bitnami/superset/superset/sql_validators/postgres.py", line 42, 
in validate
       valid, error = check_string(sql, add_semicolon=True)
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/pgsanity/pgsanity.py", 
line 54, in check_string
       success, msg = ecpg.check_syntax(prepped_sql)
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/pgsanity/ecpg.py", 
line 20, in check_syntax
       raise OSError(msg)
   OSError: Unable to execute 'ecpg', you likely need to install it.'
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/flask/app.py", line 
1484, in full_dispatch_request
       rv = self.dispatch_request()
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/flask/app.py", line 
1469, in dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
     File 
"/opt/bitnami/superset/venv/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py",
 line 109, in wraps
       return f(self, *args, **kwargs)
     File "/opt/bitnami/superset/superset/views/base_api.py", line 120, in wraps
       duration, response = time_function(f, self, *args, **kwargs)
     File "/opt/bitnami/superset/superset/utils/core.py", line 1369, in 
time_function
       response = func(*args, **kwargs)
     File "/opt/bitnami/superset/superset/utils/log.py", line 304, in wrapper
       value = f(*args, **kwargs)
     File "/opt/bitnami/superset/superset/databases/api.py", line 1331, in 
validate_sql
       validator_errors = ValidateSQLCommand(pk, sql_request).run()
     File "/opt/bitnami/superset/superset/commands/database/validate_sql.py", 
line 88, in run
       raise ValidatorSQLError(superset_error) from ex
   superset.commands.database.exceptions.ValidatorSQLError: PostgreSQLValidator 
was unable to check your query.
   Please recheck your query.
   Exception: Unable to execute 'ecpg', you likely need to install it.'
   ```
   
   This solution on [27893](https://github.com/apache/superset/issues/27893) 
probably would work but it's kind of a pain to do that without building my own 
container image or messing with init containers, which is a pain. You would 
think this would just work out of the gate.


-- 
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-unsubscr...@superset.apache.org

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


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

Reply via email to