Too many connections errors after clean install - production

Hi,

I’m trying to get the install.py script to work.

The install script itself runs fine all the way.

sudo apt-get install ca-certificates
sudo apt-get install python
wget the file
sudo python install.py?token=AUPUrCGGMOdiq_UAP8oKA8bhA4FezDoiks5ZKDq4wA%3D%3D --production

When I want to go to my setup page, I see nothing.
So I reset the frappe user pw (I can’t find it anywhere, and there is no question during install where he asks for this pw)
I login as the frappe user and run:

sudo supervisorctl stop all
bench start

Then comes the following:

Lots and lots of this:

12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -
12:42:06 web.1            | 10.225.1.84 - - [22/May/2017 12:42:06] "GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1" 200 -

Then after a while it becomes an error like the following (not all exactly the same, but the idea is): Too many connections.

12:42:26 socketio.1       | { Error: Internal Server Error
12:42:26 socketio.1       |     at Request.callback (/home/frappe/frappe-bench/node_modules/superagent/lib/node/index.js:675:11)
12:42:26 socketio.1       |     at IncomingMessage.<anonymous> (/home/frappe/frappe-bench/node_modules/superagent/lib/node/index.js:883:18)
12:42:26 socketio.1       |     at emitNone (events.js:91:20)
12:42:26 socketio.1       |     at IncomingMessage.emit (events.js:185:7)
12:42:26 socketio.1       |     at endReadableNT (_stream_readable.js:974:12)
12:42:26 socketio.1       |     at _combinedTickCallback (internal/process/next_tick.js:80:11)
12:42:26 socketio.1       |     at process._tickCallback (internal/process/next_tick.js:104:9)
12:42:26 socketio.1       |   status: 500,
12:42:26 socketio.1       |   response:
12:42:26 socketio.1       |    Response {
12:42:26 socketio.1       |      domain: null,
12:42:26 socketio.1       |      _events: {},
12:42:26 socketio.1       |      _eventsCount: 0,
12:42:26 socketio.1       |      _maxListeners: undefined,
12:42:26 socketio.1       |      res:
12:42:26 socketio.1       |       IncomingMessage {
12:42:26 socketio.1       |         _readableState: [Object],
12:42:26 socketio.1       |         readable: false,
12:42:26 socketio.1       |         domain: null,
12:42:26 socketio.1       |         _events: [Object],
12:42:26 socketio.1       |         _eventsCount: 4,
12:42:26 socketio.1       |         _maxListeners: undefined,
12:42:26 socketio.1       |         socket: [Object],
12:42:26 socketio.1       |         connection: [Object],
12:42:26 socketio.1       |         httpVersionMajor: 1,
12:42:26 socketio.1       |         httpVersionMinor: 0,
12:42:26 socketio.1       |         httpVersion: '1.0',
12:42:26 socketio.1       |         complete: true,
12:42:26 socketio.1       |         headers: [Object],
12:42:26 socketio.1       |         rawHeaders: [Object],
12:42:26 socketio.1       |         trailers: {},
12:42:26 socketio.1       |         rawTrailers: [],
12:42:26 socketio.1       |         upgrade: false,
12:42:26 socketio.1       |         url: '',
12:42:26 socketio.1       |         method: null,
12:42:26 socketio.1       |         statusCode: 500,
12:42:26 socketio.1       |         statusMessage: 'INTERNAL SERVER ERROR',
12:42:26 socketio.1       |         client: [Object],
12:42:26 socketio.1       |         _consuming: true,
12:42:26 socketio.1       |         _dumped: false,
12:42:26 socketio.1       |         req: [Object],
12:42:26 socketio.1       |         text: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\n  "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n  <head>\n    	<title>OperationalError: (1040, \'T    oo many connections\') // Werkzeug Debugger</title>\n    <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css"\n        	type="text/css">\n    <!-- We need to make sure this has a f    avicon so that the debugger does\n         not by accident trigger a request to /favicon.ico which might\n         change the 	application state. -->\n    <link rel="shortcut icon"\n        href="?__debugger_    _=yes&amp;cmd=resource&amp;f=console.png">\n    <scr

.... There is like a complete webpage code here ....

 File "/home/frappe/frappe-bench/a    pps/frappe/frappe/website/context.py", line 72, in build_context\n    context.update(get_website_settings())\n  File "/home/frappe/frappe-	bench/apps/frappe/frappe/website/doctype/website_settings/website_set    tings.py", line 74, in get_website_settings\n    \'top_bar_items\': get_items(\'top_bar_items\'),\n  File 	"/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py",     line 130, in get_items\n    order by idx asc""", parentfield, as_dict=1)\n  File 	"/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 107, in sql\n    self.connect()\n  File "/home/frappe/frappe-    bench/apps/frappe/frappe/database.py", line 53, in connect\n    	use_unicode=True, charset=\'utf8mb4\')\n  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Con    nect\n    return Connection(*args, **kwargs)\n 	 File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/connections.py", line 193, in __init__\n    super(Connection, self).__init__(*args, **k    wargs2)\nOperationalError: 	(1040, \'Too many connections\')\n\n-->\n',
12:42:26 socketio.1       |         read: [Function] },
12:42:26 socketio.1       |      request:
12:42:26 socketio.1       |       Request {
12:42:26 socketio.1       |         domain: null,
12:42:26 socketio.1       |         _events: {},
12:42:26 socketio.1       |         _eventsCount: 0,
12:42:26 socketio.1       |         _maxListeners: undefined,
12:42:26 socketio.1       |         _agent: false,
12:42:26 socketio.1       |         _formData: null,
12:42:26 socketio.1       |         method: 'GET',
12:42:26 socketio.1       |         url: 'http://10.225.1.84:8000/api/method/frappe.async.get_user_info',
12:42:26 socketio.1       |         _header: [Object],
12:42:26 socketio.1       |         header: [Object],
12:42:26 socketio.1       |         writable: true,
12:42:26 socketio.1       |         _redirects: 0,
12:42:26 socketio.1       |         _maxRedirects: 5,
12:42:26 socketio.1       |         cookies: '',
12:42:26 socketio.1       |         qs: [Object],
12:42:26 socketio.1       |         qsRaw: [],
12:42:26 socketio.1       |         _redirectList: [],
12:42:26 socketio.1       |         _streamRequest: false,
12:42:26 socketio.1       |         req: [Object],
12:42:26 socketio.1       |         protocol: 'http:',
12:42:26 socketio.1       |         host: '10.225.1.84:8000',
12:42:26 socketio.1       |         _endCalled: true,
12:42:26 socketio.1       |         _callback: [Function],
12:42:26 socketio.1       |         res: [Object],
12:42:26 socketio.1       |         response: [Circular],
12:42:26 socketio.1       |         called: true },
12:42:26 socketio.1       |      req:
12:42:26 socketio.1       |       ClientRequest {
12:42:26 socketio.1       |         domain: null,
12:42:26 socketio.1       |         _events: [Object],
12:42:26 socketio.1       |         _eventsCount: 3,
12:42:26 socketio.1       |         _maxListeners: undefined,
12:42:26 socketio.1       |         output: [],
12:42:26 socketio.1       |         outputEncodings: [],
12:42:26 socketio.1       |         outputCallbacks: [],
12:42:26 socketio.1       |         outputSize: 0,
12:42:26 socketio.1       |         writable: true,
12:42:26 socketio.1       |         _last: true,
12:42:26 socketio.1       |         upgrading: false,
12:42:26 socketio.1       |         chunkedEncoding: false,
12:42:26 socketio.1       |         shouldKeepAlive: false,
12:42:26 socketio.1       |         useChunkedEncodingByDefault: false,
12:42:26 socketio.1       |         sendDate: false,
12:42:26 socketio.1       |         _removedHeader: {},
12:42:26 socketio.1       |         _contentLength: 0,
12:42:26 socketio.1       |         _hasBody: true,
12:42:26 socketio.1       |         _trailer: '',
12:42:26 socketio.1       |         finished: true,
12:42:26 socketio.1       |         _headerSent: true,
12:42:26 socketio.1       |         socket: [Object],
12:42:26 socketio.1       |         connection: [Object],
12:42:26 socketio.1       |         _header: 'GET /api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2 HTTP/1.1\r\nHost: 10.225.1.84:8000\r	\nAccept-Encoding: gz    ip, deflate\r\nUser-Agent: node-superagent/3.5.2\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: close\r\n\r\n',
12:42:26 socketio.1       |         _headers: [Object],
12:42:26 socketio.1       |         _headerNames: [Object],
12:42:26 socketio.1       |         _onPendingData: null,
12:42:26 socketio.1       |         agent: [Object],
12:42:26 socketio.1       |         socketPath: undefined,
12:42:26 socketio.1       |         timeout: undefined,
12:42:26 socketio.1       |         method: 'GET',
12:42:26 socketio.1       |         path: '/api/method/frappe.async.get_user_info?sid=3e897ee0329b604672e858fca4556d3943de1137dd7a5fbd7192aca2',
12:42:26 socketio.1       |         _ended: true,
12:42:26 socketio.1       |         parser: null,
12:42:26 socketio.1       |         res: [Object] },
12:42:26 socketio.1       |      text: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\n  "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n  <head>\n    <title>OperationalError: 	(1040, \'Too     many connections\') // Werkzeug Debugger</title>\n    <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resou

And then it goes with a whole lot of the following errors:

12:42:26 socketio.1       | { Error: read ECONNRESET
12:42:26 socketio.1       |     at exports._errnoException (util.js:1018:11)
12:42:26 socketio.1       |     at TCP.onread (net.js:568:26)
12:42:26 socketio.1       |   code: 'ECONNRESET',
12:42:26 socketio.1       |   errno: 'ECONNRESET',
12:42:26 socketio.1       |   syscall: 'read',
12:42:26 socketio.1       |   response: undefined }

After a while this process just kills itself and stops.

Who know what might go wrong here and can help me?

This is pretty strange. Can you clear your browser cache and load again?

Hi @rmehta,

  • I did that and it still gave me the same errors.
  • I did reinstallations.
  • Even on 2 different systems.
    All giving me the same errors.

This was an issue a couple of weeks ago when socketio 2 was released, should have been fixed.

Thanks, we updated our repo and it is fixed indeed.

what i need update?
Frappe or erpnext?