OpenBazaar / OpenBazaar-Server

(Deprecated) OpenBazaar 1.0 Server daemon for communication with OpenBazaar-Client
MIT License
609 stars 175 forks source link

The server takes ~20 minutes to start #534

Open bladedoyle opened 7 years ago

bladedoyle commented 7 years ago

Brief Description:

The server requires about 20 minutes to fully start. In the meantime, the client can connect to it, but can not get past "step 1: choose a language". It certainly isnt obvious that one should wait 20 minutes before starting to use the client.

Operating System (OS and version): linux OpenBazaar version: master Hardware: intel

Reproducible (Always / Almost Always / Sometimes / Rarely / Couldn't Reproduce): always

Steps to reproduce:

  1. start the server
  2. start the client
  3. The client will connect to the localhost server and present the step 1 - language menu
  4. The problem is that after selecting my language and clicking "next", nothing happens.
  5. wait ~20 minutes for the server to report several errors (see below) before it finally starts up

Observed Behavior: The problem is that while the server is starting the client is stuck on step1 selecting my language - clicking "next", nothing happens. There is no indication that the server is not yet initialized.

Expected Behavior:

At a minimum, the client should indicate that the server is still starting up.

Additional info (links, images, etc go here):

root@463fc6ac9e28:/ob/OpenBazaar-Server# python openbazaard.py start   
________                      __________
\_____  \ ______   ____   ____\______   \_____  _____________  _____ _______
 /   |   \\____ \_/ __ \ /    \|    |  _/\__  \ \___   /\__  \ \__  \\_  __ \ 
/    |    \  |_> >  ___/|   |  \    |   \ / __ \_/    /  / __ \_/ __ \|  | \/
\_______  /   __/ \___  >___|  /______  /(____  /_____ \(____  (____  /__|
        \/|__|        \/     \/       \/      \/      \/     \/     \/

OpenBazaar Server 0.2.6 starting...
2017-07-22 18:15:40+0000 [Server] [WARNING] no known neighbors, so not writing to cache.
Unhandled error in Deferred:
2017-07-22 18:30:30+0000 [-] Unhandled error in Deferred:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/base.py", line 1194, in run
    self.mainLoop()
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/base.py", line 1203, in mainLoop
    self.runUntilCurrent()
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/base.py", line 825, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/task.py", line 239, in __call__
    d = defer.maybeDeferred(self.f, *self.a, **self.kw)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
    result = f(*args, **kw)
  File "/ob/OpenBazaar-Server/api/restapi.py", line 78, in _keep_sessions_alive
    session.touch()
exceptions.AttributeError: 'str' object has no attribute 'touch'
2017-07-22 18:30:30+0000 [-] Unhandled Error
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/twisted/internet/base.py", line 1194, in run
        self.mainLoop()
      File "/usr/local/lib/python2.7/dist-packages/twisted/internet/base.py", line 1203, in mainLoop
        self.runUntilCurrent()
      File "/usr/local/lib/python2.7/dist-packages/twisted/internet/base.py", line 825, in runUntilCurrent
        call.func(*call.args, **call.kw)
      File "/usr/local/lib/python2.7/dist-packages/twisted/internet/task.py", line 239, in __call__
        d = defer.maybeDeferred(self.f, *self.a, **self.kw)
    --- <exception caught here> ---
      File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
        result = f(*args, **kw)
      File "/ob/OpenBazaar-Server/api/restapi.py", line 78, in _keep_sessions_alive
        session.touch()
    exceptions.AttributeError: 'str' object has no attribute 'touch'

2017-07-22 18:42:11+0000 [MarketProtocol] [WARNING] could not find any listings in the database
hoffmabc commented 7 years ago

What type of machine are you running this on? Specs?

bladedoyle commented 7 years ago

Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz I dont think it was cpu-bound. I didnt see any significant cpu, disk or network i/o.

Today I have better results. The time from starting the server and client to when the client is able to move to the second welcome page is much faster - just a few minutes. Still, I think a "please wait, server is connecting to the network" message would help a lot.