Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-17478

Cannot set up Artifactory OSS using mysql.properties example

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 6.4.0
    • Fix Version/s: None
    • Component/s: Database, Installer
    • Labels:
      None

      Description

      mysql.properties specifies the following parameters to be set:

      type=mysql
      driver=com.mysql.jdbc.Driver
      url=jdbc:mysql://localhost:3306/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true
      username=artifactory
      password=password
      

      Setting these parameters will work on PRO version, but in OSS, the start up will fail (due to difference in .sh script between versions).

      2018-09-06 15:48:04  [284 entrypoint-artifactory.sh] Checking DB_TYPE
      2018-09-06 15:48:04  [287 entrypoint-artifactory.sh] DB_TYPE is set to mysql
      2018-09-06 15:48:04  [216 entrypoint-artifactory.sh] DB_HOST is set to mysql
      2018-09-06 15:48:04  [218 entrypoint-artifactory.sh] Checking if need to copy mysql configuration
      2018-09-06 15:48:04  [234 entrypoint-artifactory.sh] Copying mysql configuration...
      2018-09-06 15:48:04  [241 entrypoint-artifactory.sh] Setting DB_URL to jdbc:mysql://172.17.0.3:3306/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true
      2018-09-06 15:48:04  [245 entrypoint-artifactory.sh] Setting DB_USER to artifactory
      2018-09-06 15:48:04  [249 entrypoint-artifactory.sh] Setting DB_PASSWORD to **********
      2018-09-06 15:48:04  [268 entrypoint-artifactory.sh] Setting DB_HOST to mysql
      2018-09-06 15:48:04  [193 entrypoint-artifactory.sh] Waiting for DB mysql to be ready on mysql/3306 within 30 seconds
      2018-09-06 15:48:04  [201 entrypoint-artifactory.sh] .
      ...
      2018-09-06 15:48:34  [201 entrypoint-artifactory.sh] .
      2018-09-06 15:48:35   [34 entrypoint-artifactory.sh] ERROR: DB mysql failed to start in the given time
      

      Please, note that the script tries to connect to "mysql" host. In PRO, it would attempt to connect to 172.17.0.3

      Workaround #1: specify DB_HOST variable explicitly

      However, in this case, parsing of URL will fail in OSS:

      Malformed database URL, failed to parse the connection string near '=jdbc:mysql://172.17.0.9:3306/artdb?characterEncoding=UTF-8&elideSetAutoCommits=trueelideSetAutoCommits=true'.
      	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
      

      Workaround #2: remove DB_URL variable

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alexd Alex Dvorkin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: