You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "AlekHed (via GitHub)" <gi...@apache.org> on 2024/05/09 21:44:15 UTC

[I] UncheckedSQLException while trying to CREATE or DROP TABLE [iceberg]

AlekHed opened a new issue, #10298:
URL: https://github.com/apache/iceberg/issues/10298

   ### Apache Iceberg version
   
   1.5.1
   
   ### Query engine
   
   Trino
   
   ### Please describe the bug 🐞
   
   I am using dbt to built stage tables on iceberg with trino 446, at some point I sucked with error on build run: 
   "Server error: UncheckedSQLException: Unknown failure" on CREATE TABLE for any table name
   and
   "Server error: UncheckedSQLException: Failed to execute: DELETE FROM iceberg_tables WHERE catalog_name = ? AND table_namespace  = ? AND table_name = ? AND (iceberg_type = 'TABLE' OR iceberg_type IS NULL)" on DROP TABLE for any existing table.
   
   I still can select table content, manage snapshots and do rewrite table, even delete orphan data, but can't delete table.
   
   I checked REST Catalog logs and found this error:
   `ERROR [org.apache.iceberg.rest.RESTCatalogServlet] - Error processing REST request
   org.apache.iceberg.exceptions.RESTException: Unhandled error: ErrorResponse(code=500, type=UncheckedSQLException, message=Failed to execute: DELETE FROM iceberg_tables WHERE catalog_name = ? AND table_namespace  = ? AND table_name = ? AND (iceberg_type = 'TABLE' OR iceberg_type IS NULL))
   org.apache.iceberg.jdbc.UncheckedSQLException: Failed to execute: DELETE FROM iceberg_tables WHERE catalog_name = ? AND table_namespace  = ? AND table_name = ? AND (iceberg_type = 'TABLE' OR iceberg_type IS NULL)
   	at org.apache.iceberg.jdbc.JdbcCatalog.execute(JdbcCatalog.java:707)
   	at org.apache.iceberg.jdbc.JdbcCatalog.execute(JdbcCatalog.java:690)
   	at org.apache.iceberg.jdbc.JdbcCatalog.dropTable(JdbcCatalog.java:280)
   	at org.apache.iceberg.rest.CatalogHandlers.purgeTable(CatalogHandlers.java:262)
   	at org.apache.iceberg.rest.RESTCatalogAdapter.handleRequest(RESTCatalogAdapter.java:362)
   	at org.apache.iceberg.rest.RESTServerCatalogAdapter.handleRequest(RESTServerCatalogAdapter.java:42)
   	at org.apache.iceberg.rest.RESTCatalogAdapter.execute(RESTCatalogAdapter.java:527)
   	at org.apache.iceberg.rest.RESTCatalogServlet.execute(RESTCatalogServlet.java:100)
   	at org.apache.iceberg.rest.RESTCatalogServlet.doDelete(RESTCatalogServlet.java:84)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
   	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
   	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:554)
   	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
   	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:722)
   	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
   	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
   	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
   	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
   	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
   	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
   	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
   	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
   	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
   	at org.eclipse.jetty.server.Server.handle(Server.java:516)
   	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
   	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
   	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
   	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
   	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
   	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
   	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
   	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
   	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
   	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
   	at java.base/java.lang.Thread.run(Thread.java:840)
   Caused by: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
   	at org.sqlite.core.DB.newSQLException(DB.java:1179)
   	at org.sqlite.core.DB.newSQLException(DB.java:1190)
   	at org.sqlite.core.DB.execute(DB.java:985)
   	at org.sqlite.core.DB.executeUpdate(DB.java:1054)
   	at org.sqlite.jdbc3.JDBC3PreparedStatement.lambda$executeLargeUpdate$2(JDBC3PreparedStatement.java:129)
   	at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:454)
   	at org.sqlite.jdbc3.JDBC3PreparedStatement.executeLargeUpdate(JDBC3PreparedStatement.java:124)
   	at org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:105)
   	at org.apache.iceberg.jdbc.JdbcCatalog.lambda$execute$19(JdbcCatalog.java:702)
   	at org.apache.iceberg.ClientPoolImpl.run(ClientPoolImpl.java:58)
   	at org.apache.iceberg.ClientPoolImpl.run(ClientPoolImpl.java:51)
   	at org.apache.iceberg.jdbc.JdbcCatalog.execute(JdbcCatalog.java:695)
   	... 39 more
   	at org.apache.iceberg.rest.RESTCatalogAdapter.execute(RESTCatalogAdapter.java:544)
   	at org.apache.iceberg.rest.RESTCatalogServlet.execute(RESTCatalogServlet.java:100)
   	at org.apache.iceberg.rest.RESTCatalogServlet.doDelete(RESTCatalogServlet.java:84)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
   	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
   	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:554)
   	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
   	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:722)
   	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
   	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
   	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
   	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
   	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
   	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
   	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
   	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
   	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
   	at org.eclipse.jetty.server.Server.handle(Server.java:516)
   	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
   	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
   	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
   	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
   	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
   	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
   	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
   	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
   	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
   	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
   	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
   	at java.base/java.lang.Thread.run(Thread.java:840)`
   
   Looks like underline JDBC driver can't run drop table statement. I don't unserstand what can cause this type of error and how to diagnose it.


-- 
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: issues-unsubscribe@iceberg.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] UncheckedSQLException while trying to CREATE or DROP TABLE [iceberg]

Posted by "yogeshVU (via GitHub)" <gi...@apache.org>.
yogeshVU commented on issue #10298:
URL: https://github.com/apache/iceberg/issues/10298#issuecomment-2237809292

   Is there any solution to this? I think this is a valid bug and should be reopened @AlekHed 


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] UncheckedSQLException while trying to CREATE or DROP TABLE [iceberg]

Posted by "AlekHed (via GitHub)" <gi...@apache.org>.
AlekHed commented on issue #10298:
URL: https://github.com/apache/iceberg/issues/10298#issuecomment-2103686289

   I think the problem is in sqlite configuration for catalog. Switching to postgres can fix the problem.


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] UncheckedSQLException while trying to CREATE or DROP TABLE [iceberg]

Posted by "AlekHed (via GitHub)" <gi...@apache.org>.
AlekHed closed issue #10298: UncheckedSQLException while trying to CREATE or DROP TABLE
URL: https://github.com/apache/iceberg/issues/10298


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org