YunoHost-Apps / etherpad_mypads_ynh

Etherpad MyPads package for YunoHost
http://etherpad.org/
GNU General Public License v3.0
16 stars 13 forks source link

Yesterday's update makes Etherpad restart every few seconds #172

Closed tio-trom closed 2 years ago

tio-trom commented 2 years ago

This is the log https://paste.yunohost.org/yaxiwoziwo - it restarts so often that you can never use it.

b01xy commented 2 years ago

I confirm the problem

ericgaspar commented 2 years ago

Can you share logs?

b01xy commented 2 years ago

Yes,

[2022-07-19 17:07:12.424] [INFO] plugins - npm --version: 6.14.15
[2022-07-19 17:07:17.342] [ERROR] server - Something that should have been cleaned up during the shutdown hook (such as a timer, worker thread, or open connection) is preventing Node.js from exiting
[2022-07-19 17:07:17.343] [ERROR] server - Enable `dumpOnUncleanExit` setting to get a dump of objects preventing a clean exit
[2022-07-19 17:07:17.343] [ERROR] server - Forcing an unclean exit...
[2022-07-19 17:07:17.624] [INFO] settings - All relative paths will be interpreted relative to the identified Etherpad base dir: /var/www/etherpad_mypads
[2022-07-19 17:07:17.633] [INFO] settings - settings loaded from: /var/www/etherpad_mypads/settings.json
[2022-07-19 17:07:17.633] [INFO] settings - credentials loaded from: /var/www/etherpad_mypads/credentials.json
[2022-07-19 17:07:17.634] [INFO] settings - Using skin "colibris" in dir: /var/www/etherpad_mypads/src/static/skins/colibris
[2022-07-19 17:07:17.634] [INFO] settings - Session key loaded from: /var/www/etherpad_mypads/SESSIONKEY.txt
[2022-07-19 17:07:17.634] [INFO] settings - Random string used for versioning assets: a0e18630
[2022-07-19 17:07:17.766] [INFO] server - Starting Etherpad...
[2022-07-19 17:07:17.812] [ERROR] ueberDB - Database is not configured with charset utf8mb4 -- This may lead to crashes when certain characters are pasted in pads
[2022-07-19 17:07:17.812] [ERROR] server - Error occurred while starting Etherpad
[2022-07-19 17:07:17.812] [ERROR] server - Metrics at time of fatal error:
{
  "httpStartTime": 0,
  "memoryUsage": 64475136,
  "memoryUsageHeap": 11498096
}
[2022-07-19 17:07:17.812] [ERROR] server - TypeError: Cannot read property 'level' of undefined
    at Level.isLessThanOrEqualTo (/var/www/etherpad_mypads/src/node_modules/log4js/lib/levels.js:37:35)
    at Logger.isLevelEnabled (/var/www/etherpad_mypads/src/node_modules/log4js/lib/logger.js:66:21)
    at Logger.log (/var/www/etherpad_mypads/src/node_modules/log4js/lib/logger.js:54:13)
    at exports.Database.init (/var/www/etherpad_mypads/src/node_modules/ueberdb2/databases/mysql_db.js:78:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async exports.Database.init (/var/www/etherpad_mypads/src/node_modules/ueberdb2/lib/CacheAndBufferLayer.js:284:5)
    at async Object.exports.init (/var/www/etherpad_mypads/src/node/db/DB.js:41:3)
    at async Object.exports.start (/var/www/etherpad_mypads/src/node/server.js:142:5)
[2022-07-19 17:07:17.812] [INFO] server - Exiting...
[2022-07-19 17:07:17.812] [INFO] server - Waiting for Node.js to exit...
[2022-07-19 17:07:17.871] [INFO] plugins - npm --version: 6.14.15
b01xy commented 2 years ago

A work around is to uninstall the application an restore the previous version via the backup made before the update

tio-trom commented 2 years ago

A work around is to uninstall the application an restore the previous version via the backup made before the update

Yes that's what I did but is of course not a solution for this update :) - we need to figure what went wrong.

MayeulC commented 2 years ago

Same issue here.

[2022-07-19 18:00:23.063] [ERROR] server - Something that should have been cleaned up during the shutdown hook (such as a timer, worker thread, or open connection) is preventing Node.js from exiting
[2022-07-19 18:00:23.063] [ERROR] server - Enable `dumpOnUncleanExit` setting to get a dump of objects preventing a clean exit
[2022-07-19 18:00:23.064] [ERROR] server - Forcing an unclean exit...

[2022-07-19 18:00:23.438] [INFO] settings - All relative paths will be interpreted relative to the identified Etherpad base dir: /var/www/etherpad_mypads
[2022-07-19 18:00:23.461] [INFO] settings - settings loaded from: /var/www/etherpad_mypads/settings.json
[2022-07-19 18:00:23.462] [INFO] settings - credentials loaded from: /var/www/etherpad_mypads/credentials.json
[2022-07-19 18:00:23.464] [INFO] settings - Using skin "colibris" in dir: /var/www/etherpad_mypads/src/static/skins/colibris
[2022-07-19 18:00:23.464] [INFO] settings - Session key loaded from: /var/www/etherpad_mypads/SESSIONKEY.txt
[2022-07-19 18:00:23.464] [INFO] settings - Random string used for versioning assets: 9e6ec0ff
[2022-07-19 18:00:23.714] [INFO] server - Starting Etherpad...
[2022-07-19 18:00:23.799] [ERROR] ueberDB - Database is not configured with charset utf8mb4 -- This may lead to crashes when certain characters are pasted in pads
[2022-07-19 18:00:23.799] [ERROR] server - Error occurred while starting Etherpad
[2022-07-19 18:00:23.800] [ERROR] server - Metrics at time of fatal error:
{
  "httpStartTime": 0,
  "memoryUsage": 62676992,
  "memoryUsageHeap": 11488096
}
[2022-07-19 18:00:23.800] [ERROR] server - TypeError: Cannot read property 'level' of undefined
    at Level.isLessThanOrEqualTo (/var/www/etherpad_mypads/src/node_modules/log4js/lib/levels.js:37:35)
    at Logger.isLevelEnabled (/var/www/etherpad_mypads/src/node_modules/log4js/lib/logger.js:66:21)
    at Logger.log (/var/www/etherpad_mypads/src/node_modules/log4js/lib/logger.js:54:13)
    at exports.Database.init (/var/www/etherpad_mypads/src/node_modules/ueberdb2/databases/mysql_db.js:78:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async exports.Database.init (/var/www/etherpad_mypads/src/node_modules/ueberdb2/lib/CacheAndBufferLayer.js:284:5)
    at async Object.exports.init (/var/www/etherpad_mypads/src/node/db/DB.js:41:3)
    at async Object.exports.start (/var/www/etherpad_mypads/src/node/server.js:142:5)
[2022-07-19 18:00:23.800] [INFO] server - Exiting...
[2022-07-19 18:00:23.800] [INFO] server - Waiting for Node.js to exit...
[2022-07-19 18:00:23.905] [INFO] plugins - npm --version: 6.14.15

nginx shows me a 502 bad gateway.

ericgaspar commented 2 years ago

Do you have extra installed pugins?

MayeulC commented 2 years ago

Just one, but I confirmed that wasn't the issue by temporarily moving the ep_embedded_hyperlinks2 folder around.

I worked around this by doing sed s/this.logger/this.mynewlogger/g /var/www/etherpad_mypads/src/node_modules/ueberdb2/databases/mysql_db.js

That's a hack, but it works. I wonder if this.logger = console.log at the beginning isn't overridden somewhere else.

Edit: I suspect this is the bug: https://github.com/ether/ueberDB/issues/266

tio-trom commented 2 years ago

Do you have extra installed pugins?

I do not think. I think I only have whatever defaults YNH has.

MayeulC commented 2 years ago

As I wrote, this bug isn't a plugin bug. It can be worked around more cleanly by executing:

mysql <<< "ALTER DATABASE etherpad_mypads CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;"

(of course <<< only works with bash, you can also call mysql and type this interactively, or in a temp file).

jose1711 commented 2 years ago
ALTER DATABASE etherpad_mypads CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;

thank you, that worked nicely!

SimonLefort commented 2 years ago

As I wrote, this bug isn't a plugin bug. It can be worked around more cleanly by executing:

mysql <<< "ALTER DATABASE etherpad_mypads CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;"

(of course <<< only works with bash, you can also call mysql and type this interactively, or in a temp file).

It worked for me too! Thank you @MayeulC . ;-)

tio-trom commented 2 years ago

Latest update fixed it. Thank you guys!