hmily3913 opened a new issue, #29497:
URL: https://github.com/apache/superset/issues/29497

   ### Bug description
   
   When creating a new database connection, fill in the correct URI, click Test 
Connection, and the username, password, and database error are displayed, which 
is actually correct.Error prompts such as pictures
   
   ### How to reproduce the bug
   
   1. docker compose 4.0.0 
   2. MySQL is used as the metadata database(The data is from version 1.4.0)
   3. docker exec -it superset_app /bin/bash,telnet 10.0.0.7 1433 succeed
   4. superset db upgrade
   superset init
   5. web login,add database connection,select other,use SQLAlchemy 
URI,“mssql+pymssql://sa:[email protected]:1433/xx” 
   6. test connection ,then Error
   7. 
   
   
   ### Screenshots/recordings
   
   
![image](https://github.com/apache/superset/assets/3221165/3e637fa5-0413-46f8-9d08-8da6ba42c5dd)
   
   
   ### Superset version
   
   4.0.1
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   2024-07-05 06:20:49,729:DEBUG:superset.stats_logger:[stats_logger] (incr) 
DatabaseRestApi.test_connection.error
   2024-07-05 06:20:49,730:WARNING:superset.views.base:SupersetErrorsException
   Traceback (most recent call last):
     File "/app/superset/commands/database/test_connection.py", line 171, in run
       raise DBAPIError(ex_str or None, None, None)
   sqlalchemy.exc.DBAPIError: (builtins.NoneType) None
   [SQL: (pymssql.exceptions.OperationalError) (20002, b'DB-Lib error message 
20002, severity 9:\nAdaptive Server connection failed (10.0.0.7)\nDB-Lib error 
message 20002, severity 9:\nAdaptive Server connection failed (10.0.0.7)\n')
   (Background on this error at: https://sqlalche.me/e/14/e3q8)]
   (Background on this error at: https://sqlalche.me/e/14/dbapi)
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in 
full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in 
dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
     File 
"/usr/local/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py",
 line 95, in wraps
       return f(self, *args, **kwargs)
     File "/app/superset/views/base_api.py", line 127, in wraps
       raise ex
     File "/app/superset/views/base_api.py", line 121, in wraps
       duration, response = time_function(f, self, *args, **kwargs)
     File "/app/superset/utils/core.py", line 1463, in time_function
       response = func(*args, **kwargs)
     File "/app/superset/utils/log.py", line 255, in wrapper
       value = f(*args, **kwargs)
     File "/app/superset/views/base_api.py", line 93, in wraps
       return f(self, *args, **kwargs)
     File "/app/superset/databases/api.py", line 920, in test_connection
       TestConnectionDatabaseCommand(item).run()
     File "/app/superset/commands/database/test_connection.py", line 200, in run
       raise SupersetErrorsException(errors) from ex
   superset.exceptions.SupersetErrorsException: [SupersetError(message='Either 
the username "sa", password, or database name "xx" is incorrect.', 
error_type=<SupersetErrorType.CONNECTION_ACCESS_DENIED_ERROR: 
'CONNECTION_ACCESS_DENIED_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, 
extra={'engine_name': 'Microsoft SQL Server', 'issue_codes': [{'code': 1014, 
'message': 'Issue 1014 - Either the username or the password is wrong.'}, 
{'code': 1015, 'message': 'Issue 1015 - Either the database is spelled 
incorrectly or does not exist.'}]})]
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [X] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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