Google-drive-ocamlfuse: install on headless Debian server?

Created on 10 May 2018  路  7Comments  路  Source: astrada/google-drive-ocamlfuse

Hello,

I'm trying to get this to run on my headless Debian 9.4 'Stretch' server, but the lack of graphical browser to perform authentication appears to be an issue:

$ google-drive-ocamlfuse 
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening 'https://accounts.google.com/o/oauth2/auth?client_id=564921029129.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fgd-ocaml-auth.appspot.com%2Foauth2callback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&response_type=code&access_type=offline&approval_prompt=force&state=<blah>'
/bin/sh: 1: firefox: not found
/bin/sh: 1: google-chrome: not found
/bin/sh: 1: chromium-browser: not found
Couldn't get a file descriptor referring to the console
Cannot retrieve auth tokens.
Failure("Error opening URL:https://accounts.google.com/o/oauth2/auth?client_id=564921029129.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fgd-ocaml-auth.appspot.com%2Foauth2callback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&response_type=code&access_type=offline&approval_prompt=force&state=<blah>")

So, I installed lynx as it has previously worked for me regarding Google authentication, but then running google-drive-ocamlfuse appear to hang with no messages shown:

$ google-drive-ocamlfuse 

Checking ~/.gdfuse/default shows:

$ ll                                                                                                                             
total 12K                                                                                                                                                    
drwx------ 2 me me 4.0K May 10 12:16 cache                                                                                                               
-rw-r--r-- 1 me me 1008 May 10 12:16 config                                                                                                              
-rw-r--r-- 1 me me    0 May 10 12:16 gdfuse.log                                                                                                          
-rw-r--r-- 1 me me  201 May 10 12:16 state

lynx does load correctly if I use something like $ xdg-open https://google.com

Any suggestions as to how I can get this to work?

Thank you.

All 7 comments

Thanks @cowboycodur, that's what I needed. :)

So, followed the instructions (with a bit of variation as Google have changed parts of the API site), and the authentication appears to have worked correctly: Access token retrieved correctly, but I'm not 100% sure.

$ google-drive-ocamlfuse -label me /media/external/cloud/google-drive/
fuse: failed to exec fusermount: No such file or directory
````
So, `sudo apt-get install fuse` to get `fusermount`.

When I tried mounting my Google Drive, the process appears to hang:

$ google-drive-ocamlfuse -label me -debug /media/external/cloud/google-drive/
Starting application setup (label=me, base_dir=).
[0.000417] TID=0: Loading configuration from /home/me/.gdfuse/me/config...done
Opening log file: /home/me/.gdfuse/me/gdfuse.log

So, I checked the [~/.gdfuse/me/gdfuse.log] file:

$ cat gdfuse.log
[0.001271] TID=0: Setting up me filesystem...
[0.001360] TID=0: BEGIN: Saving configuration in /home/me/.gdfuse/me/config
[0.041641] TID=0: END: Saving configuration in /home/me/.gdfuse/me/config
[0.041929] TID=0: Loading application state from /home/me/.gdfuse/me/state...done
Current version: 0.6.24
Setting up cache db...done
Setting up CURL...done
Refresh token already present.
[0.044800] TID=0: Starting filesystem /media/external/cloud/google-drive/
[0.052132] TID=1: init_filesystem
[0.052266] TID=1: BEGIN: Getting root folder id (team drive id=, root folder=) from server
[0.052443] TID=1: END: Getting root folder id (id=root) from server
```

And nothing else happens. I also tried with sudo, but got the same thing - process appears to hang.

Any ideas? Thank you.

Make sure this folder already exists/media/external/cloud/google-drive/

Also since you have had a failed attempt, it may just hang everytime now. That happened to me. Delete your .gdfuse directory and try again.

Yes, that directory exists.

I removed .gdfuse then went through the authorisation process again, and am back to the same issue - attempting to mount just stalls.

OK, I've done some more checking.

I logged in though a second terminal and discovered that even though the process appears to hang, my Google Drive is being mounted. But if I CTRL+C the original google-drive-ocamlfuse in my first terminal, the mount drops immediately.

Is google-drive-ocamlfuse supposed to work that way? I thought it operated more like a mount command?

Is google-drive-ocamlfuse supposed to work that way? I thought it operated more like a mount command?

The process remains in foreground if you specify -debug (or -f).

Oh damn, didn't think of that!

Yes, works fine now that I've removed -debug.

Thanks for your help guys. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maltokyo picture maltokyo  路  3Comments

ilovetosharing picture ilovetosharing  路  4Comments

JP-Ellis picture JP-Ellis  路  11Comments

drgroot picture drgroot  路  4Comments

meszape picture meszape  路  6Comments