alee68 opened a new issue #18563:
URL: https://github.com/apache/superset/issues/18563


   Getting this error when attempting to edit a DB: "An error occurred while 
fetching databases: Fatal error"
   
   Similar to [this 
issue](https://github.com/apache/superset/issues/7364#issuecomment-508494849), 
and issue can be seen in Chrome, Edge, and Firefox. What may have caused the 
issue: I was doing some testing with dropping the Superset DB in my local 
instance's Postgres; I did a pg_restore afterwards though, so the DB is 
populated with the data again, but the web UI is still broken.
   
   This is on a local install of Superset via Docker Compose. I have another 
Superset instance on an EKS cluster which contains test data; I am attempting 
to migrate the data from the EKS Superset to my local Superset for testing 
purposes and am facing issue after issue. I am also facing the [ValueError: 
Invalid decryption key issue described 
here](https://github.com/apache/superset/issues/8538), but the various 
suggested fixes involve working with the web UI, which I cannot use due to this 
issue.
   
   #### How to reproduce the bug
   
   1. In local Superset Postgres, drop Superset DB, then pg_restore it
   2. Log into local Superset's web UI
   3. Go to Databases and attempt to edit an existing one
   4. See error
   
   ### Expected results
   
   A window with the DB parameters should appear, like the window you see when 
adding a new DB.
   
   ### Actual results
   Get a blank window and the error "An error occurred while fetching 
databases: Fatal error"
   
   #### Screenshots
   <img width="1112" alt="Screen Shot 2022-02-02 at 10 07 19 PM" 
src="https://user-images.githubusercontent.com/9437481/152275254-7d1e2d5d-0fb2-46e3-ae6e-71dbe1928b14.png";>
   
   ### Environment
   
   - Chrome 98.0.4758.80 (Official Build) (x86_64), Edge 97.0.1072.76 (Official 
build) (x86_64), Firefox 96.0.3 (64-bit)
   - superset version: Local 0.0.0dev, EKS 0.0.0dev (I believe I saw the 
version on both as 1.4.0 a day or two ago though)
   - python version: 3.8.12 in my local superset_app container
   - node.js version: is not installed
   - 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.
   
   Traceback (most recent call last):
   
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy_utils/types/encrypted/encrypted_type.py",
 line 128, in decrypt
   
       decrypted = decrypted.decode('utf-8')
   
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9a in position 1: 
invalid start byte
   
   
   During handling of the above exception, another exception occurred:
   
   
   Traceback (most recent call last):
   
     File 
"/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 
85, in wraps
   
       return f(self, *args, **kwargs)
   
     File 
"/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 
155, in wraps
   
       return f(self, *args, **kwargs)
   
     File 
"/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 
1475, in get
   
       return self.get_headless(pk, **kwargs)
   
     File "/app/superset/utils/log.py", line 242, in wrapper
   
       value = f(*args, **kwargs)
   
     File "/app/superset/views/base_api.py", line 406, in get_headless
   
       duration, response = time_function(super().get_headless, pk, **kwargs)
   
     File "/app/superset/utils/core.py", line 1429, in time_function
   
       response = func(*args, **kwargs)
   
     File 
"/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 
1371, in get_headless
   
       item = self.datamodel.get(pk, self._base_filters, 
self.show_select_columns)
   
     File 
"/usr/local/lib/python3.8/site-packages/flask_appbuilder/models/sqla/interface.py",
 line 934, in get
   
       item = self.apply_all(
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", 
line 3459, in one_or_none
   
       ret = list(self)
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", 
line 100, in instances
   
       cursor.close()
   
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 
68, in __exit__
   
       compat.raise_(
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", 
line 182, in raise_
   
       raise exception
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", 
line 80, in instances
   
       rows = [proc(row) for row in fetch]
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", 
line 80, in <listcomp>
   
       rows = [proc(row) for row in fetch]
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", 
line 579, in _instance
   
       _populate_full(
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", 
line 725, in _populate_full
   
       dict_[key] = getter(row)
   
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/type_api.py", 
line 1278, in process
   
       return process_value(impl_processor(value), dialect)
   
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy_utils/types/encrypted/encrypted_type.py",
 line 477, in process_result_value
   
       value = super().process_result_value(value=value, dialect=dialect)
   
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy_utils/types/encrypted/encrypted_type.py",
 line 422, in process_result_value
   
       decrypted_value = self.engine.decrypt(value)
   
     File 
"/usr/local/lib/python3.8/site-packages/sqlalchemy_utils/types/encrypted/encrypted_type.py",
 line 130, in decrypt
   
       raise ValueError('Invalid decryption key')
   
   ValueError: Invalid decryption key
   
   172.19.0.1 - - [03/Feb/2022 03:53:12] "GET /api/v1/database/3 HTTP/1.1" 500 -
   
   2022-02-03 03:53:12,460:INFO:werkzeug:172.19.0.1 - - [03/Feb/2022 03:53:12] 
"GET /api/v1/database/3 HTTP/1.1" 500 -
   
   2022-02-03 03:53:12,462:DEBUG:superset.stats_logger:[stats_logger] (incr) 
DatabaseRestApi.available.success
   
   2022-02-03 03:53:12,462:DEBUG:superset.stats_logger:[stats_logger] (timing) 
DatabaseRestApi.available.time | 29.738799996266607 
   
   172.19.0.1 - - [03/Feb/2022 03:53:12] "GET /api/v1/database/available/ 
HTTP/1.1" 200 -
   
   2022-02-03 03:53:12,463:INFO:werkzeug:172.19.0.1 - - [03/Feb/2022 03:53:12] 
"GET /api/v1/database/available/ HTTP/1.1" 200 -
   
   127.0.0.1 - - [03/Feb/2022 03:53:36] "GET /health HTTP/1.1" 200 -
   
   2022-02-03 03:53:36,682:INFO:werkzeug:127.0.0.1 - - [03/Feb/2022 03:53:36] 
"GET /health HTTP/1.1" 200 -
   
   ### 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.

To unsubscribe, e-mail: [email protected]

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