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

Gradle build passing non authenticated user

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Not a Bug
    • Affects Version/s: 5.8.3
    • Fix Version/s: None
    • Component/s: Gradle
    • Labels:
      None
    • Severity:
      Critical

      Description

      Unless I am missing something, this is the way to reproduce it

      1. remove the anonymous user from artifactory
      2. Grant a user to read/write access to gradle repo
      3. Run gradlew build --debug

      Your build fails with the following error for example

      • What went wrong:
        Could not resolve all files for configuration ':api:compileClasspath'.
        > Could not resolve commons-lang:commons-lang:2.4.
        Required by:
        project :api
        > Could not resolve commons-lang:commons-lang:2.4.
        > Could not get resource 'http://artifactory.local:8081/artifactory/gradle-dev-local/commons-lang/commons-lang/2.4/commons-lang-2.4.pom'.
        > Could not HEAD 'http://artifactory.local:8081/artifactory/gradle-dev-local/commons-lang/commons-lang/2.4/commons-lang-2.4.pom'. Received status code 401 from server: Unauthorized
        > Could not resolve commons-lang:commons-lang:2.4.
        > Could not get resource 'http://artifactory.local:8081/artifactory/gradle-dev-local/commons-lang/commons-lang/ivy-2.4.xml'.
        > Could not GET 'http://artifactory.local:8081/artifactory/gradle-dev-local/commons-lang/commons-lang/ivy-2.4.xml'. Received status code 403 from server: Forbidden
        > Could not resolve org.apache.wicket:wicket:1.3.7.
        Required by:
        project :api
        > Could not resolve org.apache.wicket:wicket:1.3.7.
        > Could not get resource 'http://artifactory.local:8081/artifactory/gradle-dev-local/org/apache/wicket/wicket/1.3.7/wicket-1.3.7.pom'.
        > Could not GET 'http://artifactory.local:8081/artifactory/gradle-dev-local/org/apache/wicket/wicket/1.3.7/wicket-1.3.7.pom'. Received status code 401 from server: Unauthorized
        > Could not resolve org.apache.wicket:wicket:1.3.7.
        > Could not get resource 'http://artifactory.local:8081/artifactory/gradle-dev-local/org.apache.wicket/wicket/ivy-1.3.7.xml'.
        > Could not GET 'http://artifactory.local:8081/artifactory/gradle-dev-local/org.apache.wicket/wicket/ivy-1.3.7.xml'. Received status code 403 from server: Forbidden

      The request.log shows gradle is passsing anonymous and thus non-authenticated user
      20180307160554|9|REQUEST|127.0.0.1|anonymous|GET|/gradle-dev-local/org/apache/wicket/wicket/1.3.7/wicket-1.3.7.pom|HTTP/1.1|401|0
      20180307160554|9|REQUEST|127.0.0.1|anonymous|HEAD|/gradle-dev-local/commons-lang/commons-lang/2.4/commons-lang-2.4.pom|HTTP/1.1|401|0
      20180307160554|1|REQUEST|127.0.0.1|non_authenticated_user|GET|/gradle-dev-local/org/apache/wicket/wicket/1.3.7/wicket-1.3.7.pom|HTTP/1.1|403|0
      20180307160554|1|REQUEST|127.0.0.1|anonymous|GET|/gradle-dev-local/org.apache.wicket/wicket/ivy-1.3.7.xml|HTTP/1.1|401|0
      20180307160554|2|REQUEST|127.0.0.1|non_authenticated_user|GET|/gradle-dev-local/org.apache.wicket/wicket/ivy-1.3.7.xml|HTTP/1.1|403|0
      20180307160555|150|REQUEST|127.0.0.1|non_authenticated_user|HEAD|/gradle-dev-local/commons-lang/commons-lang/2.4/commons-lang-2.4.pom|HTTP/1.1|401|0
      20180307160555|1|REQUEST|127.0.0.1|non_authenticated_user|GET|/gradle-dev-local/commons-lang/commons-lang/ivy-2.4.xml|HTTP/1.1|403|0

      ------gradle.properties
      artifactory_user=joonl
      artifactory_password=XXXXXXX
      artifactory_contextUrl=http://artifactory.local:8081/artifactory

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              joonl Joon Lee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-16063 -
                  SYNCHRONIZED
                  • Last Sync Date: