github icon indicating copy to clipboard operation
github copied to clipboard

getting access denied in atom but git works fine in terminal

Open scottsp64 opened this issue 6 years ago • 18 comments

Description

So I am using ATOM against a private `BitBucket git repo and have been for weeks without issue. I left on vacation for a week and since I got back I cannot access the repo through atom at all and am getting a Permission Denied Denied message.

Here are the details:

  1. I am using SSH.
  2. OS is Mac High Sierra
  3. From terminal, all the git commands work fine (status, fetch, add, push, pull)
  4. I have added the keys to the ssh-agent
  5. I have set the .ssh config file to use the mac keychain
  6. I have added the public key to my account in the repo
  7. I am using Atom v 1.29.0
  8. I am using github package v 0.17.3
  9. I have deleted, re-generated and reapplied the SSH keys multiple times (no cigar)
  10. I have removed and recloned the repo (no cigar)
  11. here is the output from git remote -v (edited of course to anonymise) git remote -v origin ssh://[email protected]:7999/repoblah/repoblah.git (fetch) origin ssh://[email protected]:7999/repoblah/repoblah.git (push)
  12. Every attempt to use the github package in atom results in an access denied message
  13. Everything was working fine before my vacation.

screen shot 2018-08-14 at 10 42 38 am

Steps to Reproduce

  1. test git by using a command from the terminal (for example git pull) - WORKS FINE
  2. test git in atom by using the git pull command in the github package - Permission denied error

Expected behavior:

I expect for the git commands in Atom to work

Actual behavior:

I am getting a permission denied message (see attached image)

Reproduces how often: 100%

Versions

atom --version Atom : 1.29.0 Electron: 2.0.5 Chrome : 61.0.3163.100 Node : 8.9.3 apm --version apm 1.19.0 npm 3.10.10 node 6.9.5 x64 atom 1.29.0 python 2.7.10 git 2.15.2

Additional Information

This is for a private bitbucket repo

scottsp64 avatar Aug 14 '18 15:08 scottsp64

Thanks for the report! Just to clarify, I'm assuming that in your step 10, you're cloning from the command line and you can't clone with the GitHub package either?

Also, do you have any problem with any private or public repository or just that one?

You mentioned:

I left on vacation for a week and since I got back I cannot access the repo through atom at all and am getting a Permission Denied Denied message.

Do you recall if you updated to 1.29 after coming back from vacation? Curious if you install 1.28 if you still get this error?

Lastly, I believe there were a number of changes to the GitHub package in the 1.30 beta - I don't know if anything is specifically related to the issue you're seeing here but can you also confirm if you see the issue in the beta?

rsese avatar Aug 14 '18 23:08 rsese

Thanks for the reply,

Yes I cloned from the cli. I had not tried using a different repo, so I added the same public key to github and cloned the flight-manual.atom.io repo from the cli. On that repo I did a git status from the cli, verifying my public key configuration. I added the project to atom and,,,, BANG - same error Permission denied (publickey). So the issue is not my repo. hmm.

I removed atom 1.29 and reinstalled atom 1.28. That did not fix the issue. Neither did installing 1.30 beta.

This is really weird.

S

scottsp64 avatar Aug 15 '18 14:08 scottsp64

Same issue here. Did you solve it?

egenomics avatar Dec 11 '18 14:12 egenomics

Same here. My repo is a private github repo if that helps.

basandlin avatar Dec 13 '18 19:12 basandlin

Any update on this? Having the same issue on Fedora 29

crimv42 avatar Jan 18 '19 05:01 crimv42

@egenomics @basandlin @crimv42 - are you all using SSH and seeing the exact same error?

No particular updates since the error's not generally reproducible so far.

rsese avatar Jan 18 '19 20:01 rsese

@rsese My error has more than @scottsp64 posted:

Unable to fetch
linux-ssh: Linux ssh wrapper invoked with arguments: [[email protected]
linux-ssh: using SSH command [ssh]
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

is my full error. I use my GPG key for my SSH key with the gpg-agent replacing the ssh-agent, not sure about the others.

I can use my GPG signing key to sign commits no problem in Atom, but when trying to fetch or push, I get the error above.

crimv42 avatar Jan 18 '19 22:01 crimv42

The same problem. Ubuntu 18.04, git 2.17.1, Atom 1.20.2. I use SSH keys and I have a private repo on GitHub. When I use the terminal, everything works fine.

linux-ssh: Linux ssh wrapper invoked with arguments: [[email protected]
linux-ssh: using SSH command [ssh]
/run/user/1000/snap.snappyatom/github-119123-12969-zo6v4m.moytdtpgb9/linux-ssh-wrapper.sh: 26: /run/user/1000/snap.snappyatom/github-119123-12969-zo6v4m.moytdtpgb9/linux-ssh-wrapper.sh: setsid: Permission denied
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Agata-R avatar Feb 23 '19 10:02 Agata-R

OK I have found an update to this issue. It has to be something with my environment variables. When I start Atom from terminal, I can push, pull, merge, everything. When I start from the GUI, I get the error that permission is denied. This has to be with me changing the default SSH socket in my ~/.bashrc:

# Default SSH Socket to GPG
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
export SSH_AUTH_SOCK

We need to be able to update the SSH socket in Atom easily.

Edit: I found a temporary fix by adding the following to /etc/profile

# Default SSH Socket to GPG
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
export SSH_AUTH_SOCK

crimv42 avatar Feb 26 '19 18:02 crimv42

Ohh it sounds like you're running into this issue @crimv42?

https://github.com/atom/atom/issues/18318

rsese avatar Feb 27 '19 22:02 rsese

@Agata-R - it looks like you're using a Snap installation of Atom? The Snap installation is unofficial and not supported by us and it also looks like the version you're running is not up to date (the current stable release version is 1.34.0). Not sure if that's related to the problem you're having but I would recommend using an official installation of Atom: https://flight-manual.atom.io/getting-started/sections/installing-atom/.

rsese avatar Feb 27 '19 22:02 rsese

Ohh it sounds like you're running into this issue @crimv42?

atom/atom#18318

It would appear so! It just came under the guise of an SSH issue. I think the propsed fix here should be merged in a future release.

crimv42 avatar Feb 27 '19 22:02 crimv42

@Agata-R - it looks like you're using a Snap installation of Atom? The Snap installation is unofficial and not supported by us and it also looks like the version you're running is not up to date (the current stable release version is 1.34.0). Not sure if that's related to the problem you're having but I would recommend using an official installation of Atom: https://flight-manual.atom.io/getting-started/sections/installing-atom/.

Yay! That was it, now everything works fine. Thank you for help.

Agata-R avatar Mar 06 '19 15:03 Agata-R

I have this issue too. I am using verison 1.53.0.

msoutopico avatar Nov 25 '20 21:11 msoutopico

Same here. Which workaround for ssh-agent?

For a private repo at org, I have:

Unable to fetch

linux-ssh: Linux ssh wrapper invoked with arguments: [-o
linux-ssh: using SSH command [ssh]
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

The script I use to launch Atom is:

export ATOM_DEV_RESOURCE_PATH=/home/user/git/atom
eval `ssh-agent`
ssh-add /home/user/.ssh/privkey
echo starting Atom
nohup atom &
echo exiting with exitcode 0
exit 0

I have the same problem on Ubuntu 20.04.4. it works in the console with the git command but not inside atom. I tested it also on Windows 10 and there it works.

Error message:

linux-ssh: Linux ssh wrapper invoked with arguments: [-o
linux-ssh: using SSH command [ssh]
Connection closed by <my-ip> port <my-port>
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Alex-Engineering avatar Aug 12 '22 09:08 Alex-Engineering