anki-sync-server
anki-sync-server copied to clipboard
OSError: [Errno 13] Permission denied: '/root/.local'
This error happens when some users try to sync media sometimes. I don't know if it's tied to specific data in their collections, but it does usually happen several times in a row - and then doesn't happen again for a while.
Traceback (most recent call last):
File "/opt/anki_server/src/anki-sync-server/AnkiServer/threading.py", line 95, in _run
ret = self.wrapper.execute(func, args, kw, return_queue)
File "/opt/anki_server/src/anki-sync-server/AnkiServer/collection.py", line 58, in execute
ret = func(*args, **kw)
File "/opt/anki_server/src/anki-sync-server/AnkiServer/apps/sync_app.py", line 466, in runFunc
result = func(**data)
File "/opt/anki_server/src/anki-sync-server/AnkiServer/apps/sync_app.py", line 89, in remove
rrem = MediaSyncer.remove(self, fnames, minUsn)
File "/usr/share/anki/anki/sync.py", line 712, in remove
self.col.media.syncRemove(fnames)
File "/usr/share/anki/anki/media.py", line 248, in syncRemove
send2trash.send2trash(f)
File "/usr/share/anki/thirdparty/send2trash/plat_other.py", line 157, in send2trash
trash_move(path, dest_trash, topdir)
File "/usr/share/anki/thirdparty/send2trash/plat_other.py", line 77, in trash_move
check_create(filespath)
File "/usr/share/anki/thirdparty/send2trash/plat_other.py", line 63, in check_create
os.makedirs(dir, 0700)
File "/opt/anki_server/AnkiServer.env/lib/python2.6/os.py", line 150, in makedirs
makedirs(head, mode)
File "/opt/anki_server/AnkiServer.env/lib/python2.6/os.py", line 150, in makedirs
makedirs(head, mode)
File "/opt/anki_server/AnkiServer.env/lib/python2.6/os.py", line 150, in makedirs
makedirs(head, mode)
File "/opt/anki_server/AnkiServer.env/lib/python2.6/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/root/.local'
I suspect this might have to do with an os.chdir() in the media sync'ing code which is a totally dangerous thing to do in a multithreading application - but I haven't had a chance to test that theory.
Overall, I don't think we need the 'send2trash' functionality on the server, so that can probably be removed all together.
got the same error too when i try to delete a file