grive sync error, possibly google API shift
I am having trouble syncing with my google drive account from grive running on Ubuntu 14.04. I have never had problems previously. I tried purging drive from my system and deleting all local folders, but still come up with this when I try to run grive after reinstalling.
user@user-OptiPlex-780:~/drive$ grive
grive: Symbol `json_tokener_errors' has different size in shared object, consider re-linking
Reading local directories
Synchronizing folders
exception: /build/buildd/grive-0.2.0/libgrive/src/http/CurlAgent.cc(149): Throw in function long int gr::http::CurlAgent::ExecCurl(const string&, gr::http::Receivable*, const gr::http::Header&)
Dynamic exception type:boost::exception_detail::clone_impl<gr::http::Error>
std::exception::what: std::exception
[gr::expt::MsgTag*] =
[gr::http::CurlCodeTag*] = 0
[gr::http::HttpResponseTag*] = 400
[gr::http::UrlTag*] = https://docs.google.com/feeds/default/private/full/-/folder?max-results=50&showroot=true
[gr::http::HeaderTag*] = Authorization: Bearer ya29.WwFOho3OkmkxFIdn86HBbtpSIyBYDzDgQua1K6JcEu7kCBLgvY1aEiUHCZlSCuli_qPHkTfNZLhDfQ
GData-Version: 3.0
Here is a link to a google developers page that suggests that the API has changed today link. could that be an issue?
Yes, Grive is using the defunct Documents List API. As of around 9AM PST we stopped serving these API requests. This is why the Grive client is receiving '400 Bad Request' responses.
Looking at the project, it appears to be unmaintained for almost a year and definitely hasn't been updated (here & here) to the new API that was released in 2012 when Documents List was officially deprecated.
A good alternative might be drive which is written in go
and has quite a lot features.
To install follow these instructions:
-
Install needed packages
sudo apt-get install golang git mercurial
-
Create a path for
go
packages in your home directorymkdir $HOME/go $HOME/go/bin
-
Add these paths to the appropriate environment variables by editing the file
.profile
in your home directory. So add these lines at the and of that file:if [ -d "$HOME/go" ] ; then export GOPATH="$HOME/go" fi if [ -d "$HOME/go/bin" ] ; then PATH="$HOME/go/bin:$PATH" fi
Log off and log on to let the changes take effect.
-
Download and install
drive
from latest sourcego get -u github.com/odeke-em/drive/cmd/drive
-
Read https://github.com/odeke-em/drive/#usage
Basic usage:
-
drive init <folder>
initializes<folder>
for syncing with your Google Drive. - If yo do
drive pull
in your initialized folder, it will download all changes from Google Drive. At the first time maybe you have to do this more times to download everything. -
drive push
uploads local changes. -
drive pull <fileOrPath>
ordrive push <fileOrPath>
does the corresponding action only for<fileOrPath>
. - There are many more options to use, so read the manual.
-
A fork of grive has been made that works again (not by me, just found it)
https://github.com/vitalif/grive2
Easy replacement
mkdir grive
cd grive/
git clone https://github.com/vitalif/grive2.git
cd grive2/
mkdir build
cd build
cmake ..
make -j4
sudo make install
Now grive works fine for me.
A solution similar to grive is jdrivesync. You can download a copy on its github page.
To run jdrivesync follow these steps:
- Install Java
- Download jdrivesync
- Run it with
java -jar jdrivesync-0.2.2-jar-with-dependencies.jar -l "/home/directory-to-sync"
Ubuntu 14.04 grive package has just upgraded to Grive2 version 0.4.0-1. I had the same problem as you before the upgrade but I tried syncing this morning with the upgrade and it works.
For instructions on how to easily install grive2 0.4.0-1 in Ubuntu 14.04 and grive2 in all other currently supported versions of Ubuntu see this answer. It should be noted that the command sudo apt-get install grive
in the linked answer is correct because after adding the PPA it will indeed install grive2 that works instead of the old not upgraded version of grive that doesn't work anymore.