Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 for build-info-extractor-gradle-4.15.2-uber.jar #547

Closed
sebasira opened this issue Aug 12, 2021 · 6 comments
Closed

403 for build-info-extractor-gradle-4.15.2-uber.jar #547

sebasira opened this issue Aug 12, 2021 · 6 comments
Labels
question Further information is requested

Comments

@sebasira
Copy link

sebasira commented Aug 12, 2021

I'm using jFrog CLI v1.39.7 to upload an Android .aar library to Artifactory (because newer version do not support yet) and it was working fine, but now I get this message:

$ ./jfrog rt gradle-config --use-wrapper=true --repo-resolve=$GRADLE_REPO_KEY --server-id-resolve=Default-Server --repo-deploy=$GRADLE_REPO_KEY --server-id-deploy=Default-Server # collapsed multi-line command
[Info] gradle build config successfully created.
[Info] Downloading bintray/jcenter/org/jfrog/buildinfo/build-info-extractor-gradle/4.15.2/build-info-extractor-gradle-4.15.2-uber.jar
[Error] 403 Forbidden 
ERROR: Job failed: exit code 1

Have you lock the access to that file?

@sebasira sebasira added the question Further information is requested label Aug 12, 2021
@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 12, 2021

Thanks for asking this question @sebasira.
The issue you see is probably the result of the sunset of Bintray. Please go ahead and upgraded your JFrog CLI version resolve the issue.
Please let us know if you have follow up questions.

@sebasira
Copy link
Author

Thanks for your fast reply, I was assuming that but I wanted confirmation.

Sadly I can not update to the any version of jFrog CLI above1.39.7, because since v1.40 Android .aar artifacts are not uploaded.

Maybe you can take a look at this to help me out: jfrog/jfrog-cli#880. Which is the same as #406, but you'll find more info in the jFrog CLI repo.

Thank you 🙏

@DanielJRutledge
Copy link

DanielJRutledge commented Aug 12, 2021

@sebasira I saw this behavior with 1.40, I also assume it has to do with sunsetting jcenter. You can override the download target of these jars with

export JFROG_CLI_JCENTER_REMOTE_SERVER=artifactory
export JFROG_CLI_JCENTER_REMOTE_REPO=maven-repo

Where in this case artifactory is the repo defined with my rt config command and maven-repo is a repo that has jcenter available as a remote repo in its resources.

@sebasira
Copy link
Author

@DanielJRutledge thanks for your input. I'm using a GitLab YAML script to upload the artifacts. Here's my script:

image: jangrewe/gitlab-ci-android


before_script:
  - export GRADLE_USER_HOME=$(pwd)/.gradle
  - chmod +x ./gradlew

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .gradle/
variables:
  GRADLE_VERSION: "6.8.3"
  ARTIFACT_NAME: "my-artifact-name"
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"


stages:
  - deploy

.connect_artifactory: &connect_artifactory |
  curl -fL https://getcli.jfrog.io | sh
  ./jfrog config add --artifactory-url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS --interactive=false
  ./jfrog c show



number=$CI_JOB_ID
.upload_artifact: &upload_artifact |
  ./jfrog rt gradle-config --use-wrapper=true --repo-resolve=$GRADLE_REPO_KEY --server-id-resolve=Default-Server --repo-deploy=$GRADLE_REPO_KEY --server-id-deploy=Default-Server
  ./jfrog rt gradle clean assembleRelease artifactoryPublish -b build.gradle --build-name=$ARTIFACT_NAME --build-number=$CI_JOB_ID


# This docker image does not have Gradle installed, so install it
.install_gradle: &install_gradle |
  curl -L https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-all.zip -o gradle.zip
  unzip -q gradle.zip
  export GRADLE_HOME=$(pwd)/gradle-$GRADLE_VERSION
  export PATH=${GRADLE_HOME}/bin:${PATH}
  echo $GRADLE_HOME
  echo $PATH
  gradle -v




publish:
  stage: deploy
  cache: {}
  script:
    # Download and Install Gradle
    - *install_gradle
    # Connect to JFrog Artifactory
    - *connect_artifactory
    # Replace the repository name in the configuration.yml to the correct one.
    - sed -i 's,GRADLE_REPO_KEY,'"$GRADLE_REPO_KEY"',g' configuration.yaml
    # Upload artifact to JFrog Artifactory
    - *upload_artifact

I'm not an expert on this area, that's why I need more guidance.

Should I call those exports before calling ./jfrog rt gradle-config --use-wrapper=true ........? And I don't know if I know what those values should be for me or if I need to leave the same values you put them (I mean artifactory and maven-repo)

Thank you very much!

@DanielJRutledge
Copy link

Yes, you'd be running before your gradle config. In your case, you'd be looking at

export JFROG_CLI_JCENTER_REMOTE_SERVER=Default-Server
export JFROG_CLI_JCENTER_REMOTE_REPO=$GRADLE_REPO_KEY

You'd be sending it through the same repo you using for your build config. This assumes you have jcenter in your gradle repo.

@sebasira
Copy link
Author

Thank you very much! Now I can upload artifacts to Artifactory again!

I'm closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants