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

az acr task error when pulling data from github #20761

Closed
3rdmillkev opened this issue Dec 16, 2021 · 5 comments
Closed

az acr task error when pulling data from github #20761

3rdmillkev opened this issue Dec 16, 2021 · 5 comments
Labels
Container Registry az acr customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@3rdmillkev
Copy link

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug
I used the command below to create 2 acr tasks based on "push to source code" trigger:

az acr task create `
    --registry myregistry `
    --name build-main`
    --image myimage-main:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#main `
    --file Dockerfile `
    --git-access-token myonlytoken

az acr task create `
    --registry myregistry `
    --name build-dev`
    --image myimage-dev:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#dev `
    --file Dockerfile `
    --git-access-token myonlytoken

Using the command above, I created 2 tasks on the same github private repository with same PAT token.
The problem is, when running the " build-dev" task, it runs without no issues and image is built as expected but when running "build-main" task, it fails with this error:

2021/12/15 21:43:23 Downloading source code...  
Run ID: cs1a failed after 5s. Error: failed to download context. Please check if the URL is incorrect. If it has credentials, please check if they are expired

my token has the below permissions:

  • repo
  • repo:status
  • repo_deployment
  • public_repo
  • repo:invite
  • security_events
  • workflow
  • admin:repo_hook
  • write:repo_hook
  • read:repo_hook
  • admin:org_hook

Also please note that there is no difference in source code in both #dev and #main branch.
I came to believe that there is a bug in the agent that it cannot download data from source code.
To Reproduce
since we are using private repo, I am not sure how to provide steps to reproduce. support can advise.

Expected behavior
The run should be successful on both "build-main" and "build-dev" task as they are in same repo, using same PAT and even source code is the same in both branches.

Environment summary

az acr task create `
    --registry myregistry `
    --name build-main`
    --image myimage-main:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#main `
    --file Dockerfile `
    --git-access-token myonlytoken

az acr task create `
    --registry myregistry `
    --name build-dev`
    --image myimage-dev:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#dev `
    --file Dockerfile `
    --git-access-token myonlytoken
  • Pulling data from same repository
  • Using same token for both tasks

Additional context

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Dec 16, 2021
@zhoxing-ms zhoxing-ms added the Service Attention This issue is responsible by Azure service team. label Dec 17, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 17, 2021
@zhoxing-ms zhoxing-ms added Container Registry az acr needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Dec 17, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 17, 2021
@ghost
Copy link

ghost commented Dec 17, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @toddysm, @luisdlp, @northtyphoon.

Issue Details

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug
I used the command below to create 2 acr tasks based on "push to source code" trigger:

az acr task create `
    --registry myregistry `
    --name build-main`
    --image myimage-main:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#main `
    --file Dockerfile `
    --git-access-token myonlytoken

az acr task create `
    --registry myregistry `
    --name build-dev`
    --image myimage-dev:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#dev `
    --file Dockerfile `
    --git-access-token myonlytoken

Using the command above, I created 2 tasks on the same github private repository with same PAT token.
The problem is, when running the " build-dev" task, it runs without no issues and image is built as expected but when running "build-main" task, it fails with this error:

2021/12/15 21:43:23 Downloading source code...  
Run ID: cs1a failed after 5s. Error: failed to download context. Please check if the URL is incorrect. If it has credentials, please check if they are expired

my token has the below permissions:

  • repo
  • repo:status
  • repo_deployment
  • public_repo
  • repo:invite
  • security_events
  • workflow
  • admin:repo_hook
  • write:repo_hook
  • read:repo_hook
  • admin:org_hook

Also please note that there is no difference in source code in both #dev and #main branch.
I came to believe that there is a bug in the agent that it cannot download data from source code.
To Reproduce
since we are using private repo, I am not sure how to provide steps to reproduce. support can advise.

Expected behavior
The run should be successful on both "build-main" and "build-dev" task as they are in same repo, using same PAT and even source code is the same in both branches.

Environment summary

az acr task create `
    --registry myregistry `
    --name build-main`
    --image myimage-main:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#main `
    --file Dockerfile `
    --git-access-token myonlytoken

az acr task create `
    --registry myregistry `
    --name build-dev`
    --image myimage-dev:{{.Run.ID}} `
    --context https://github.com/$GIT_USER/acr-build-helloworld-node.git#dev `
    --file Dockerfile `
    --git-access-token myonlytoken
  • Pulling data from same repository
  • Using same token for both tasks

Additional context

Author: 3rdmillkev
Assignees: -
Labels:

Service Attention, Container Registry, question, customer-reported, needs-triage

Milestone: -

@jiasli
Copy link
Member

jiasli commented Dec 17, 2021

Routing to service team.

@AntonioVT
Copy link
Member

@3rdmillkev Could you try using the latest CLI? Current version is 2.31.0, but the one mentioned is 2.0.62.

@rosanch
Copy link
Contributor

rosanch commented Dec 20, 2021

@3rdmillkev There used to be a bug in older CLI versions regarding the branching. So upgrading the CLI might fix the problem for you

@3rdmillkev
Copy link
Author

@AntonioVT @rosanch After updating the cli and recreating the build task, it was successful.
Thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Container Registry az acr customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants