-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Argocd rejects app creation with "Unable to resolve to a commit SHA" even though branch exists #7282
Comments
Issue is fixed by #7244 . Fix is cherry-picked into 2.1 and will be released shortly as a patch release. Thank you for reporting it! |
It looks like we still have the same issue on Version
Logs
|
@alexmt Unfortunately, it looks that issue is not fixed. I am happy to provide any details to help you to fix it completely :) |
Thanks you for update. Reopening. @mdreizin can you please check repo-server logs? Is error coming from |
Nevermind. How could I missed it 🤦 . API server makes two API calls to repo server and should not use cache revision in both: #7508 |
@alexmt I am sorry that I could not share the logs, because I was away from computer. That is amazing that you figured out what was wrong and have already fixed the issue. Is it possible to release a new version with this fix? |
@alexmt seems to be the problem is still there (
also it looks like the problem appears less often then before 1 of 10 applies |
I’m facing the same issue.
|
@alexmt could you please re-open it? :) |
It seems issue is in The |
I just had the problem myself. You know it would not be hard to generate a browser URL that could be clicked on or cut & paste into a browser to show the person that the target directory is empty. I would suggest doing that to help your users it could save a lot of time. Usually the config is pointed to a compiled directory of yamls on a release branch and sometimes the yamls for that particular instance are just not compiled, and it's not obvious. In my case I compiled it on a local branch in the shell but couldn't see the 2-lines in "git status" indicating they were yet to pushed to github because I had 25 other locally edited files in my branch. Giving the user a github link to clink (on the right branch, in the right path) would demonstrate why it failed, and would help your users, please, and it's probably a 5-mins change ... |
Sure could be done for a couple of known providers (github.com, gitlab.com, maybe bitbucket.com). Then there are some other environments (GitHub enterprise, self hosted GitLab, Gitea, pure Git repos accessed via SSH, the list goes on).
If it's a 5-mins change, you're welcome to contribute it :) As an alternative, feel free to file an enhancement request. |
Ok I'm also having this issue now running v 2.6.7 trying to create an app to connect to github. Is there a fix or a workaround I might be missing? I see people asking for reopening this |
It works - its just that the user interface is terribly bad and it waste's everybody lives. Here is a correctly configured github project page - when setting up the prject. You can put together the 3 fields plus the text "/tree/" to create a github url. Then paste it into your browser to make certain it is correct. You will get an error because your resulting URL is not correct. In that case, visit the correct page in your browser (starting from the top of your repo + your selected branch), and determine the correct 3 fields you need. See the before/after config picture below (url is correct for our project). During SetupAfter Successful Setup |
Checklist:
argocd version
.Describe the bug
We are creating apps dynamically using the api and just updated from v1.8.4+28aea3d to v2.1.2+7af9dfb.
When a pull request is opened for a argocd managed repo a jenkins pipeline will do some validity tests of the PR and will then try to deploy the App of the PR to create commit status checks if the app gets healthy and stuff.
For that we dynamically create an app yaml and insert the PR branch as the source branch of the app.
Somewhere in between v1.8.4 and v2.1.0 argocd added or changed the way it is validity checking on apps before they get created but I failed to find the exact cause.
It takes at least 80 seconds after pushing a branch to GitHub until argocd will allow app creation.
Sometimes even longer, but around 2 minutes in general.
I failed to find what is exactly missing on the GitHub side that prevents argocd for so long to allow app creation.
Jenkins itself is already happily checking out the branch locally after pulling from GitHub, showing the commit sha's and is doing tests on the kustomize manifest.
The error is thrown by lsRemote as I always just the branch name e.g test9:
But I don't get why that takes 2 minutes after push.
Doing something like this instantly shows the branch and it's corresponding commit sha on the remote site:
I added server and repoServer logs below.
What I am now missing is why that is actually checked? In prior versions ( and still if you directly create an app via CRD ) an app gets created that then runs into "Unkown" status, because it cannot find the branch in question. Which is a totally fine process imo. Plus, there is no way to deactivate that check via cli with
--validate false
for example.Is anyone aware what argocd is missing to be able to create the app faster and can we speed up that process?
Anyways, big thanks for all your work on the argo projects!
To Reproduce
Try to create a new app with a source branch that was just created using the branch name ( only tested on GitHub private repos ).
I need to wait around 2 minutes until I am able to post the app.
I used this loop to test around:
test9 is a branch ( not default branch of the repo ) that includes a tiny kustomize manifest and nothing else.
App looks like so:
The branch gets pushed and argocd cli failes around 50ish times until it eventually succeeds.
After testing around a bit, I found that if I set the targetRevision to e.g refs/heads/test9 it absolutely instantly works and finds the sha. Which is great and fixes my usecase as I can just prepend the branch with refs/heads/, but I wonder why it takes to long to find just test9?
Expected behavior
I expect to create argocd apps either directly putting the new app into "unkown" status or to be able to create an app once the branch is pullable using git cli.
Or using the branch name should be as fast as using refs/heads/branch as the targetRevision.
Version
Logs
The text was updated successfully, but these errors were encountered: