-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
git stdout: GitLab: The project you were looking for could not be found #2037
Comments
Thanks for the detailed report! Capistrano should automatically update the remote git URL if it changes. This feature was added in #1826 . Do you have any idea why |
Let me give you a bit more details about my case. The code was pushed to GitLab but capistrano config was still referencing the old repo (this a takeover project). The code was deployed. Then, I changed the repo url because I realized that my predecessors forgot to update capistrano repo url which should be pointing to the GitLab repo, not their own gitlab instance. I updated the repo url in capistrano and tried to deploy but it errored out. I looked at repo folder on the remote host and the repo url was from before my update. I do not have the logs anymore, sorry. This interesting, because, as you mentioned, the change has been already implemented but something is still not working. The case described here #1826 is the same as mine so ...very interesting... |
I just tested this and it seems that capistrano is doing the right thing. I did a I did see this warning in the git output after changing the URL:
But otherwise it seemed to work fine. Perhaps in your case it had something to do with cached credentials? Was the previous URL an https one? I'll leave this ticket open in case other people run into a similar problem and have additional information to report. |
No, definitely nothing related to cached credentials or https. Thanks for checking! |
Hey, |
Full disclosure here: I am officially stumped on this one. Sorry I can't be of help! I am particularly confused as to why deleting scripts in capistrano/lib/capistrano/scm/tasks/git.rake Lines 8 to 10 in f8f081f
Furthermore, the capistrano/lib/capistrano/scm/git.rb Line 38 in f8f081f
I do not understand how deleting Perhaps someone with more expertise in git or GitLab specifically can help me here? |
For me, it doesn't seem to have anything to do with the remote. On my Mac machine, I can deploy without problems. But on my Linux (Ubuntu) machine, I am all of a sudden getting this error. I did recently install ClamAV, so I thought maybe that was interfering. But turning it completely off, I still get this error. ¯_(ツ)_/¯ |
Just did, and now I am able to deploy from my Linux machine. There must have been a bad git ssh cache somehow on my machine. |
Hmm, in that case this could be related to the private key you are using on your local machine for SSH. If that key is not associated with the correct GitLab account, I can see how that might give you a "The project you were looking for could not be found". Maybe? |
Definitely plausible @mattbrictson I was thinking the same, since if you have multiple keys loaded into your agent (whether you know it or not, check with FWIW they'll also only try a few keys, I think up to 3..5 before giving up. Working as a contractor I have to be super careful which keys are in my agent else I can run into this kind of thing (not necessarily just with Capsitrano) |
My ssh key was loaded. I was able to run the |
I just replicated this. Capistrano 3.6.1 I had 2 ssh keys loaded, neither were the correct key for the server I was attempting to deploy to. Received: #<Thread:0x0000562c62bdca10@/home/<username>/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/sshkit-1.17.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
1: from /home/<username>/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/sshkit-1.17.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/<username>/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/sshkit-1.17.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as ubuntu@<dns>.compute.amazonaws.com: git exit status: 128 (SSHKit::Runner::ExecuteError)
git stdout: Nothing written
git stderr: remote:
remote: ========================================================================
remote:
remote: The project you were looking for could not be found.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
(Backtrace restricted to imported tasks)
cap aborted! After ssh-add the correct key to login to the machine, I still get this error. Which is odd since it isn't the key that is needed to authenticate with gitlab. That key was loaded(albeit it was loaded manually after cancelling the passphrase prompt, and then manually running ssh-add, earlier in the day when trying to If I reboot my machine (I'm sure there is a service I could restart too), ssh-add both my gitlab key, and my server key, I can then cap deploy just fine. And maybe this is actually a problem with git and it is just manifesting here while using cap. I don't really know. |
Thanks for commenting back @bfcoder This is indeed a problem with Git. You can modify the git+ssh wrapper script that Capistrano exports to expose the following env vars Git is written as a series of tiny tools that get piped together, so on the simplest level there's going to be a call to I'm recounting this a lot from memory, so your results may vary, a bit. What may be happening is that with the "wrong" keys loaded into the agent is that Git is using up some of it's retries using the wrong keys, and proceeding on with no "retries" left on the counter, so a single failure (even if you should be allowed to try You might also experiment with Regarding clearing/rebooting, an When using Capistrano on the server-side, we write out a git wrapper script (which is used in place of |
Important: GitHub issues are for feature requests or bug reports. The Capistrano team recommends you use Stack Overflow for general questions. For more details, please see our contribution policy.
Steps to reproduce
Deploy an application to a remote host, change app repo url in Git, update repo url in Capistrano config, try to deploy the app. It won't deploy. You'll get an error (see below). To resovle the problem you need to
ssh
onto the remote host and removerepo
folder, then re-deploy. It looks like Capistrano relies on repo url fromrepo
folder. I am posting this thread as a suggestion for improvement, because I think that it would be nice if we didn't have to removerepo
folder manually, secondly, I struggled to figured it out for an hour or two so we could save other people's lives trying to solve similar problem.Expected behavior
App should deploy
Actual behavior
System configuration
Please link to the output of
cap <stage> doctor
in a GitHub Gist.https://gist.github.com/jedrekdomanski/64e7ee0f4bb57c9631cbdbb60e3ca792
Thanks for helping improve Capistrano!
The text was updated successfully, but these errors were encountered: