vitalif / grive2

Google Drive client with support for new Drive REST API and partial sync
http://yourcmc.ru/wiki/Grive2
GNU General Public License v2.0
1.52k stars 140 forks source link

Error on ntfs partition. #35

Open kwon37xi opened 9 years ago

kwon37xi commented 9 years ago

When I tried to sync my google drive on a ntfs partition, the following error occured. After changing to ext4, no error occurs.

sync "./icons/myicon.png" created in remote. creating local
exception: /build/grive2-rauZp1/grive2-0.4.1/libgrive/src/util/OS.cc(81): Throw in function void gr::os::SetFileTime(const string&, const gr::DateTime&)
Dynamic exception type: boost::exception_detail::clone_impl<gr::os::Error>
[gr::expt::BacktraceTag*] = #0 0x477d00 grive gr::Exception::Exception()
#1 0x477151 grive gr::os::Error::Error()
#2 0x476e12 grive gr::os::SetFileTime(boost::filesystem::path const&, gr::DateTime const&)
#3 0x44d5ff grive gr::Syncer::Download(gr::Resource*, boost::filesystem::path const&)
#4 0x449df8 grive gr::Resource::SyncSelf(gr::Syncer*, gr::Val const&)
#5 0x44a237 grive gr::Resource::Sync(gr::Syncer*, gr::DateTime&, gr::Val const&)
#6 0x44a358 grive gr::Resource::Sync(gr::Syncer*, gr::DateTime&, gr::Val const&)
#7 0x44a358 grive gr::Resource::Sync(gr::Syncer*, gr::DateTime&, gr::Val const&)
#8 0x44e5c8 grive gr::State::Sync(gr::Syncer*, gr::Val const&)
#9 0x443066 grive gr::Drive::Update()
#10 0x432cce grive Main(int, char**)
#11 0x430cab grive main
#12 0x7f2e724d1ec5 /lib/x86_64-linux-gnu/libc.so.6 __libc_start_main
#13 0x43181f grive 

1, "Operation not permitted"[boost::errinfo_file_name_*] = ./icons/myicon.png
[boost::errinfo_api_function_*] = utimes
vitalif commented 9 years ago

The fix for this should be very simple (do not throw exception when mtime change fails), but it's interesting that your ntfs volume does not allow changing mtime. Is it ntfs-3g?

vitalif commented 9 years ago

Just tested with ntfs-3g - there is no such error...

kwon37xi commented 9 years ago

I tried again and I found the solution. After adding fmask,uid to /etc/fstab item, it works correctly.

Before my /etc/fstab

UUID=0226D37B26D36E63 /media/windows  ntfs    defaults,umask=007,gid=46 0       0

After

UUID=0226D37B26D36E63 /media/windows  ntfs    defaults,umask=007,gid=46,fmask=111,uid=1000 0       0
vitalif commented 9 years ago

Ok, so you weren't the owner of these files. I think I'll remove the exception anyway because the mtime modifications are not necessary for grive to work.