meganz / MEGAcmd

Command Line Interactive and Scriptable Application to access MEGA
Other
1.93k stars 406 forks source link

megacmd webdav not work as expected if mount via davfs2 #301

Open itmagpro opened 4 years ago

itmagpro commented 4 years ago

When I open dav://127.0.0.1:4443/YroiEQ5Z/home in filemanage, then all (copy/create/touch file) work fine, butn not fork if I try mount point via davfs2:

# sudo dpkg-reconfigure davfs2

...and allow SUID...

# usermod -a -G davfs2 user

$ mega-login user@example.com PASSWD

$ mega-webdav /home
Serving via webdav /home: http://127.0.0.1:4443/YroiEQ5Z/home

# vi /etc/fstab

http://127.0.0.1:4443/YroiEQ5Z/home /home/user/mnt/mega davfs user,rw,noauto 0 0

$ mount /home/user/mnt/mega

# less /var/log/syslog
...
Jan 25 04:30:08 localhost mount.davfs: davfs2 1.5.5
Jan 25 04:30:11 localhost udisksd[517]: udisks_mount_get_mount_path: assertion 'mount->type == UDISKS_MOUNT_TYPE_FILESYSTEM' failed

$ mount -l|grep home
http://127.0.0.1:4443/YroiEQ5Z/home on /home/user/mnt/mega type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1000,group_id=1000,allow_other,max_read=16384,uid=1000,gid=1000,user=user,helper=davfs)

$ ls /home/user/mnt/mega
 Dir1   lost+found

Work only read function, but copy/create file not work:

$ cp tmpfile /home/user/mnt/mega
cp: невозможно создать обычный файл '/home/user/mnt/mega/tmpfile': Нет такого файла или каталога

$ touch /home/user/mnt/mega/tmpfile
touch: невозможно выполнить touch для '/home/user/mnt/mega/tmpfile': Нет такого файла или каталога

copy/create/touch file also not work in filemanager.

$ umount /home/user/mnt/mega/
/sbin/umount.davfs: waiting while mount.davfs (pid 12762) synchronizes the cache .. OK

# less /var/log/syslog
...
Jan 25 04:30:27 localhost udisksd[517]: udisks_mount_get_mount_path: assertion 'mount->type == UDISKS_MOUNT_TYPE_FILESYSTEM' failed
Jan 25 04:30:27 localhost systemd[1]: home-user-mnt-mega.mount: Succeeded.
Jan 25 04:30:27 localhost systemd[1229]: home-user-mnt-mega.mount: Succeeded.

megacmd webdav server not work properly if mount via davfs2 or I du something wrong?:)

itmagpro commented 4 years ago

...and also... How I can fix random part in url dav://127.0.0.1:4443/YroiEQ5Z/home - in this case instead "YroiEQ5Z" like this "mypermanent" as dav://127.0.0.1:4443/mypermanent/home, aka via like new start/login with predefined sessionID as example "mypermanent"? ...for reason not change /etc/fstab file with each new login to my account...this make sense if davfs2 will be work with megacmd.

laserguidedcake commented 4 years ago

Having the same issue using current build on Debian 10:

root@ded-818:~# mega-webdav /hosted Serving via webdav /hosted: http://127.0.0.1:4443/ynxkRAYY/hosted root@ded-818:~# mkdir /mnt/mega root@ded-818:~# mount -t davfs -o noexec http://127.0.0.1:4443/ynxkRAYY/hosted /mnt/mega/ root@ded-818:~# touch /mnt/mega/file.txt touch: cannot touch '/mnt/mega/file.txt': No such file or directory

I am able to view content, but unable to write any (touch, cp, mv, etc.)

keliew commented 3 years ago

Having same issue as above.

nadalizadeh commented 2 years ago

This is a known issue with davfs (https://sourceforge.net/p/dav/discussion/82589/thread/d28405b5/) Open davfs configuration in /etc/davfs and set the following:

use_locks 0