Appearance
JFrog Common Errors
Below are some common errors you may encountered and how to troubleshoot it during the migration or onboarding to Jfrog Artifactory. Please note your error may not be the exact same as these examples.
401/403 Authentication Errors
Error: Exception in thread "main" java.io.IOException: Server returned HTTP response code: 401 for URL: https://jfrog.ford.com/artifactory/gradle-distributions/gradle-8.5-bin.zip
Possible Reasons: Wrong gradle wrapper credentials, GRADLE_OPTS environment variable not set up correctly, or not enough permissions.
Troubleshoot:
- Use curl to see if you can download the artifact (from OS level terminal/cmd prompt):
- curl -H "Authorization: Bearer <TOKEN>" "url-to-artifacts-file"
curl -H "Authorization: Bearer <TOKEN>" "https://jfrog.ford.com/artifactory/external-proxy-group/org/hibernate/hibernate-validator-parent/5.0.3.Final/hibernate-validator-parent-5.0.3.Final.pom"
- If result is success, then check your environment variables configuration. See Local Environment Configuration for details.
- Run gradle build cmd with wrapper parameters (from OS level terminal/cmd prompt):
gradlew -Dgradle.wrapperUser=<CDSID>@ford.com -Dgradle.wrapperPassword=<TOKEN> clean build
- If result is success, then check your build environment configuration. See Codespace Configuration for details.
- Use curl to see if you can download the artifact (from OS level terminal/cmd prompt):
Errors:
Failed to get resource: HEAD. [HTTP HTTP/1.1 401 : https://jfrog.ford.com/artifactory/public-maven-ford/com/ford/cloudnative/spring-boot-starter-ford/5.0.0/spring-boot-starter-ford-5.0.0.pom]
Failed to get resource: HEAD. [HTTP HTTP/1.1 403 : https://jfrog.ford.com/artifactory/FCE-CRE-API/com/ford/cloudnative/spring-base-security/2.0.0/spring-base-security-2.0.0.pom]
Could not resolve org.springframework.cloud:spring-cloud-dependencies:2022.0.3.
Could not get resource 'https://jfrog.ford.com/artifactory/external-proxy-group/org/springframework/cloud/spring-cloud-dependencies/2022.0.3/spring-cloud-dependencies-2022.0.3.pom'.
Could not HEAD 'https://jfrog.ford.com/artifactory/external-proxy-group/org/springframework/cloud/spring-cloud-dependencies/2022.0.3/spring-cloud-dependencies-2022.0.3.pom'. Received status code 401 from server:
Possible Reason: Wrong credentials, Jfrog credentials environment variables not configure correctly, or does not have the a repositories block in your build.gradle file.
Troubleshoot:
- Use curl to see if you can download the artifact.
> curl -O "<URL-TO-ARTIFACT>" -u CDSID@ford.com:<TOKEN>
- If result is success, perform the following checks:
- Make sure you set up your OS environment variables correctly See Local Environment Configuration for details.
- Hardcode the jfrog credentials in your settings.gradle and/or build.gradle and rebuild - testing purpose only.
- Make sure
repositories {
andgradleBoost {
code blocks are in your build.gradle file and rebuild. See example below:
// optional, depends on your project repositories { maven { url repositoryUrlProxy // ex. repositoryUrlProxy could be https://jfrog.ford.com/artifactory/external-proxy-group/ credentials{ username=System.getenv("ARTIFACTORY_USER") password=System.getenv("ARTIFACTORY_PASSWORD") } } maven { url repositoryUrlPublic // ex. repositoryUrlPublic could be https://jfrog.ford.com/artifactory/public-maven-ford/ credentials{ username=System.getenv("ARTIFACTORY_USER") password=System.getenv("ARTIFACTORY_PASSWORD") } } } // optional, depends on your project gradleBoost { dependencies { defaultRepositories = {} } }
Gradle Boost/Springframework Error
Errors:
What went wrong:
Plugin [id: 'gradle-boost', version: '5.1.0'] was not found in any of the following sources:
Plugin [id: 'org.springframework.boot', version: '3.1.6'] was not found in any of the following sources:
Possible Reason: Wrong credentials, Jfrog credentials environment variables not configure correctly, or does not have the a repositories block in your settings.gradle file.
Troubleshoot:
- Use curl to see if you can download the artifact.
- Hardcode the jfrog credentials in your settings.gradle and/or build.gradle and rebuild - testing purpose only.
- Add/Configure a settings.gradle file for your project. See example in Codespace Configuration