Grive / grive

an open source Linux client for Google Drive
http://www.lbreda.com/grive/start
GNU General Public License v2.0
1.59k stars 378 forks source link

During first sync error occurs and sometimes zeros a file which is then uploaded as an updated one #278

Open jasdeepkhalsa opened 10 years ago

jasdeepkhalsa commented 10 years ago

I have been getting errors like the following whilst trying to sync for the first time (which I, in the end, never managed to do and deleted grive):

exception: /build/buildd/grive-0.3.0+git20131230/libgrive/src/protocol/AuthAgent.cc(174): Throw in function long int gr::AuthAgent::CheckHttpResponse(long int, const string&, const gr::http::Header&)
Dynamic exception type: boost::exception_detail::clone_impl<gr::http::Error>
[gr::expt::BacktraceTag*] = #0 0x46fed0 grive gr::Exception::Exception()
#1 0x4666e4 grive gr::AuthAgent::CheckHttpResponse(long, std::string const&, gr::http::Header const&)
#2 0x466c54 grive gr::AuthAgent::Get(std::string const&, gr::DataStream*, gr::http::Header const&)
#3 0x4509ea grive gr::v1::Resource::Download(gr::http::Agent*, boost::filesystem::path const&) const
#4 0x451b32 grive gr::v1::Resource::SyncSelf(gr::http::Agent*, gr::Json const&)
#5 0x451f77 grive gr::v1::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#6 0x452098 grive gr::v1::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#7 0x452098 grive gr::v1::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#8 0x452098 grive gr::v1::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#9 0x44bc28 grive gr::v1::State::Sync(gr::http::Agent*, gr::Json const&)
#10 0x440c60 grive gr::v1::Drive::Update()
#11 0x43091e grive Main(int, char**)
#12 0x42e6ab grive main
#13 0x7fc6be74eec5 /lib/x86_64-linux-gnu/libc.so.6 __libc_start_main
#14 0x42f4cf grive 

[gr::http::HttpResponseTag*] = 404
[gr::http::UrlTag*] = https://doc-00-2c-docs.googleusercontent.com/docs/securesc/snv9bif9v3f2ld4ceue2jsv6jvjd6k53/eon5hqect98ot3crh30mcep5t7k9qv98/1412020800000/05265358799001198805/05265358799001198805/0B_sqxUtaUlBmTXRleWoyLU1yZU0?h=16653014193614665626&e=download&gd=true
[gr::http::HeaderTag*] = Authorization: Bearer ya29.jwAydAMrukAvGGwXJp6Rp-U-AnxAu1dGsS-IxfmlEAnsEa8mZQon44K3
GData-Version: 3.0

Using Ubuntu 14.04. Grive was installed via Ubuntu PPA by nilarimogard/webupd8 here: http://www.webupd8.org/2012/05/grive-open-source-google-drive-client.html

Sometimes what was happening during one of these errors is that the file was only partially downloaded (0 bytes). So next time I tried to sync to download all my files, it detected it as an updated file and uploaded the zero byte file. I'm pretty SHOCKED there is no check for this as this is a pretty destructive situation which could end up in people loosing a lot of data!

Grive should always check to see the following:

linwiz commented 10 years ago

Have you tried installing grive from github? I'm not sure what repo the ppa used. Grive/grive hasn't been updated in a while but I have recently merged a bunch of forks into my fork, linwiz/grive. I Don't know if this will solve any of your issues or not. I may try to see if I can add any of those bullet points myself but I'm not so sure I can.

jasdeepkhalsa commented 10 years ago

Thanks @linwiz I might just give that a shot! Although without some of the features I mentioned I'm hesitant to even use grive because the program is too destructive. In the meanwhile to do my backup I tried out insynchq.com and it works great! Syncs really fast with no problems. I'm not against buying a software to do this, it's just that my data should be protected from destruction in every way possible ;)

linwiz commented 10 years ago

Yes, it still lacks proper protection, so that is an issue that needs to be dealt with.

jasdeepkhalsa commented 10 years ago

Yes for sure! My ultimate aim was actually to sync Google Drive and One Drive files and folders. So in the end I actually just ended up installing Google Drive and One Drive clients on a Windows PC I had access to (could have also done it on a Windows VM via VirtualBox on Linux) and then used a small sync utility (http://portableapps.com/apps/utilities/dsynchronize_portable) to copy files/folders from one dir to another, which could easily be added to a cron for regular syncs. The client then notices a change has occurred and starts to upload them. I'm very comfortable with this solution for now, until I invest in a NAS.