otherguy/docker-dropbox

/dbox "Permission Denied"

leighorf opened this issue · 1 comments

I did a docker system prune -a before running the following command:

docker run --detach --name=dropbox -e DROPBOX_UID=15321 -e DROPBOX_GID=700 --net="host" -v "/data1/orf/dropbox/.dropbox:/opt/dropbox/.dropbox" -v "/data1/orf/dropbox/Dropbox:/opt/dropbox/Dropbox" otherguy/dropbox:latest

It runs. The first time it did the chmod -R on the volume, which took a while. But:

orf: /home/lorf/build/git/docker-dropbox docker logs --follow dropbox
Checking for latest Dropbox version...
Latest : 86.4.146
Installed: 86.4.146
Dropbox is up-to-date
Starting dropboxd (86.4.146)...
dropbox: locating interpreter
!! dropbox: failed to create log file (Permission denied)!
dropbox: initializing
dropbox: initializing python 3.7.2
dropbox: setting program path '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/dropbox'
dropbox: setting home path '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146'
dropbox: setting python path '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146:/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/python-packages-37.zip'
dropbox: python initialized
dropbox: running dropbox
dropbox: setting args
dropbox: applying overrides
dropbox: running main script
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/cryptography.hazmat.bindings._constant_time.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/cryptography.hazmat.bindings._openssl.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/cryptography.hazmat.bindings._padding.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/psutil._psutil_linux.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/psutil._psutil_posix.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/linuxffi.pthread._linuxffi_pthread.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/cpuid.compiled._cpuid.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/apex._apex.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/tornado.speedups.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/linuxffi.resolv.compiled._linuxffi_resolv.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/librsyncffi.compiled._librsyncffi.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/linuxffi.sys.compiled._linuxffi_sys.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/posixffi.libc._posixffi_libc.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/linuxffi.gnu.compiled._linuxffi_gnu.cpython-37m-x86_64-linux-gnu.so'
Couldn't start Dropbox.
This is usually because of a permissions error. Storing your home folder on a network share can also cause an error.
Get more help at https://www.dropbox.com/c/help/permissions_error
Please contact Dropbox support with the following info for help:
/var/tmp/dropbox_error7q2bca0v.txt

Looking at the error file referenced above, which is inside the container:

root@orf:/opt/dropbox/Dropbox# cat /var/tmp/dropbox_error7q2bca0v.txt
bn.BUILD_KEY: Dropbox
bn.VERSION: 86.4.146
bn.DROPBOXEXT_VERSION: failed
bn.is_frozen: True
machine_id: 323f53b1-2cfc-5080-eee0-87bc3b9d77fd
pid: 48
ppid: 1
ppid exe: failed
uid: 15321
user_info: pwd.struct_passwd(pw_name='dropbox', pw_passwd='x', pw_uid=15321, pw_gid=700, pw_gecos='Dropbox Daemon Account', pw_dir='/opt/dropbox', pw_shell='/usr/sbin/nologin')
effective_user_info: pwd.struct_passwd(pw_name='dropbox', pw_passwd='x', pw_uid=15321, pw_gid=700, pw_gecos='Dropbox Daemon Account', pw_dir='/opt/dropbox', pw_shell='/usr/sbin/nologin')
euid: 15321
gid: 700
egid: 700
group_info: grp.struct_group(gr_name='dropbox', gr_passwd='x', gr_gid=700, gr_mem=[])
effective_group_info: grp.struct_group(gr_name='dropbox', gr_passwd='x', gr_gid=700, gr_mem=[])
LD_LIBRARY_PATH: None
cwd: '/opt/dropbox/Dropbox'
real_path='/opt/dropbox/Dropbox'
mode=0o40755 uid=15321 gid=700
parent mode=0o40755 uid=15321 gid=700
HOME: '/opt/dropbox'
appdata: '/dbox/.dropbox/instance1'
real_path='/dbox/.dropbox/instance1'
not found
parent not found
dropbox_path: '/dbox/Dropbox'
real_path='/dbox/Dropbox'
not found
parent not found
sys_executable: '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/dropbox'
real_path='/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/dropbox'
mode=0o100775 uid=15321 gid=700
parent mode=0o40775 uid=15321 gid=700
trace.file: '/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/python-packages-37.zip/dropbox/client/ui/common/boot_error.pyc'
real_path='/opt/dropbox/bin/dropbox-lnx.x86_64-86.4.146/python-packages-37.zip/dropbox/client/ui/common/boot_error.pyc'
not found
parent not found
tempdir: '/var/tmp'
real_path='/var/tmp'
mode=0o41777 uid=0 gid=0
parent mode=0o40755 uid=0 gid=0
Traceback (most recent call last):
File "dropbox/client/main.pyc", line 7880, in main_startup
File "dropbox/client/main.pyc", line 3212, in run
File "dropbox/client/main.pyc", line 1736, in startup_low
File "dropbox/client/main.pyc", line 1288, in safe_makedirs
File "os.pyc", line 211, in makedirs
File "os.pyc", line 211, in makedirs
File "os.pyc", line 221, in makedirs
PermissionError: [Errno 13] Permission denied: '/dbox'

What I find interesting is /dbox is the original mount point that janeczku created, which has been changed to /opt/dropbox with the otherguy container. Is /dbox hardwired into the dropbox binary? I kind of doubt it. Where could this "remnant" of the original dropbox distribution be? I can't find any reference to /dbox anywhere. But, in the error file, it's clearly trying to reference stuff in /dbox.

OK I found the problem! The /dbox reference was in the .dropbox/info.json file that was written by the janeczku distribution. I nuked the entire .dropbox directory and re-ran, and no longer received this error. The info.json file now contains the proper /opt/dropbox link.