Crash during initial sync #114

Open
anssi10 opened this Issue Aug 3, 2012 · 17 comments

Projects

None yet
@anssi10
anssi10 commented Aug 3, 2012

I just pulled Grive from git. During the initial sync I got a crash, details below. On two machines now, but different files. Also this leaves behind a local zero length file which grive tries to upload on the next run but crashes again.

sync ./TitaniumBackup-GNex/com.android.soundrecorder-20120617-205912.properties created in remote. creating local
exception: /work/src/grive/libgrive/src/protocol/AuthAgent.cc(174): Throw in function long int gr::AuthAgent::CheckHttpResponse(long int, const std::string&, const gr::http::Header&)
Dynamic exception type: N5boost16exception_detail10clone_implIN2gr4http5ErrorEEE
std::exception::what: std::exception
[PN2gr4http9HeaderTagE] = Authorization: Bearer ya29.AHES6ZR_WoqzIV4KV82ehEnhmxCIB5eW_9gTeUAs7ndBZmc
GData-Version: 3.0

[PN2gr4http6UrlTagE] = https://doc-14-28-docs.googleusercontent.com/docs/securesc/bqbu31dha62ggj5a9uc5okdh17n97aba/841lsnoouso7f3gimmvhrjr8jlc40fq6/1343995200000/02482661572964810104/02482661572964810104/0ByZZWNdPgCdeaGVYYnJ3OHBYaTA?h=16653014193614665626&e=download&gd=true
[PN2gr4http15HttpResponseTagE] = 404
[PN2gr4expt12BacktraceTagE] = #0 0x4cb6a3 ./grive gr::Exception::Exception()
#1 0x4b49ab ./grive gr::http::Error::Error()
#2 0x4c101a ./grive gr::AuthAgent::CheckHttpResponse(long, std::string const&, gr::http::Header const&)
#3 0x4c0a3c ./grive gr::AuthAgent::Get(std::string const&, gr::http::Receivable*, gr::http::Header const&)
#4 0x4a87e6 ./grive gr::Resource::Download(gr::http::Agent*, boost::filesystem::basic_path<std::string, boost::filesystem::path_traits> const&) const
#5 0x4a7bae ./grive gr::Resource::SyncSelf(gr::http::Agent*, gr::Json const&)
#6 0x4a73ba ./grive gr::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#7 0x4ae5f5 ./grive boost::mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>::operator()(gr::Resource, gr::http::Agent_, gr::DateTime&, gr::Json const&) const
#8 0x4ad6ff ./grive void boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json >::operator()<boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list1gr::Resource*& >(boost::_bi::type, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>&, boost::_bi::list1gr::Resource*&&, int)
#9 0x4ac95a ./grive void boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json > >::operator()gr::Resource*(gr::Resource*&)
#10 0x4ab4c3 ./grive boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json > > std::for_each<__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocatorgr::Resource* > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json > > >(__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocatorgr::Resource* > >, __gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocatorgr::Resource* > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::bi::valuegr::Json > >)
#11 0x4a74be ./grive gr::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#12 0x4ae5f5 ./grive boost::mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>::operator()(gr::Resource, gr::http::Agent
, gr::DateTime&, gr::Json const&) const
#13 0x4ad6ff ./grive void boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json >::operator()<boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list1gr::Resource*& >(boost::_bi::type, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>&, boost::_bi::list1gr::Resource*&&, int)
#14 0x4ac95a ./grive void boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json > >::operator()gr::Resource*(gr::Resource*&)
#15 0x4ab4c3 ./grive boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json > > std::for_each<__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocatorgr::Resource* > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json > > >(__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocatorgr::Resource* > >, __gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocatorgr::Resource* > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4boost::arg<1, boost::_bi::valuegr::http::Agent*, boost::reference_wrappergr::DateTime, boost::_bi::valuegr::Json > >)
#16 0x4a74be ./grive gr::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#17 0x4913f2 ./grive gr::State::Sync(gr::http::Agent*, gr::Json const&)
#18 0x498fd2 ./grive gr::Drive::Update()
#19 0x477bd9 ./grive Main(int, char**)
#20 0x477dff ./grive main
#21 0x7f8dc2ac6c4d /lib/libc.so.6 __libc_start_main
#22 0x4763b9 ./grive

@alexs77
alexs77 commented Sep 4, 2012

I've got the same problem. I'm on Ubuntu 12.04, if it matters. Interestingly, it also crashs when it tries to sync a file from my TitaniumBackup backup folder.

13:41:51 a.sk@ewzw032:~/grive$ grive 
Reading local directories
Synchronizing folders
Reading remote server file list
Synchronizing files
sync "./Android/TitaniumBackup/com.android.browser-20120805-230210.properties" changed in local. uploading
exception: /build/buildd/grive-0.3.0/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>
std::exception::what: std::exception
[gr::expt::BacktraceTag*] = #0 0x46582f grive gr::Exception::Exception()
#1 0x45ea8b grive 
#2 0x45f3c0 grive gr::AuthAgent::Put(std::string const&, gr::StdioFile&, gr::http::Receivable*, gr::http::Header const&)
#3 0x44f61d grive gr::Resource::Upload(gr::http::Agent*, std::string const&, bool)
#4 0x45031d grive gr::Resource::EditContent(gr::http::Agent*, bool)
#5 0x45186f grive gr::Resource::SyncSelf(gr::http::Agent*, gr::Json const&)
#6 0x451a78 grive gr::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#7 0x45205b grive boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > > std::for_each<__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > > >(__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, __gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > >)
#8 0x451b39 grive gr::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#9 0x45205b grive boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > > std::for_each<__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > > >(__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, __gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > >)
#10 0x451b39 grive gr::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#11 0x45205b grive boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > > std::for_each<__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > > >(__gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, __gnu_cxx::__normal_iterator<gr::Resource**, std::vector<gr::Resource*, std::allocator<gr::Resource*> > >, boost::_bi::bind_t<void, boost::_mfi::mf3<void, gr::Resource, gr::http::Agent*, gr::DateTime&, gr::Json const&>, boost::_bi::list4<boost::arg<1>, boost::_bi::value<gr::http::Agent*>, boost::reference_wrapper<gr::DateTime>, boost::_bi::value<gr::Json> > >)
#12 0x451b39 grive gr::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#13 0x439450 grive gr::State::Sync(gr::http::Agent*, gr::Json const&)
#14 0x43c49b grive gr::Drive::Update()
#15 0x4278ec grive Main(int, char**)
#16 0x4245b9 grive main
#17 0x7fe5da5fb76d /lib/x86_64-linux-gnu/libc.so.6 __libc_start_main
#18 0x425321 grive 

[gr::http::HttpResponseTag*] = 400
[gr::http::UrlTag*] = https://docs.google.com/feeds/upload/create-session/default/private/full/file%3A0B-E69LM_eZgjNzRUREJsNnRteE0?upload_id=AEnB2UoGhvpcGWI5ODkV92S6xbwAKrTZJCKFMsztJ8AiQRRPFSEbW0t4BF24kG61j6Vc4Jy6QfUdjhOwil55hp46o-KW8o2-1w
[gr::http::HeaderTag*] = Expect:
Accept:
Authorization: Bearer ya29.AHES6……
GData-Version: 3.0


13:54:02 a.sk@ewzw032:~/grive$ grive -v
grive version 0.3.0-pre Aug  9 2012 11:24:51

anssi10, did you maybe find a solution in the meantime?

@anssi10
anssi10 commented Sep 4, 2012

@alexs77, no, didn't find any solutions unfortunately.

@anssi10 anssi10 closed this Sep 4, 2012
@anssi10 anssi10 reopened this Sep 4, 2012
@fugerit
fugerit commented Oct 13, 2012

Hi guys. Not sure it will help, but I got that error when added a file with the same path from two devices. The second device was my ubuntu box and when it tried to upload it got that error. I deleted the file locally and didn't get the error anymore. Hopes it helps!

@alexs77
alexs77 commented Oct 13, 2012

Thanks, but that's not it for me. I only had Grive partially setup on one
machine. I figured first to try it with a simple setup to see how it works.

Well - it falls flat down on its face... :-\

@samanthony

Hi Guys, I was getting this error here.

sync "./passwords2.ods" changed in local. uploading
exception: /build/buildd/grive-0.3.0/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_implgr::http::Error
std::exception::what: std::exception

I renamed my file "password2.ods" to "passwords3.ods" (the version on my local hard drive). And then the Sync worked. Not 100% sure if that is what fixed it as I was playing with a few other things at the same time.

@fommil
fommil commented Jul 10, 2014

👍 @samanthony I got the same error and deleted the local file. Must have been a corrupt download or something (this was a first sync)

@jimkeller

I was seeing this issue when I had a file from my Drive folder still opened in MS Word (in a VirtualBox mapped drive). Closing MS Word in VirtualBox resolved it; it might have been due to some kind of file locking.

@aggalex
aggalex commented Apr 24, 2015

I have this issue too on Ubuntu 14.04

exception: /build/buildd/grive-0.3.0/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_implgr::http::Error
[gr::expt::BacktraceTag_] = #0 0x80ab8c6 grive gr::AuthAgent::CheckHttpResponse(long, std::string const&, gr::http::Header const&)
#1 0x80abdf9 grive gr::AuthAgent::Get(std::string const&, gr::DataStream_, gr::http::Header const&)
#2 0x80842d9 grive gr::v1::Drive::SyncFolders()
#3 0x8084f8a grive gr::v1::Drive::DetectChanges()
#4 0x80739d3 grive Main(int, char**)
#5 0x8071164 grive main
#6 0xb7263a83 /lib/i386-linux-gnu/libc.so.6 __libc_start_main
#7 0x8072480 grive

[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.XwFkuMJOpK5hY6rHQUNEBVx5uLlEebjFontzUX1Uv_IcMPEwjlbM4YlaqGnsNYbP0Iinjqv4fiwKnw
GData-Version: 3.0

@aggalex
aggalex commented Apr 24, 2015

It looks like it's because of the new Google API, Grive is getting 400 error "Bad request". I thing that Grive developers sould start coding again!

@marcelmoosbrugger

I get a similar error:

Reading local directories
Synchronizing folders
exception: /build/buildd/grive-0.3.0/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_implgr::http::Error
[gr::expt::BacktraceTag_] = #0 0x4644e0 grive gr::Exception::Exception()
#1 0x45f1f4 grive gr::AuthAgent::CheckHttpResponse(long, std::string const&, gr::http::Header const&)
#2 0x45f6f0 grive gr::AuthAgent::Get(std::string const&, gr::DataStream_, gr::http::Header const&)
#3 0x4416a0 grive gr::v1::Drive::SyncFolders()
#4 0x44236d grive gr::v1::Drive::DetectChanges()
#5 0x430fd4 grive Main(int, char**)
#6 0x42eb5b grive main
#7 0x7f0747ba6ec5 /lib/x86_64-linux-gnu/libc.so.6 __libc_start_main
#8 0x42fc0f grive

[gr::http::HttpResponseTag_] = 400
[gr::http::UrlTag_] = https://docs.google.com/feeds/default/private/full/-/folder?max-results=50&showroot=true
GData-Version: 3.0

@pdecat
pdecat commented Apr 28, 2015

Warning : You should not share your Authorization token publicly, anyone could use it to access your documents.
You should revoke the grive application from the authorized applications in your google account.

@pdecat
pdecat commented Apr 28, 2015

Regarding the issue, it is due to google API changes.

https://www.thefanclub.co.za/how-to/ubuntu-google-drive-client-grive-and-grive-tools

@fommil
fommil commented Apr 28, 2015

this project is dead, check activity at https://github.com/linwiz/grive

@flawyte
flawyte commented Apr 28, 2015

@fommil I still get a 400 with this tool. Also, last commit was made almost 4 months ago.

While googling for this problem I found two alternatives to Grive :

Haven't tested any of them yet, but I'm probably gonna give jdrivesync a try.

@flawyte
flawyte commented Apr 28, 2015

@pdecat Awesome. Thanks man !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment