org.artifactory.storage.fs.VfsException: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'repo' at ro w 1

JFrog JIRA | Roman Finkelnburg | 5 months ago
  1. 0

    We tried to create a repository with a name longer than 64 characters using the Artifactory REST API. The name length seems not to be checked by the API before requests are send to the DB backend (repo keys are limited to varchar(64) in MySQL). This leads to an inconsistency between (at least) the tables `configs` and `nodes` in the MySQL DB after the creation attempt. {code} $ curl -S -s -u ******:****** -X PUT "https://******/artifactory/api/repositories/naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release" -H "Content-Type: application/json" -d '{"name":"naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release","rclass":"local","packageType":"maven"}' { "errors" : [ { "status" : 400, "message" : "Failed to reload configuration: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'repo' at row 1\n" } ] } {code} {code} $ curl -S -s -u ******:****** -X GET "https://******/artifactory/api/repositories" [ { "key" : "naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release", "description" : "", "type" : "LOCAL", "url" : "http://artifactory.olx.berlin/artifactory/naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release" } ] {code} {code} mysql> select * from nodes where repo = 'naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release'; Empty set (0.04 sec) {code} {code} $ mysqldump -h ****** -u ****** -p artifactorydb configs | tr ' ' '\n' | grep naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release Enter password <key>naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release</key>\n {code} {code} 2016-07-08 09:38:41,819 [http-nio-8081-exec-8] [WARN ] (o.a.s.f.l.SessionLockEntry:116) - Mutable item 'naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release:' has local modifications that will be discarded. 2016-07-08 09:38:41,832 [http-nio-8081-exec-8] [ERROR] (o.a.c.CentralConfigServiceImpl:310) - Failed to reload configuration: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'repo' at row 1 org.artifactory.storage.fs.VfsException: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'repo' at ro w 1 at org.artifactory.storage.db.fs.service.FileServiceImpl.createFolder(FileServiceImpl.java:116) ~[artifactory-storage-db-4.9.0.jar:na] at org.artifactory.storage.db.fs.model.DbMutableFolder.doCreateNode(DbMutableFolder.java:118) ~[artifactory-storage-db-4.9.0.jar:na] at org.artifactory.storage.db.fs.model.DbMutableItem.save(DbMutableItem.java:207) ~[artifactory-storage-db-4.9.0.jar:na] ... {code} While the web interface denies to create repos with names longer than 64 chars in the first place, `too long named` repos created using the API are displayed without any error. However, changing setting like permissions using the Web interface will again lead to exceptions when the DB is updated due to limitations in the table schema.

    JFrog JIRA | 5 months ago | Roman Finkelnburg
    org.artifactory.storage.fs.VfsException: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'repo' at ro w 1
  2. 0

    By doing the following flow: - Create a file a/b - Download it - Delete it - Create a file a/b/c.txt - Wait for statistics to be flushed - Delete a/b fails with: {code} 2014-04-02 17:14:17.434:WARN:oejs.ServletHandler:qtp1008803392-210: /artifactory/dist-packages/does_not_exist_x org.artifactory.storage.fs.VfsException: Failed to delete item with id '58': DELETE on table 'NODES' caused a violation of foreign key constraint 'STATS_NODES_FK' for key (58). The statement has been rolled back. at org.artifactory.storage.db.fs.service.FileServiceImpl.deleteItem(FileServiceImpl.java:172) at org.artifactory.storage.db.fs.model.DbMutableItem.save(DbMutableItem.java:211) at org.artifactory.storage.fs.lock.SessionLockEntry.save(SessionLockEntry.java:72) at org.artifactory.storage.db.fs.session.SqlStorageSession.save(SqlStorageSession.java:66) at org.artifactory.storage.db.spring.SessionSynchronization.beforeCommit(SessionSynchronization.java:74) at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:95) at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:928) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:740) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:478) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:272) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy41.undeploy(Unknown Source) at org.artifactory.repo.webdav.WebdavServiceImpl.deleteItem(WebdavServiceImpl.java:278) at org.artifactory.repo.webdav.WebdavServiceImpl.handleDelete(WebdavServiceImpl.java:271) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) at com.sun.proxy.$Proxy81.handleDelete(Unknown Source) at org.artifactory.webapp.servlet.RepoFilter.doWebDavMethod(RepoFilter.java:188) at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:153) at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:86) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632) at org.artifactory.webapp.servlet.AccessFilter.useAuthentication(AccessFilter.java:314) at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:218) at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:184) at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:152) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632) at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:61) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632) at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:92) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1624) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1112) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:479) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1046) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:462) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:281) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232) at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) at java.lang.Thread.run(Thread.java:722) {code}

    JFrog JIRA | 3 years ago | Frederic Simon
    org.artifactory.storage.fs.VfsException: Failed to delete item with id '58': DELETE on table 'NODES' caused a violation of foreign key constraint 'STATS_NODES_FK' for key (58). The statement has been rolled back.
  3. 0

    By doing the following flow: - Create a file a/b - Download it - Delete it - Create a file a/b/c.txt - Wait for statistics to be flushed - Delete a/b fails with: {code} 2014-04-02 17:14:17.434:WARN:oejs.ServletHandler:qtp1008803392-210: /artifactory/dist-packages/does_not_exist_x org.artifactory.storage.fs.VfsException: Failed to delete item with id '58': DELETE on table 'NODES' caused a violation of foreign key constraint 'STATS_NODES_FK' for key (58). The statement has been rolled back. at org.artifactory.storage.db.fs.service.FileServiceImpl.deleteItem(FileServiceImpl.java:172) at org.artifactory.storage.db.fs.model.DbMutableItem.save(DbMutableItem.java:211) at org.artifactory.storage.fs.lock.SessionLockEntry.save(SessionLockEntry.java:72) at org.artifactory.storage.db.fs.session.SqlStorageSession.save(SqlStorageSession.java:66) at org.artifactory.storage.db.spring.SessionSynchronization.beforeCommit(SessionSynchronization.java:74) at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:95) at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:928) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:740) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:478) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:272) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy41.undeploy(Unknown Source) at org.artifactory.repo.webdav.WebdavServiceImpl.deleteItem(WebdavServiceImpl.java:278) at org.artifactory.repo.webdav.WebdavServiceImpl.handleDelete(WebdavServiceImpl.java:271) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) at com.sun.proxy.$Proxy81.handleDelete(Unknown Source) at org.artifactory.webapp.servlet.RepoFilter.doWebDavMethod(RepoFilter.java:188) at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:153) at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:86) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632) at org.artifactory.webapp.servlet.AccessFilter.useAuthentication(AccessFilter.java:314) at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:218) at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:184) at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:152) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632) at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:61) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632) at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:92) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1624) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1112) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:479) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1046) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:462) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:281) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232) at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) at java.lang.Thread.run(Thread.java:722) {code}

    JFrog JIRA | 3 years ago | Frederic Simon
    org.artifactory.storage.fs.VfsException: Failed to delete item with id '58': DELETE on table 'NODES' caused a violation of foreign key constraint 'STATS_NODES_FK' for key (58). The statement has been rolled back.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.artifactory.storage.fs.VfsException

      com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'repo' at ro w 1

      at org.artifactory.storage.db.fs.service.FileServiceImpl.createFolder()
    2. org.artifactory.storage
      DbMutableItem.save
      1. org.artifactory.storage.db.fs.service.FileServiceImpl.createFolder(FileServiceImpl.java:116)[artifactory-storage-db-4.9.0.jar:na]
      2. org.artifactory.storage.db.fs.model.DbMutableFolder.doCreateNode(DbMutableFolder.java:118)[artifactory-storage-db-4.9.0.jar:na]
      3. org.artifactory.storage.db.fs.model.DbMutableItem.save(DbMutableItem.java:207)[artifactory-storage-db-4.9.0.jar:na]
      3 frames