I have some problems with git at Bamboo elastic-agents. Cloning repo is ok, but when it push changes to server build falls with error:
An error 'ssh://git#our_server_url:7999: org.eclipse.jgit.transport.CredentialItem$YesNoType:The authenticity of host 'our_server_url' can't be established.RSA key fingerprint is 04:a0:ab:f6:39:92:1f:21:9d:0c:f4:3e:f2:5e:99:4e.Are you sure you want to continue connecting?' occurred while pushing branch: branch_name to url: ssh://git#our_server_url:7999/repo_name.git
This problem occurs at elastic-agents only. All keys are equal in AWS and remote agents.
Related
Soo, I am try to periodically run a pull request using a jenkins server. I set the Jenkins Job to execute the same steps I do by hand.
Gestartet durch Benutzer unknown or anonymous
Baue auf dem Agenten „int-test-a-3“ (windows) in Arbeitsbereich C:\Jenkins\workspace\int-test-
a-3\int-test-a-3-git-sync [int-test-a-3-git-sync] $ cmd /c call
C:\Users\Secret\AppData\Local\Temp\jenkins7612063198399964523.bat
C:\Jenkins\workspace\int-test-a-3\int-test-a-3-git-sync>cd C:\Users\Secret\AppData\Roaming\SerialScriptingTool
C:\Users\Secret\AppData\Roaming\SerialScriptingTool>git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
C:\Users\Secret\AppData\Roaming\SerialScriptingTool>git remote -v
origin \\INT-TEST-A-0\SST_Repository_Origin (fetch)
origin \\INT-TEST-A-0\SST_Repository_Origin (push)
C:\Users\Secret\AppData\Roaming\SerialScriptingTool>git fetch
fatal: '\\INT-TEST-A-0\SST_Repository_Origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
C:\Users\Secret\AppData\Roaming\SerialScriptingTool>git pull
fatal: '\\INT-TEST-A-0\SST_Repository_Origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
C:\Users\Secret\AppData\Roaming\SerialScriptingTool>exit 1
Build step 'Windows Batch-Datei ausführen' marked build as failure
Finished: FAILURE
The weird part is, if I am on the same machine and running the same commands by hand they work and the fetch and pull commands work correctly. When I check with a whoami command which user Jenkins runs the cmd as it is also the same and only user of the PC. I mean the remotes are still the same in the config and the repo exists and is reachable over the network.
I'm trying to do the following with Bitbucket Pipelines when i push to my test brand:
- git fetch
- git checkout master
- git pull origin test
- git push origin master
But i get the following message on git fetch: Permission denied (publickey). I was following this tutorial https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html so i already added an ssh key, but cannot understand what are the next steps that i need for the execution to have permissions to connect to the repository.
If “from same repository” really means that you want to access the repository in which the pipeline runs, the answer is: you don’t need that. When the pipeline runs, it starts the Docker image you defined in your YAML configuration and automatically checks out the commit you pushed. This means that at the moment when when your command (git fetch) is executed, the sources are already waiting for you in path /project.
BitBucket Pipelines automatically checks out the repository upon running. However, if you want to make changes to the repository (e.g. git tag or git push) you will need to add the SSH keys according to the post you have already found (https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html). That works for our environment.
Can you post the full bitbucket-pipelines.yml file?
I am trying to add repository via Xcode > Settings > Accounts and I am stuck on the proper address. Address of our repo is quite simple: my.domain.com:port/project-name. Authentication via SSH Keys. Could someone help me to understand what's going on here? See screenshot below.
By the way running git clone git+ssh://git#my.domain.com:port/project-name works fine.
EDIT
Running git clone without git+ssh//
git clone git#my.domain.cz:2222/project-name
or
git clone git#my.domain.cz:22/project-name
is giving me same error:
ssh: connect to host my.domain.cz port 22: Connection refused
fatal: Could not read from remote repository
Please make sure you have the correct access rights and the repository exists.
Xcode accepts just ssh://git#my.domain.cz:2222/project-name.
The git protocol is somehow redundant in this case. Raw git tools don't have a problem with it, but Xcode does not like it for some reason.
It always fails for me when I use existing ssh keys.
I created a new ssh key pair through Xcode and uploaded the public key to the git server (in my case, Phabricator), and it works.
I set up a Debian server that uses SSH for shell access and git repos. I created a bare repo on it and using ssh was able to clone it to my Windows 8 workstation, however when trying to push changes back to the Debian server I get the error depicted here:
Read from remote host 174.52.5.192: Connection reset by peer
fatal: sha1 file '<stdout>' write error: invalid argument
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'git#174.52.5.192:/home/git/repos/space-junk.git/'
I use this work station regularly for shell access to the same server via SSH so I know inability to access SSH isn't the problem.
Does anyone have any idea what's going wrong?
Actually, the first push should be:
git push -u origin master
That will link the local branch master to its remote tracking one origin/master
Then, after that first push, you will be able (for all the subsequent push) to do a simple:
git push
See more at "Why do I need to explicitly push a new branch?".
I got it working! It turns out the proper command was
git push origin master
The Windows version didn't have a descriptive enough error message but I got it working by switching over to Linux, which told me my command was wrong.
I have successfully deployed Integrity on Heroku. I have been able to build script for public repo on git and the build runs successfully.
But running integrity for private repo gives me error as
error: The requested URL returned error: 401\nerror: The requested URL returned error: 401\nerror: The requested URL returned error: 401\n"
"error: pathspec 'origin/master' did not match any file(s) known to git.\n"
I am using the https version for cloning since heroku does not ssh cloning.
I think that for cloning private repo we need to provide password, so is there any way in Integrity to provide a password?
Or is there any other way for the same.
Firstly, you need to uncheck the "Public project" checkbox in Integrity project setting.
Secondly, you need to pass the password on the https url.
And that should work as it works for me :)