atom / github

:octocat: Git and GitHub integration for Atom
https://github.atom.io
MIT License
1.12k stars 393 forks source link

Save file broken on git projects with remote #2166

Open TomekTrzeciak opened 5 years ago

TomekTrzeciak commented 5 years ago

Prerequisites

Description

Save file functionality doesn't appear to work any more after the first edit+save when the git repository has any remote set. Strangely enough, editing files in git projects without any remotes does work.

Steps to Reproduce

  1. Open a git project with a any remote set (like origin or upstream)
  2. Edit any file and save it
  3. Edit again, the save option doesn't work anymore

Expected behavior:

File save option to work every time.

Actual behavior:

File save option works only the first time.

Reproduces how often:

Reproducible every time.

Versions

$ atom --version
Atom    : 1.37.0
Electron: 2.0.18
Chrome  : 61.0.3163.100
Node    : 8.9.3
--
github  : 0.28.1

$ apm --version
apm  2.1.7
npm  6.2.0
node 8.9.3 x64
atom 1.37.0
python 2.7.5
git 2.16.5

$ cat /etc/redhat-release 
Red Hat Enterprise Linux Client release 7.6 (Maipo)

Additional Information

None

rsese commented 5 years ago

Thanks for the report! I was unable to reproduce on Ubuntu 18.04 with 1.37.0. A few questions:

TomekTrzeciak commented 5 years ago
  • How did you install Atom?

My admin tells me that it's yum installed rpm package from github.

Yes. I even rm -rf ~/.atom ~/.config/Atom beforehand to wipe out all editor state for a good measure.

Nothing relevant, only one error about time out of some resource retrieval.

  • Have you reproduced with multiple projects?

Yes. In one of the tests I copied a small git repo to /tmp, opened it in atom, editing works until I add a remote. As soon as I do that (with or without closing the editor), I can't save the files anymore.

  • Is this behavior new for you as of 1.37.0?

Can't really tell, as I can't test on the previous release, but this wasn't a problem on 1.26 if that helps.

rsese commented 5 years ago

Hmm, not sure what the issue or if it's a general problem or something specific to your system - some questions:

TomekTrzeciak commented 5 years ago
  • Are these remotes pointing to github.com repos or somewhere else?

github.com (private and public repos alike)

  • If you remove the remote temporarily, does saving start working again? Guessing you might need to reload Atom after removing the remote.

Yes, saving works after removing remotes and restarting atom.

  • Are the projects you're working on local to your machine or on some kind of network drive?

This doesn't seem to make any difference (tried with repos on /tmp & /dev/shm with the same behaviour).

I've now tried also with remote pointing to a local, on disk repo and this works fine, so I suspect the problem is with connection to github getting stuck somehow. How can I debug this further?

(Edit: I remember getting some prompts for authentication token to github on atom 1.26, I'm not seeing any such prompts on this version.)

TomekTrzeciak commented 5 years ago

I believe I have located the root cause of the problem. It appears gnome login keyring was not accessible (locked) and causing github extension to get stuck and interfering with editor file operations. Happy to close this issue, unless there is some action devs want to take on this.

rsese commented 5 years ago

Sorry I missed your followup and thanks for posting what fixed things for you - I remember this similar issue that was resolved similarly: https://github.com/atom/github/issues/2019#issuecomment-475468089.

Happy to close this issue, unless there is some action devs want to take on this.

I think it might be worth it to leave this open in case this is an issue that could be handled more gracefully.

Asharas commented 4 years ago

Had the same problem, it seems that if keyring is locked (in my case I usually didn't open it) it causes the github package to hang because the token is stored in a keyring.

bobemoe commented 3 years ago

Yay! I've been trying to figure this out for ages! https://github.com/atom/atom/issues/18114 https://github.com/atom/atom/issues/18620 were the closest.

For me I work on many git repositories, but usually have a private local gitea remote and use the git integration to commit and push etc and all works well. Really nice functionality.

On the odd occasion I work on a project with a GitHub remote I experience this issue! I have to disable the GitHub extension to be able to work, which sucks because I use Git a lot in all my other projects.

I have a custom lightweight linux and i3 window manager and DO NOT use gnome keyring! Now I guess I need to figure out how to "unlock" it.

Can we just disable Gnome Keyring integration?

Can we just disable GitHub integration but keep the Git functionality?

TomekTrzeciak commented 3 years ago

Can we just disable GitHub integration but keep the Git functionality?

Add your voice to #2178

claytonjschneider commented 3 years ago

Leaving for anyone else, I encountered a problem where atom does not save files being edited on a remote server. I don't believe it's clear whether you are in read-only mode in atom, but ctrl-s and the actual save button do nothing (no error). To fix on remote server you need to change file permissions using chmod.