Setup Failed: Could not start up: Error in setup

Maybe this is the error if you open a web console [Solved] Setup failed >> Could not start up: Error in setup - #5 by dominik

@golfergamer, does closing the message dialog and clicking on Retry not work either??

Hey @clarkej I’ve seen that post already and it’s a similar issue but the error isn’t exactly the same.

This is what I get on the console:
Failed to load resource: the server responded with a status of 504 (Gateway Time-out)
desk.min.js?ver=1525892012.0:1548 POST http://localhost/ 504 (Gateway Time-out)

If I look at the web.error.log I see an error that looks like it’s related to thread safety of pymysql:

[2018-05-12 23:24:05 +0000] [727] [CRITICAL] WORKER TIMEOUT (pid:830)
[2018-05-12 23:24:05 +0000] [830] [ERROR] Error handling request /
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py”, line 135, in handle
self.handle_request(listener, req, client, addr)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py”, line 176, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/local.py”, line 228, in application
return ClosingIterator(app(environ, start_response), self.cleanup)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py”, line 308, in application
resp = f(*args[:-2] + (request,))
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 95, in application
frappe.db.rollback()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 768, in rollback
self.sql(“rollback”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 176, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 893, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1103, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1396, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1046, in _read_packet
% (packet_number, self._next_seq_id))
InternalError: Packet sequence number wrong - got 35 expected 1

No this does not work either. I’ve tried this install twice and neither works.

Hi, I’m new to ERPnext and I’ve just installed frappe and erpnext in my Linux.

After the installation, run the bench start, login as Admin, and filing the form until the organization section, then I get the same error message.
Below is the image before the error occurs:

error1

The retry does not help at all.
I cannot see any error messages on the console.

Update: after leaving my laptop and back again several minutes, the error message is gone and I see the main dashboard.
Looking to the console, there was a 15 minutes gap, then I saw some errors on the console:

16:19:22 web.1            |  * Restarting with inotify reloader
16:19:23 web.1            |  * Debugger is active!
16:19:23 web.1            |  * Debugger PIN: 302-015-712
--- idle ---
16:34:42 web.1            | 127.0.0.1 - - [31/May/2018 16:34:42] "POST / HTTP/1.1" 200 -
16:34:45 web.1            | 127.0.0.1 - - [31/May/2018 16:34:45] "GET /robots.txt HTTP/1.1" 200 -
16:34:46 web.1            | 127.0.0.1 - - [31/May/2018 16:34:46] "GET /api/method/frappe.async.get_user_info?sid=2d7227b05c9a7a4ed19354dfe1a53d6369e60a8088c08c1d8f3bb927 HTTP/1.1" 200 -
16:34:54 web.1            | 127.0.0.1 - - [31/May/2018 16:34:54] "GET /desk HTTP/1.1" 200 -
16:34:54 web.1            | 127.0.0.1 - - [31/May/2018 16:34:54] "GET /assets/js/control.min.js?ver=1527773796.0 HTTP/1.1" 200 -
16:34:54 web.1            | 127.0.0.1 - - [31/May/2018 16:34:54] "GET /assets/js/report.min.js?ver=1527773796.0 HTTP/1.1" 200 -
16:34:54 web.1            | Error on request:
16:34:54 web.1            | Traceback (most recent call last):
16:34:54 web.1            |   File "/home/yyy/frappe-bench/env/lib/python2.7/site-packages/werkzeug/serving.py", line 270, in run_wsgi
16:34:54 web.1            |     execute(self.server.app)
16:34:54 web.1            |   File "/home/yyy/frappe-bench/env/lib/python2.7/site-packages/werkzeug/serving.py", line 261, in execute
16:34:54 web.1            |     write(data)
16:34:54 web.1            |   File "/home/yyy/frappe-bench/env/lib/python2.7/site-packages/werkzeug/serving.py", line 227, in write
16:34:54 web.1            |     self.send_header(key, value)
16:34:54 web.1            |   File "/usr/lib/python2.7/BaseHTTPServer.py", line 412, in send_header
16:34:54 web.1            |     self.wfile.write("%s: %s\r\n" % (keyword, value))
16:34:54 web.1            | IOError: [Errno 32] Broken pipe
...
16:34:57 web.1            | ----------------------------------------
16:34:57 web.1            | Exception happened during processing of request from ('127.0.0.1', 37792)
16:34:57 web.1            | Unhandled exception in thread started by <bound method Thread.__bootstrap of <Thread(Thread-31, stopped daemon 139775498512128)>>
16:34:57 web.1            | Traceback (most recent call last):
16:34:57 web.1            |   File "/usr/lib/python2.7/threading.py", line 774, in __bootstrap
16:34:57 web.1            |     ----------------------------------------
16:34:57 web.1            | Exception happened during processing of request from ('127.0.0.1', 37762)
16:34:57 web.1            | Unhandled exception in thread started by <bound method Thread.__bootstrap of <Thread(Thread-28, stopped daemon 139776036411136)>>
16:34:57 web.1            | Traceback (most recent call last):
16:34:57 web.1            |   File "/usr/lib/python2.7/threading.py", line 774, in __bootstrap
16:34:57 web.1            |     self.__bootstrap_inner()
16:34:57 web.1            |   File "/usr/lib/python2.7/threading.py", line 814, in __bootstrap_inner
16:34:57 web.1            |     (self.name, _format_exc()))
16:34:57 web.1            |   File "/usr/lib/python2.7/traceback.py", line 241, in format_exc
16:34:57 web.1            |     etype, value, tb = sys.exc_info()
16:34:57 web.1            | AttributeError: 'NoneType' object has no attribute 'exc_info'

hi
only this and no extra errors
Setup failed >> Could not start up: Error in setup
… retry … retry …retry … until it works

4 Likes

bench --site site1.local reinstall

I had the same issue - new installation of bench, frappe(develop) and erpnext(develop), running in development. Tried bench --site site1.local reinstall, no difference. Nothing unusual in the bench terminal output.
Tried going back in the options and changing language from ‘English (United Kingdom)’ to ‘English’ - success first time. Possibly a coincidence, possibly not? I did also run ‘bench config http_timeout 6000’ though.

1 Like

I kept clicking retry until it worked. this was exactly what worked for me eventually.

Clicked retry 3 times until it worked

1 Like

This was my experience too… It wasn’t working until it was. Very confusing! Definitely more than 3 times clicking retry for me. But now it is up and we are evaluating it to see if we want to switch (from Odoo 9)!

Will you share your feedback after evaluation?

I think it’s because the werkzeug WSGI server reloaded when the python source code altered/updated hence the existing http connection will close too (broken pipe). The benefit of autoreload is we don’t have to restart the server/bench when we update the python source code.

Same for me, it wasn’t working and I just kept clicking retry button until it finally did.

for me, worked after 4 times retrying

@golfergamer retry until it works i have done it 5 times retry

Observed the same issue in a vanilla Debian 9 / Python 3 / ERPNext V12 --develop instance.

Had applied Setup Wizard: Could not start up: Error in setup - #2 by lasalesi

And then basically just clicked retry - retry - retry - retry (4x) then a background worker error came up but it went through…

why do we need to retry. Is there any technical explanation to this somewhere?

cd frappe-bench
bench switch-to-branch master
bench update --patch

This solved the issue for me without multiple tries