yuqi1129 opened a new issue, #14704:
URL: https://github.com/apache/gravitino/issues/14704

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   JDBC catalogs report several source refusals as HTTP 500, and some hide the 
source's reason:
   
   1. `JdbcExceptionConverter`, `StarRocksExceptionConverter` and the Paimon 
`CatalogUtils` pass the source message as a format string. A MySQL message such 
as `Access denied for user 'u'@'%'` then fails with 
`UnknownFormatConversionException`, and the real reason is lost.
   2. `PostgreSqlExceptionConverter` checks only the top-level SQLState. The 
connection pool wraps the driver error, so an unreachable source returns 500 
instead of 502.
   3. A rejected login (SQLSTATE class 28, for example after a password change) 
returns 500 instead of 502.
   4. Requests that PostgreSQL refuses because of the request itself (SQLSTATE 
classes 22, 23 and 42, and 2BP01 such as a table drop with dependent views) 
return 500 instead of 400.
   
   ### Error message and/or stacktrace
   
   ```
   java.util.UnknownFormatConversionException: Conversion = '''
   ```
   
   ### How to reproduce
   
   1. Create a `jdbc-mysql` catalog whose user has host `%` and no CREATE 
privilege, then create a schema: the error is 
`UnknownFormatConversionException`.
   2. Create a `jdbc-postgresql` catalog for an unreachable host with 
`verify-on-create=false`, then list tables: HTTP 500.
   3. Drop a PostgreSQL table that a view depends on: HTTP 500.
   
   ### Additional context
   
   _No response_
   


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

Reply via email to