devspace deploy gives git error when same git command runs fine outside devspace
What happened?
A user running devspace deploy got several different types of git errors, se below. The problems was experienced multiple times over 2hour duration. After restarting his machine everything worked. Normally i wouldn't bother you with this, but what rustled my feathers a bit was that when he ran the same git commands (on the devspace cached dependencies) they ran fine.
It brings me to think that devspace runs the git command in a context (process, user, ???) that i dont understand. Could you consider this case, and give some insight?
Errors:
PS C:\repos\InnbyggerAdmin> devspace deploy
info Using namespace 'dev'
info Using kube context 'kind-hn-cluster'
warn Error cloning repo: Error running 'git pull https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett': error executing 'git -C C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--dd8d054 pull': -> fatal: unable to access 'https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Oppsett/': Failed to connect to dev.azure.com port 443 after 0 ms: Couldn't connect to server
info Switching URL from https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett to git@[email protected]:nhnfelles/Helsenorge/_git/HN-Oppsett and will try cloning again
PS C:\repos\InnbyggerAdmin> devspace deploy
info Using namespace 'dev'
info Using kube context 'kind-hn-cluster'
warn Error cloning repo: Error running 'git clone https://[email protected]/nhnfelles/Helsenorge/_git/HN-Personvern C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--04e5511 --branch master --depth 1': error executing 'git clone https://[email protected]/nhnfelles/Helsenorge/_git/HN-Personvern C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--04e5511 --branch master --depth 1': -> Cloning into 'C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--04e5511'...
fatal: unable to access 'https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Personvern/': Failed to connect to dev.azure.com port 443 after 8 ms: Couldn't connect to server
info Switching URL from https://[email protected]/nhnfelles/Helsenorge/_git/HN-Personvern to git@[email protected]:nhnfelles/Helsenorge/_git/HN-Personvern and will try cloning again
warn Failed to clone repo with both HTTPS and SSH URL. Please make sure if your git login or ssh setup is correct.
fatal deploy dependencies: resolve dependencies: clone repository: Error running 'git clone git@[email protected]:nhnfelles/Helsenorge/_git/HN-Personvern C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--04e5511 --branch master --depth 1': error executing 'git clone git@[email protected]:nhnfelles/Helsenorge/_git/HN-Personvern C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--04e5511 --branch master --depth 1': -> Cloning into 'C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--04e5511'...
ssh: connect to host dev.azure.com port 22: Network is unreachable
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Worked fine:
C:\Users\marting\.devspace\dependencies
git pull https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett
C:\Users\marting\.devspace\dependencies
git -C C:\Users\marting\.devspace\dependencies\https-nhnfelles-dev-azure-com-nhnfelles-helsenorge-git--dd8d054 pull
What did you expect to happen instead?
devspace deploy git run and native git command run gives same errors.
How can we reproduce the bug? (as minimally and precisely as possible)
No idea
Local Environment:
- DevSpace Version: 6.3.2 (and one version earlier, unknown)
- Operating System: windows
- ARCH of the OS: unknown, the common one
@Andrioden thanks for creating this issue! Sorry for the delay, is there any reason you add the username there or does the following work as well:
git pull https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Oppsett
@FabianKramm - When we experienced the problem, we copied the failing git commands from the output of devspace, then ran those same commands in our own windows powershell terminal, which then worked.
We got the git commands with username from devspace's output = p
is there any reason you add the username there or does the following work as well:
git pull https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Oppsett
I cant really add anything or test anything outside of what i supplied above in the "Errors" and "Workeded fine" sections. This command is not what the error from devspace output, and not what we tested.
Take note: This hasn't happened since, so it is a rare occurrence, so its not high priority from our perspective. It is more that I am curious what kind of git wrapper/bindings/??? your using that can fail inside devspace, while not outside. If you want to close this issue as "we dont know", that is ok.
If you are wondering why we are not using the format https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Oppsett in our dependencies, then my answer is dunno, we could if we wanted to. But the url below is what azure devops give us when we click the clone button.
Here is an example
dependencies:
hn-oppsett:
git: https://[email protected]/nhnfelles/Helsenorge/_git/HN-Oppsett
branch: master