Details

    • Type: Bug
    • Status: Resolved
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: 4.9.0
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Artifactory HA, S3, RDS (MySQL)

      Description

      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.

      $ 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"
        } ]
      }
      
      $ 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"
      } ]
      
      mysql> select * from nodes where repo = 'naspersclassifieds-regional-olxsea-olxid-atlas-android-maven-release';
      Empty set (0.04 sec)
      
      $ 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
      
      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]
      ...
      

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                roman.finkelnburg Roman Finkelnburg
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: