lewisnewson
lewisnewson

Reputation: 460

GitKraken Push Error: SSH could not write data

I am getting an error (shown below) when trying to push changes in GitKraken.

enter image description here
It is a forked project and I have been able to push perfectly fine in the past. What has changed since last time is that I have pulled in and merged an update from a remote branch (the original repo).

Has anyone encountered this before? Any idea whats stopping the push?

Thanks

Upvotes: 5

Views: 6497

Answers (6)

Owen Wardlaw
Owen Wardlaw

Reputation: 1

Not an elegant solution, but I added new SSH keys and was still facing the same issue. I was able to get around this by cloning the repo again, manually adding the changed files and pushing fine.

Upvotes: 0

Hunter
Hunter

Reputation: 1

The answers from @Sam and @Jasper36 will work for GitKraken but will open up a new issue when you try again to pull from cli.

  1. To allow GitKraken to access git, open my-project/.git/config and modify your origin url to url = ssh://[email protected]/v1/wibble/
  2. To allow your terminal to again access git, run the command: ssh-add ~/.ssh/{my-wibble-key_rsa}

This example is for AWS codecommit integration but the same principals will work for ssh connection to all forms of ssh clients.

Upvotes: 0

Japser36
Japser36

Reputation: 224

Don't have enough rep to comment on @Sam's post, but if you have this issue with SSH and AWS codecommit using GitKraken, or any SSH could not read/write data: sort of error, you can enforce GitKraken to use your AWS username.

First make sure gitkraken is closed, just incase!

Find the repo's git file in: repo-root/.git/config. Open it in your favourite text editor, notepad works just fine!

Under the section that describes [remote "origin"] you should see a url = .... Make sure that reads: url = ssh://[email protected]/v1/repos/YOUR_REPO_NAME.

A simple way to make sure the URL is correct is to go into codecommit, view your repos, then click the "SSH" link next to your desired repo. it should copy the SSH URL for that repo to your clipboard. Then, just add your "YOUR_AWS_KEY@" after the ssh:// and before git-codecommit.

KEY NOTES: Make sure that the URL starts with ssh://, followed by your ssh key id and then an @, and then make sure that the URL does NOT end in '.git' or gitkraken throws an 'invalid repository URL' error!

Here, "YOUR_AWS_KEY" is the 'SSH Key ID' found in your AWS IAM when viewing your security credentials. make sure its the one for your current computer's SSH key!

Upvotes: 6

Sam
Sam

Reputation: 171

I had this issue when using SSH with AWS codecommit and GitKraken, I had to add the username (aws ssh key id in IAM) to the SSH URL like this:

ssh://[email protected]/v1/wibble/

Cloning was fine as it prompts for the username but when trying to pull or push it didnt prompt and failed with the could not read/write error

Upvotes: 0

Xan Nava
Xan Nava

Reputation: 79

So in case that answer wasn't helpful to others like me, I figured it out.

  1. Make a new ssh key.
  2. Install PuTTY tools from https://www.ssh.com/ssh/putty/download
  3. Run PuTTYgen.
  4. under the "Conversions" tab select import key, and select your private ssh key.
  5. Save private key.
  6. in your tool bar(near the clock) double click Pageant.
  7. Add the private key we just made.
  8. in gitkraken under "preferences/Authentication/Bitbucket.org" connect to bit bucket, and then press the two blue buttons, which adds your private/public ssh keys(not the one we made with PuTTY, that is a putty key).
  9. add the public key to your bitbucket account.

And you should be all good to go!

Upvotes: 1

lewisnewson
lewisnewson

Reputation: 460

It seemed that pushing the changes from another machine appeared to 'flush' through the commits. The different machine managed to push the changes okay and after doing so, the original machine can also push again.

Hope this workaround can help someone out in the future.

Upvotes: 2

Related Questions