Skip to content
This repository has been archived by the owner on Aug 22, 2020. It is now read-only.

Stopping GitFS server; GitHub URL/clone failing #36

Closed
peter-kehl opened this issue Jan 28, 2019 · 5 comments
Closed

Stopping GitFS server; GitHub URL/clone failing #36

peter-kehl opened this issue Jan 28, 2019 · 5 comments
Labels
docs Documentation ux User experience

Comments

@peter-kehl
Copy link
Contributor

This may be two or one issues - split it if needed.

$ cat ~/.gitfs/config.yml:
mount: "${HOME}/GitFS"
accounts:
  - github:
      oauth2:
        token: ...
      users:
      - peter-kehl 
clone:
  repositoryRoot: "${HOME}/.gitfs/cache" # this is where your repos will be cloned
  depth: 0 # depth 0 means full clone
  
$ ~/Downloads/gitfs_linux_amd64 start
INFO[0000] [main] configured mount point: /home/pkehl/GitFS 
INFO[0000] [main] fetching repositories
...
NFO[0005] [main] now serving file system               
ERRO[0026] [filesystem.directory] failed to clone url: git@github.com:peter-kehl/docker.github.io.git, failed to clone repo: git@github.com:peter-kehl/docker.github.io.git: ssh: handshake failed: knownhosts: key is unknown

That did create a directory structure under ~/GitFS, with my repositories - both my own and in my organisations. However, all are empty:

$ ls /home/pkehl/GitFS/github.com/peter-kehl/4clojure
# -> empty output
$ grep 4clojure ~/.gitfs/cache/*/.git/config
N19UKEAUM8PTKEEIH4CRI8Q5HE9FIHVPUN99BR49MQPJ7DE6ME6G/.git/config:	url = git@github.com:peter-kehl/4clojure.git
$ ls -a ~/.gitfs/cache/N19UKEAUM8PTKEEIH4CRI8Q5HE9FIHVPUN99BR49MQPJ7DE6ME6G
.  ..  .git

$ ~/Downloads/gitfs_linux_amd64 stop
INFO[0000] Unmounting /home/pkehl/GitFS

That shows the same even when repeated.

However, it didn't kill the server process. Even worse, after I Ctrl+C stopped the main process, I couldn't restart it:

$ ~/Downloads/gitfs_linux_amd64 start
INFO[0000] [main] configured mount point: /home/pkehl/GitFS 
INFO[0000] [main] fetching repositories                 
INFO[0000] [remotes.github] processing organizations for user: peter-kehl 
INFO[0000] [remotes.github] processing repositories for user: peter-kehl 
INFO[0001] [remotes.github] processing repositories for organization: Melati 
INFO[0001] [remotes.github] processing repositories for organization: SeLite 
INFO[0002] [remotes.github] processing repositories for organization: VanClojure 
INFO[0003] [remotes.github] processing repositories for organization: DaisyDiff 
INFO[0003] [remotes.github] processing repositories for organization: PanEris 
INFO[0003] [main] parsing repositories into a directory structure 
INFO[0003] [main] attempting to mount /home/pkehl/GitFS 
2019/01/28 09:11:40 mount helper error: fusermount: failed to access mountpoint /home/pkehl/GitFS: Permission denied
ERRO[0003] [main] failed to mount mountpoint: fusermount: exit status 1

Why is that worth fixing? A user is likely to start gitfs right after rebooting. On laptops, some Linux distributions (Manjaro/Arch) start with disabled Wifi. That means the user user has to reboot again...

@mjpitz
Copy link
Member

mjpitz commented Jan 30, 2019

@peter-kehl : When you kill the server, it doesn't completely unmount the file system. You'll have to run gitfs stop to resolve the mount issue. This forces the file system to unmount the directory. Since you're doing a full clone to a directory on dist, none of your changes will be lost.

I spent a little time looking into trying to set up a sigterm trap that forces the unmount, but I thought of a few cases where the mount may still be left in tact. So I wrote the stop command to be able to resolve this issue.

@mjpitz
Copy link
Member

mjpitz commented Jan 30, 2019

@peter-kehl per your cloning issue, you'll want to add your ssh keys to your terminal session.

ssh-add [file]

There are a few ways that this could be addressed. I opened gh-37 to discuss this further there.

@mjpitz mjpitz added ux User experience docs Documentation labels Jan 30, 2019
@peter-kehl
Copy link
Contributor Author

When I start the server, kill it by Ctrl+C, then I run gitfs stop, it echoes:

INFO[0000] Unmounting /home/pkehl/GitFS 

Then gitfs stop fails with the above permission error.

@mjpitz
Copy link
Member

mjpitz commented Jan 31, 2019

Another thing you can try doing is invoking umount directly:

sudo umount -f /home/pkehl/GitFS

Early in development, this would happen quite a bit. It's why I wrote stop. It seems like stop may not be working properly on arch systems.

@peter-kehl
Copy link
Contributor Author

Thank you. umount works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs Documentation ux User experience
Projects
None yet
Development

No branches or pull requests

2 participants