Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running etherpad-lite on nodejs 4.2.0 doesn't connect to Mysql #2803

Closed
MorrisJobke opened this issue Oct 13, 2015 · 12 comments
Closed

Running etherpad-lite on nodejs 4.2.0 doesn't connect to Mysql #2803

MorrisJobke opened this issue Oct 13, 2015 · 12 comments

Comments

@MorrisJobke
Copy link

$ sudo -u etherpad /usr/share/webapps/etherpad-lite/bin/run.sh -s /etc/webapps/etherpad-lite/settings.json
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.

> ws@0.5.0 install /usr/share/webapps/etherpad-lite/src/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Verzeichnis „/usr/share/webapps/etherpad-lite/src/node_modules/ws/build“ wird betreten
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:92: die Regel für Ziel „Release/obj.target/bufferutil/src/bufferutil.o“ scheiterte
make: Verzeichnis „/usr/share/webapps/etherpad-lite/src/node_modules/ws/build“ wird verlassen
npm WARN EPACKAGEJSON ep_etherpad-lite@1.5.7 No license field.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
[2015-10-13 09:21:50.895] [ERROR] console - ERROR: Problem while initalizing the database
[2015-10-13 09:21:50.898] [ERROR] console - Error: Handshake inactivity timeout
    at Handshake.<anonymous> (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/Protocol.js:154:17)
    at emitNone (events.js:67:13)
    at Handshake.emit (events.js:166:7)
    at Handshake._onTimeout (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/sequences/Sequence.js:116:8)
    at Timer.listOnTimeout (timers.js:92:15)
    --------------------
    at Protocol._enqueue (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/Protocol.js:135:48)
    at Protocol.handshake (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/Protocol.js:52:41)
    at Connection.connect (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/Connection.js:109:18)
    at Connection._implyConnect (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/Connection.js:387:10)
    at Connection.query (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/Connection.js:174:8)
    at exports.database.init (/usr/share/webapps/etherpad-lite/src/node_modules/ueberDB/mysql_db.js:74:6)
    at exports.database.init (/usr/share/webapps/etherpad-lite/src/node_modules/ueberDB/CacheAndBufferLayer.js:110:18)
    at exports.database.init (/usr/share/webapps/etherpad-lite/src/node_modules/ueberDB/CloneAndAtomicLayer.js:48:11)
    at Object.exports.init (/usr/share/webapps/etherpad-lite/src/node/db/DB.js:41:6)
    at /usr/share/webapps/etherpad-lite/src/node/server.js:62:8

I then downgraded to nodejs 0.12.7 and etherpad just starts fine.

cc @Gared

This could also be very likely a nodejs problem, but I'm unsure where and how to report this.

@Gared I add you, because you added the switch: Gared@bf7930f - I also admit that I used a 1.5.7 and only applied your patch. Maybe this couldn't work, but on ther other side I also couldn't find big changes between 1.5.7 and the current HEAD: 8359756...develop#diff-5d2aa4336c4964b828a123e20e09b73c

Feel free to simply close this, if I just did it the wrong way.

@dvzrv
Copy link

dvzrv commented Oct 13, 2015

You have this problem because of a configuration problem. Add
"socketPath": "/var/run/mysqld/mysqld.sock"
to your "dbSettings" and all should be fine.

This needs to be added to the default configuration file shipped with etherpad-lite!

@MorrisJobke
Copy link
Author

I just tested it. Doesn't work either.

https://github.com/Pita/ueberDB/wiki/MySQL-Sockets

I also couldn't find socketPath in the code:
https://github.com/Pita/ueberDB/search?utf8=%E2%9C%93&q=socketPath
https://github.com/ether/etherpad-lite/search?utf8=%E2%9C%93&q=socketPath

I used "port" to specify the socket, as it is written in the documentation. Or is the documentation out of date? 🙈

@dvzrv
Copy link

dvzrv commented Oct 13, 2015

@MorrisJobke can you post your current output of etherpad-lite, when running with the above mentioned settings?

Just asking, because I suspect something else here, as we seem to be running the same software, but for me it's working!

@MorrisJobke
Copy link
Author

This is the output for nodejs 0.12.x:

$ sudo -u etherpad /usr/share/webapps/etherpad-lite/bin/run.sh -s /etc/webapps/etherpad-lite/settings.json
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.

> ws@0.5.0 install /usr/share/webapps/etherpad-lite/src/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Verzeichnis „/usr/share/webapps/etherpad-lite/src/node_modules/ws/build“ wird betreten
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Verzeichnis „/usr/share/webapps/etherpad-lite/src/node_modules/ws/build“ wird verlassen
npm WARN EPACKAGEJSON ep_etherpad-lite@1.5.7 No license field.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
[2015-10-13 13:18:49.275] [WARN] pluginfw - /usr/share/webapps/etherpad-lite/node_modules/ep_etherpad-lite/node_modules/has-cors requires global@'https://github.com/component/global/archive/v2.0.1.tar.gz' but will load
/usr/share/webapps/etherpad-lite/node_modules/ep_etherpad-lite/node_modules/global,
which is version 2.0.1 unmet dependency
[2015-10-13 13:18:49.281] [WARN] pluginfw - /usr/share/webapps/etherpad-lite/node_modules/ep_etherpad-lite/node_modules/engine.io-client requires xmlhttprequest@'https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz' but will load
/usr/share/webapps/etherpad-lite/node_modules/ep_etherpad-lite/node_modules/xmlhttprequest,
which is version 1.5.0 unmet dependency
[2015-10-13 13:18:49.926] [INFO] console - Installed plugins: ep_tasklist@0.0.11, ep_adminpads@0.0.9
[2015-10-13 13:18:49.949] [INFO] console - Report bugs at https://github.com/ether/etherpad-lite/issues
[2015-10-13 13:18:49.949] [WARN] console - Can't get git version for server header
ENOENT, no such file or directory '/usr/share/webapps/etherpad-lite/.git/HEAD'
[2015-10-13 13:18:49.951] [WARN] console - Can't get git version for server header
ENOENT, no such file or directory '/usr/share/webapps/etherpad-lite/.git/HEAD'
[2015-10-13 13:18:49.951] [INFO] console - Your Etherpad version is 1.5.7 ()
[2015-10-13 13:18:50.076] [INFO] console - You can access your Etherpad instance at http://127.0.0.1:9001/
[2015-10-13 13:18:50.076] [INFO] console - The plugin admin page is at http://127.0.0.1:9001/admin/plugins

And this is the output for nodejs 4.2.0

$ sudo -u etherpad /usr/share/webapps/etherpad-lite/bin/run.sh -s /etc/webapps/etherpad-lite/settings.json
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.

> ws@0.5.0 install /usr/share/webapps/etherpad-lite/src/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Verzeichnis „/usr/share/webapps/etherpad-lite/src/node_modules/ws/build“ wird betreten
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:92: die Regel für Ziel „Release/obj.target/bufferutil/src/bufferutil.o“ scheiterte
make: Verzeichnis „/usr/share/webapps/etherpad-lite/src/node_modules/ws/build“ wird verlassen
npm WARN EPACKAGEJSON ep_etherpad-lite@1.5.7 No license field.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
[2015-10-13 13:19:46.772] [ERROR] console - ERROR: Problem while initalizing the database
[2015-10-13 13:19:46.775] [ERROR] console - Error: Handshake inactivity timeout
    at Handshake.<anonymous> (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/Protocol.js:154:17)
    at emitNone (events.js:67:13)
    at Handshake.emit (events.js:166:7)
    at Handshake._onTimeout (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/sequences/Sequence.js:116:8)
    at Timer.listOnTimeout (timers.js:92:15)
    --------------------
    at Protocol._enqueue (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/Protocol.js:135:48)
    at Protocol.handshake (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/protocol/Protocol.js:52:41)
    at Connection.connect (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/Connection.js:109:18)
    at Connection._implyConnect (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/Connection.js:387:10)
    at Connection.query (/usr/share/webapps/etherpad-lite/src/node_modules/mysql/lib/Connection.js:174:8)
    at exports.database.init (/usr/share/webapps/etherpad-lite/src/node_modules/ueberDB/mysql_db.js:74:6)
    at exports.database.init (/usr/share/webapps/etherpad-lite/src/node_modules/ueberDB/CacheAndBufferLayer.js:110:18)
    at exports.database.init (/usr/share/webapps/etherpad-lite/src/node_modules/ueberDB/CloneAndAtomicLayer.js:48:11)
    at Object.exports.init (/usr/share/webapps/etherpad-lite/src/node/db/DB.js:41:6)
    at /usr/share/webapps/etherpad-lite/src/node/server.js:62:8

Also connecting to the socket works:

$ mysql -u etherpad -p etherpad-lite -S /var/run/mysqld/mysqld.sock
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6878
Server version: 10.0.21-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [etherpad-lite]>

I just noticed following line during the startup:

bufferutil.target.mk:92: die Regel für Ziel „Release/obj.target/bufferutil/src/bufferutil.o“ scheiterte

This means something like "the rule for targe 'Release/obj.target/bufferutil/src/bufferutil.o' failed". I think that this is the problem.

@dvzrv
Copy link

dvzrv commented Oct 13, 2015

Ha! still on nodejs 4.1.2 here!
Maybe it's a nodejs > 4.2 issue then.

@MorrisJobke
Copy link
Author

Ha! still on nodejs 4.1.2 here!
Maybe it's a nodejs > 4.2 issue then.

Let me check that.

@MorrisJobke
Copy link
Author

Yes. Works just fine with 4.1.2. I used a version from the Arch Rollback Machine: http://seblu.net/a/arm/packages/n/nodejs/

\o/

@webzwo0i
Copy link
Member

thanks for testing!
bisect reveals nodejs/node#3143

@webzwo0i
Copy link
Member

v4.2.1 is out and should fix this. please reopen the issue if the bug remains/reoccurs.

@webzwo0i
Copy link
Member

upstream fix nodejs/node@c245a199a7

@MorrisJobke
Copy link
Author

Just upgraded to 4.2.1 and it works 👍 Thanks :)

@Gared
Copy link
Member

Gared commented Oct 14, 2015

@webzwo0i Thanks for the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants