cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close

Dropbox installs & integrations

Connect your tools and content together with help from the Dropbox Community. Join a discussion or post a question of your own to get started.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Recent Updates Broke My Ubuntu Headless Client

Explorer | Level 3

I had my ubuntu server set up with headless dropbox client for many months running with no major issues using the following commands

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
~/.dropbox-dist/dropboxd
# link to account

sudo wget -O /usr/local/bin/dropbox "https://www.dropbox.com/download?dl=packages/dropbox.py"
sudo chmod +x /usr/local/bin/dropbox

# enable autostart
sudo wget -O /etc/systemd/system/dropbox.service "https://www.dropbox.com/s/************/dropbox.service.txt?dl=1"
sudo systemctl daemon-reload
sudo systemctl start dropbox
sudo systemctl enable dropbox
sudo systemctl status dropbox

The dropbox.service file contains: 

[Unit]
Description=Dropbox Service
After=network.target

[Service]
ExecStart=/bin/sh -c '/usr/local/bin/dropbox start'
ExecStop=/bin/sh -c '/usr/local/bin/dropbox stop'
PIDFile=${HOME}/.dropbox/dropbox.pid
User=oxdropper
Group=oxdropper
Type=forking
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

 

Today I noticed files had not synced for several hours so I Putty'd into my server to check what is going on. Dropbox seemed to be having issues starting. This would happen once every few months usually due to dropbox upgrading, which can usually fixed by deleting the existing .dropbox-dist folder and reinstalling from scratch using the above commands. So I did just that. However this time I got the following error everytime when I ran "dropbox status": 

oxdropper@server:~$ dropbox status
Traceback (most recent call last):
  File "/usr/local/bin/dropbox", line 1739, in <module>
    ret = main(sys.argv)
  File "/usr/local/bin/dropbox", line 1727, in main
    result = commands[argv[i]](argv[i + 1 )
  File "/usr/local/bin/dropbox", line 830, in newmeth
    return meth(*n, **kw)
  File "/usr/local/bin/dropbox", line 1333, in status
    lines = dc.get_dropbox_status()["status"]
  File "/usr/local/bin/dropbox", line 789, in __spec_command
    return self.send_command(str(name), kw)
  File "/usr/local/bin/dropbox", line 746, in send_command
    ok = self.__readline() == "ok"
  File "/usr/local/bin/dropbox", line 720, in __readline
    toret = self.f.readline().rstrip("\n")
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 27: ordinal not in range(12
oxdropper@server:~$

My best guess is one of the recent updates broke something and it no longer works. I have never programmed in python before. Can someone spot anyway I can fix this?

 

EDIT: it appears some files are actually still syncing but not all and I have no idea how to tell what is syncing vs what is not because status function is not working

3 Replies 3
Highlighted

Re: Recent Updates Broke My Ubuntu Headless Client

Super Collaborator | Level 20

Hi @oxdropper,

How old is your Ubuntu distribution? The default encoding for Ubuntu (and almost all Linux) distributions, actual present day, is UTF-8. Your error message shows that you have set ASCII encoding. What is the result from:

python3
>>> import locale
>>> locale.getpreferredencoding()

Tune the system settings or, better, upgrade your system using:

sudo apt-get update
sudo apt-get dist-upgrade

Your error is a script error and shouldn't affect application/daemon work in any way. Just communication between the control script and application could screw up.

Hope this gives the right direction.

Highlighted

Re: Recent Updates Broke My Ubuntu Headless Client

Explorer | Level 3

Thank you for your suggestions!

Initially my version showed the following:

Ubuntu 16.04 LTS (GNU/Linux 4.4.0-1062.4.2.vz7.116.7 x86_64)

>>> import locale
>>> locale.getpreferredencoding()
'ANSI_X3.4-1968'

I ran the upgrade commands you suggested.

 

Now it shows Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-1062.4.2.vz7.116.7 x86_64)

But encoding is still unchanged 'ANSI_X3.4-1968'.

The same error message still occurs.

Any further suggestions?

Highlighted

Re: Recent Updates Broke My Ubuntu Headless Client

Super Collaborator | Level 20

@oxdropper wrote:

...

I ran the upgrade commands you suggested.

Now it shows Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-1062.4.2.vz7.116.7 x86_64)

...

Hi @oxdropper,

That's really strange! Ubuntu Xenial (16.04.6 LTS) gets in its last year of support (i.e. almost outdated). Currently, the latest stable long term support version is Ubuntu Bionic (18.04.4 LTS) and soon the newest 20.04 LTS will comes up (currently in beta). In this context, seems something goes wrong in your upgrade process. Check more careful - are some errors happen, preventing proper upgrade or something like. I don't know what else to say about this upgrade fail. In the newer distributions UTF-8 comes prebuild in the "libc-bin" package. If you want to build and use new locale, take a look on 'locale' command documentation (the man page for example). You can check all available char maps here: /usr/share/i18n/charmaps and all available languages here: /usr/share/i18n/locales . You can build and setup any available combinations, but easiest way is, again, upgrade.

Something else is even more curious. The messages are supposed to be in user compatible locale and the first line have to be extremely short (just "ok\n" for any one real status and, also, not only status). So seems the communication really break and the script receives something which don't have to be. Might be useful the application to be relink on clear settings, so to be sure communication pipes aren't broken somehow. Quit/stop/kill the application and execute in sequence:

dropbox status
rm -rf ~/.dropbox ~/.dropbox-dist
dropbox start -i
dropbox status

After "start" subcommand, the application will ask you authenticate. The interesting here is: what's going on without a running application - the first command's result (incorrect symbols aren't possible - any symbols aren't possible) and the result which last command would produce. In addition make sure you haven't enabled "Early releases" here: https://www.dropbox.com/account If it is, turn it off in advance (before above commands)!

Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?