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

Abend when syncing a markdown file edited in Google Drive #297

Open marcelpaulo opened 9 years ago

marcelpaulo commented 9 years ago

grive abends when syncing a markdown file which was created locally and later edited in Google Drive with StackEdit.

These steps reproduced the problem:

  1. Created local file deleteme.md with a single line:

    Testing how Google Drive and grive handle markdown files

  2. Run grive to sync it. It was created in Google Drive as type Binary: deleteme.md type binary
  3. Added a line to deleteme.md on Google Drive, using StackEdit. Google Drive then changed its type to Text: deleteme.md type text
  4. Run grive again, to sync the changes back to the local file. grive abended, logging these messages:
sync "./deleteme.md" changed in remote. downloading
HTTP GET "https://doc-0k-34-docs.googleusercontent.com/docs/securesc/8e5mi73bpbrcjnsoqfmq7igptmngh5a6/u8o84ad7onbbrscgtpre5jhmrmgjmo6r/1422972000000/18047996236854185780/18047996236854185780/0B6eQjhXV-AqubHdYeklSNy1ROEk?e=download&gd=true"
HTTP response 0
exception: /build/buildd/grive-0.3.0/libgrive/src/http/CurlAgent.cc(169): Throw in function long int gr::http::CurlAgent::ExecCurl(const string&, gr::DataStream*, const gr::http::Header&)
Dynamic exception type: N5boost16exception_detail10clone_implIN2gr4http5ErrorEEE
[PN2gr4expt12BacktraceTagE] = #0 0x471e9c grive gr::Exception::Exception()
#1 0x45730f grive gr::http::CurlAgent::ExecCurl(std::string const&, gr::DataStream*, gr::http::Header const&)
#2 0x45785a grive gr::http::CurlAgent::Get(std::string const&, gr::DataStream*, gr::http::Header const&)
#3 0x45d07d grive gr::AuthAgent::Get(std::string const&, gr::DataStream*, gr::http::Header const&)
#4 0x488038 grive gr::v1::Resource::Download(gr::http::Agent*, boost::filesystem::path const&) const
#5 0x4898f5 grive gr::v1::Resource::SyncSelf(gr::http::Agent*, gr::Json const&)
#6 0x489f7b grive gr::v1::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#7 0x48a090 grive gr::v1::Resource::Sync(gr::http::Agent*, gr::DateTime&, gr::Json const&)
#8 0x448528 grive gr::v1::State::Sync(gr::http::Agent*, gr::Json const&)
#9 0x43fb20 grive gr::v1::Drive::Update()
#10 0x4303a5 grive Main(int, char**)
#11 0x42debb grive main
#12 0x7fe1f1aabec5 /lib/x86_64-linux-gnu/libc.so.6 __libc_start_main
#13 0x42f114 grive 
[PN2gr4http11CurlCodeTagE] = 6
[PN2gr4http13CurlErrMsgTagE] = Could not resolve host: doc-0k-34-docs.googleusercontent.com
[PN2gr4http6UrlTagE] = https://doc-0k-34-docs.googleusercontent.com/docs/securesc/8e5mi73bpbrcjnsoqfmq7igptmngh5a6/u8o84ad7onbbrscgtpre5jhmrmgjmo6r/1422972000000/18047996236854185780/18047996236854185780/0B6eQjhXV-AqubHdYeklSNy1ROEk?e=download&gd=true
[PN2gr4http9HeaderTagE] = Authorization: Bearer ya29.DwFJX8hxrfsVljXzOmnX8tQNe_xIy_ev89KSuDiPM9Z85xFFO4f8PgFyZywp8QFKRzIF2Fnsy4YtWw
GData-Version: 3.0

and zeroed the file:

paulo@monk:~/tmp$ ls -lh ~/Google\ Drive/deleteme.md 
-rw-rw-r-- 1 paulo paulo 0 Fev  3 13:31 /home/paulo/Google Drive/deleteme.md

I have observed that this only happens after Google Drive changes a file type, and I have only seen Google Drive doing this for markdown files with extension md.

Here is the full .grive-last-sync.log for this run.