Azure / azure-acr-plugin

Jenkins Azure ACR plugin
MIT License
2 stars 10 forks source link

Failed to set docker credentials #39

Closed joshua-alday closed 5 years ago

joshua-alday commented 5 years ago

Hello, I've been bashing my face up against this all day, and I hate to say that I've not been able to work around this. I'm using the "Queue an ACR Quick Task" build step in a freestyle project. The credentials I've provided are MSI credentials defined on the VM in Azure. I know the credentials are fine, since I'm able to autocomplete the resource group and container registry. Here's the error log I'm getting.

`Started by user [EnvInject] - Loading node environment variables. Building in workspace /var/lib/jenkins/workspace/Java-Builder-Image-Build using credential

git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url # timeout=10 Fetching upstream changes from git --version # timeout=10 using GIT_ASKPASS to set credentials BitBucket Login credentials for temporary use. git fetch --tags --progress +refs/heads/:refs/remotes/origin/ git rev-parse refs/remotes/origin/master^{commit} # timeout=10 git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision (refs/remotes/origin/master) git config core.sparsecheckout # timeout=10 git checkout -f Commit message: "Added additional required libraries" git rev-list --no-walk # timeout=10 Getting source url. The following files are compressed ****



/Dockerfile. Upload local directory to Azure Storage Blob Build image with source code from . Queue a task to ACR /** - {"sourceType":"local","gitRepo":"","gitRefspec":"","gitPath":"","localDir":".","tarball":"","imageNames":["/java-builder-with-octopus-deps:latest"],"buildArguments":[],"noCache":false,"timeout":300,"platform":{"os":"Linux","architecture":"AMD64","variant":""},"dockerFilePath":"Dockerfile","canceled":false,"sourceUrl":""} Finished queue an ACR Quick Task: cdg Get log link: 2019/05/01 23:10:27 Downloading source code... 2019/05/01 23:10:28 Finished downloading source code 2019/05/01 23:10:29 Using as the home volume 2019/05/01 23:10:29 Setting up Docker configuration... 2019/05/01 23:10:30 Successfully set up Docker configuration 2019/05/01 23:10:30 Logging in to registry: failed to login, ran out of retries: failed to set docker credentials: Error response from daemon: login attempt to https:///v2/ failed with status: 403 Forbidden : exit status 1 Run ID: cdg failed after 10s. Error: failed during run, err: exit status 1 ERROR: ACR Quick Task ended with HasError Finished: FAILURE`

I am able to do az acr login from both my workstation, and ssh'd into the jenkins vm. I'm able to do docker pull/push in this manner. However, when I try to get jenkins to use this build step, it always fails with this error. I've tried creating a completely new service principle, and that has not worked as well.

What more do I need to do to make sure that I'm able to push docker images into my acr using this plugin?

joshua-alday commented 5 years ago

Okay, it seems this was a problem with firewall and network preview. I'm able to now publish my builds.

taddaTD commented 5 years ago

@joshua-alday how were you able to determine the issue was with firewall and virtual network settings on the ACR?