cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Learn all about how Alex on the Community team used Dropbox in college here!

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: 

Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not started.

Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not started.

alex-masolin
Explorer | Level 4

Dear all,

I'm trying to install Dropbox on an headless Ubuntu installation. I've followed the description found here.

After running 

~/.dropbox-dist/dropboxd

the terminal shows

 

dropbox: locating interpreter
dropbox: logging to /tmp/dropbox-antifreeze-yYYmkt
dropbox: initializing
dropbox: initializing python 3.7.9
dropbox: setting program path '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/dropbox'
dropbox: setting python path '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458:/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/python-packages.zip'
dropbox: python initialized
dropbox: running dropbox
dropbox: setting args
dropbox: enabling allocator metrics
dropbox: applying overrides
dropbox: running main script
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/cryptography.hazmat.bindings._constant_time.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/cryptography.hazmat.bindings._openssl.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/cryptography.hazmat.bindings._padding.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/psutil._psutil_linux.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/psutil._psutil_posix.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/apex._apex.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/tornado.speedups.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/wrapt._wrappers.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/PyQt5.QtWidgets.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/PyQt5.QtCore.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/PyQt5.QtGui.cpython-37m-x86_64-linux-gnu.so'

 

then it hangs there.

After 10 minutes, I did a CTRL+C. No link was generated.

 

I then tried to download the Python script and run

python3 ./dropbox.py version

the terminal shows

 

Dropbox daemon version: 110.4.458
Dropbox command-line interface version: 2020.03.04

The command

python3 ./dropbox.py start

seems successful

Starting Dropbox...dropbox: locating interpreter
dropbox: logging to /tmp/dropbox-antifreeze-N7H6Il
dropbox: initializing
dropbox: initializing python 3.7.9
dropbox: setting program path '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/dropbox'
dropbox: setting python path '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458:/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/python-packages.zip'
dropbox: python initialized
dropbox: running dropbox
dropbox: setting args
dropbox: enabling allocator metrics
dropbox: applying overrides
dropbox: running main script
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/cryptography.hazmat.bindings._constant_time.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/cryptography.hazmat.bindings._openssl.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/cryptography.hazmat.bindings._padding.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/psutil._psutil_linux.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/psutil._psutil_posix.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/apex._apex.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/tornado.speedups.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/wrapt._wrappers.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/PyQt5.QtWidgets.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/PyQt5.QtCore.cpython-37m-x86_64-linux-gnu.so'
dropbox: load fq extension '/home/ubuntu/.dropbox-dist/dropbox-lnx.x86_64-110.4.458/PyQt5.QtGui.cpython-37m-x86_64-linux-gnu.so'
Done!

However

python3 ./dropbox.py status
Connecting...

and

Traceback (most recent call last):
  File "./dropbox.py", line 644, in __readline
    toret = self.f.readline().rstrip("\n")
  File "/usr/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./dropbox.py", line 1601, in <module>
    ret = main(sys.argv)
  File "./dropbox.py", line 1590, in main
    result = commands[argv[i]](argv[i+1:])
  File "./dropbox.py", line 741, in newmeth
    return meth(*n, **kw)
  File "./dropbox.py", line 1018, in filestatus
    status = dc.icon_overlay_file_status(path=fp).get('status', ['unknown'])[0]
  File "./dropbox.py", line 712, in __spec_command
    return self.send_command(str(name), kw)
  File "./dropbox.py", line 670, in send_command
    ok = self.__readline() == "ok"
  File "./dropbox.py", line 646, in __readline
    raise DropboxCommand.BadConnectionError()
__main__.BadConnectionError

I'm not surprise about the error BadConnection but I'm suprised that raises an exception.

A last check after the exception:

python3 ./dropbox.py status
Dropbox isn't responding!

Ideas on how to proceed?

Please note that dependencies seems fulfilled, the OS is just upgraded and is bascially brand new (i.e. instance just created). No antivirus, firewall or VPN/proxy.

Filesystem is ext4.

 

Thanks in advance.

Alex

 

 

 

8 Replies 8

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

Lusil
Dropboxer

Hi @alex-masolin, thanks for reaching out to us. 

 

Since you've already done some initial troubleshooting - great work by the way! - could you also try restarting your router and making sure that you have a consistent connection?

 

If you do meet the essential requirements mentioned here, could you clarify if you're running the OS in a server sort of setup?

 

Have a look and let me know what you find, cheers!


Lusil
Community Moderator @ Dropbox
dropbox.com/support


Heart Did this post help you? If so, please give it a Like below.
:arrows_counterclockwise: Still stuck? Ask me a question!
:pushpin: Tips & Tricks Find new ways to stay in flow or share your tips on how you work smarter with Dropbox.

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

alex-masolin
Explorer | Level 4

Dear Lusil,

the requirements are about the OS version and the filesystem: those are defintely fulfilled.

 

As written in the title, I'm running an EC2 instance on AWS.

And... well.... I can't really restart Amazon's router. Sorry for that :stuck_out_tongue_closed_eyes:

 

I'm running the instance as single user, following this guidelines, without any complex configuration.

 

Cheers,

Alex

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

Здравко
Super Collaborator | Level 20

@alex-masolin wrote:
...

And... well.... I can't really restart Amazon's router. Sorry for that :stuck_out_tongue_closed_eyes:

...

😯😮🙂😃😆

Hi @alex-masolin,

Yes, that's really funny!!! Some speculation of the forum moderators can't left you without some jokes (or might not so jokes). Anyway...

 

You haven't mentioned is your installation got in link with your account or not yet. It might be waiting for link! While the process you described, have you received a link that you used for link the installation? And have you completed this linkage? Just to make sure we are on "same page".

 


@alex-masolin wrote:
...

I'm running the instance as single user, following this guidelines, without any complex configuration.

...

What do you mean here??? Especially "without any complex configuration". Just a recall: Dropbox application is a client mode application and it will terminate at the moment session it work on terminate! You haven't mentioned explicitly, but I my impression is that you are trying run the daemon from the command login shell. Am I right? If so, your application will never run as you expected! Take a look on a previous discussion. You can take some ideas there (especially how to make the application behave as a service 😉). Not the best example, but a good start point.

 

PS: You can vote up my idea here, if you want. 🙂 If the idea gets accepted and delivered, future installs like yours and the maintenance will be much more easy.

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

alex-masolin
Explorer | Level 4

Hi @Здравко 

Thanks for your help. Indeed, the linked topic casted some light and I definitely upvoted your proposal!

"No complex configuration" means no antivirus, no firewall, no symlinks of any sort, no weird mounting points, no load balancer... a simple Ubuntu AMI and that's it.

 

The link generated by dropbox didn't show at first. However, I was able to get via 'dropbox -i start' (I think, I don't remember for sure).

At the end of many tests, including installing nautilus-dropbox with apt which failed, I was able to get a working machine:innocent:

As far as I can tell, the problem was due to:

  • headless installation of Dropbox is quite lousy and it is not resilient at all to errors. The python script should be upgraded.
  • the raised exception had the consquence of some incomplete configuration and I had to clean up the .dropbox folder a couple of times in between my tests
  • The major problem was the kick-in of OoO killer. My instance is a t3.nano (512MB RAM) with swap disabled (default), hence dropbox was killed by the OoO killer soon after or during start of the service and maybe even during installation/setup. A couple of commands to enable a swapfile and the problem is solved.

One curiosity: I fully understand that Dropbox is a client application. From your post in the other discussion, it looks that - once the SSH session is over - also the dropbox application (daemon, service, ...) should quit, isn't it? However, after I quit my SSH session, the dropbox daemon is still running and doing his job.

Cheers.

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

Здравко
Super Collaborator | Level 20

Hi @alex-masolin,

Yes, you are right; there are many imperfections (not to say bugs) both in the application (daemon) and the control script. The exception you have noticed comes from the control script, so the reason couldn't be incomplete configuration; it's just a timeout, that isn't appropriately provident (as many others similar timeouts - seems Dropbox developers allways assume that particular operation take almost constant time, which isn't true of course). The bad application design implies a lot of memory usage; just to run, more than 200MB memory gets engaged (without any file in control), so yes - in your configurastion without swap, problems are something usual.

 


@alex-masolin wrote:

...

One curiosity: I fully understand that Dropbox is a client application. From your post in the other discussion, it looks that - once the SSH session is over - also the dropbox application (daemon, service, ...) should quit, isn't it? However, after I quit my SSH session, the dropbox daemon is still running and doing his job.

...


Yes, you are right. Seems SSH session doesn't terminate demonized application, as opposite to classical login session, which terminate everything running inside on exit. But what about automation in running Dropbox application as a service, if for some reason you have to restart the VM? 🧐 Indeed, this question could have many right answers, but you should decide what's the best to yourself (according your system objectives).

Congratulation on solving your problem! 👍

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

alex-masolin
Explorer | Level 4

@Здравко 

I rebooted the VM and Dropbox daemon didn't restart, as you said.

Actually, even using "dropbox start -i" raise exception of libraries not found libxdamage libxxf86vm libxfixes and others... I had to install them manually and then Dropbox dameon was ok.

I'm VERY surprised that:

  • before reboot, the dropbox start didn't complain about libraries missing.
  • the missing libraries (dependencies) raise an exception... not even catched so the script continued till the end with a bunch of errors and timeouts.

As said before, the dropbox script seems made an intern student... :tired_face:

 

To tackle the issue of running Dropbox application as a service (and surviving reboot) I see two options:

  • daemonize Dropbox application with Systemd
  • install wathdog service and configure it to restart if Dropbox crash / doesn't run (via PID file option)

 

What do you think? Maybe both?

 

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

Здравко
Super Collaborator | Level 20

@alex-masolin wrote:

...

Actually, even using "dropbox start -i" raise exception of libraries not found libxdamage libxxf86vm libxfixes and others... I had to install them manually and then Dropbox dameon was ok.

I'm VERY surprised that:

  • before reboot, the dropbox start didn't complain about libraries missing.
  • the missing libraries (dependencies) raise an exception... not even catched so the script continued till the end with a bunch of errors and timeouts.

As said before, the dropbox script seems made an intern student... :tired_face:

...

Yes, there are lots of missing dependencies declarations. 😠 Throughout the forum could be seen many complaints related to this. I can't comment in details particular case, cause haven't seen the exact errors 🧐, but it's really strange on the same install one time run is Ok, on the next - missing libraries 🤔. Anyway... seems you have solved it. 👍

 


@alex-masolin wrote:

...

To tackle the issue of running Dropbox application as a service (and surviving reboot) I see two options:

  • daemonize Dropbox application with Systemd
  • install wathdog service and configure it to restart if Dropbox crash / doesn't run (via PID file option)
...

😃🙂 Seems you haven't "jump into deep" with 'systemd'. It's a very powerful tool, a service actually, designed to control other services. Different mode of work could be used, including behaving like a watchdog. 😉 So, no any additional tool is needed. In the discussion, referred above, I have mentioned "Might be pointed some imperfections in your service file", because of using a simple run mode, but it's neither the only nor the optimal option. I haven't discussed further cause the user is newbie. For further information you can take a look on the systemd service' man page:

man systemd.service

Pay attention on the section related to the pid file usage and the related. Some additional improvements could be made. The stop line in the service file:

ExecStop=/bin/kill -HUP $MAINPID

... will not work. Here the '$MAINPID' refers to the control script that have get out long ago at that moment. It's not a problem exist there. Would be much more intelligent and useful something like:

ExecStop=dropbox stop

... and simple. 😉 Isn't it? This isn't the only way, of course. Just a example, how could be made improvements, while reading carefully the documentation, both for Dropbox application and for systemd. Many other are possible too.

Go "jumping into the deep"!

 

PS: Some preferences are not accessible using command line only yet. I have an another proposal/idea - with negligible changes in Dropbox (might be performed with up to dozen lines in both daemon and control script together) full set of preferences be accessible using techincs provided in the referred discussion above, in addition to the exlaned in the idea itself. If you think would be useful, vote it up.

Re: Headless Ubuntu 20.04.1 LTS on AWS EC2 - Failed installation, Python exception, Daemon not st...

alex-masolin
Explorer | Level 4

Dear @Здравко 

by far I didn't went deep.

I refer to my own Linux skills as a tad more than basic. At the end of the day, I graduated in something different and also my core job is something else :innocent:

 

During Xmas holidays I'l have some time and I'll try to put togheter a systemd approach. I'll let you know if it will be sucessful.

BTW, the file .dropbox/dropbox.pid is actually hosting the correct PID value of the application. I do expect that, if dropbox application is crashing, the file contains a PID of a non-existent process. I feel that this might help in restarting the application...

 

Keep healthy!

 

 

Poll
Do you work or study in the creative industry? If so, which area?
If you use Adobe, don't forget to check out our latest integrations update here.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?