etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

New installation 2.2.6 failed

Open FredMa01 opened this issue 1 year ago • 18 comments

Describe the bug When opening pad after new installation of etherpad , I have the error : "Error: Reconnect timed out" Etherpad version 2.2.6 pnpm version: 9.12.3 Apache 2 with SSL enabled and configuration https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy#with-ssl-enabled

To Reproduce New installation : npm install -g pnpm git clone -b master https://github.com/ether/etherpad-lite.git etherpad pnpm i pnpm run build:etherpad chown -R etherpad:etherpad /home/etherpad pnpm run prod

Error Error: Uncaught Error: Reconnect timed out -- { errorId: 'DNpnZWeABTz4LZZt3ft4', type: 'Uncaught exception', msg: 'Error: Uncaught Error: Reconnect timed out', url: 'https://mypad.example.com/p/a', source: 'https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js', linenumber: 56, userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36', stack: 'Error: Reconnect timed out\n' + ' at Po. (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:85557)\n' + ' at at.emit (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:44848)\n' + ' at Po.reconnect (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:81013)\n' + ' at https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:81283\n' + ' at Ro.a (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:79280)\n' + ' at at.emit (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:44848)\n' + ' at Ro._onError (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:61762)\n' + ' at at.emit (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:44848)\n' + ' at No.onError (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:46640)\n' + ' at ws.onerror (https://mypad.example.com/padbootstrap-QFqMdltcc9w.min.js:56:52951)'

FredMa01 avatar Nov 04 '24 21:11 FredMa01

I'll check this right now :). It is probably outdated.

SamTV12345 avatar Nov 05 '24 19:11 SamTV12345

I maybe need help how to even get the reverse proxy installed. Could you please give me a quickstart on how to install apache? I need some modules but no idea how to install or where to get them

SamTV12345 avatar Nov 06 '24 19:11 SamTV12345

On Debian :

apt install apache2

Activate proxy modules : a2enmod proxy proxy_http headers proxy_wstunnel deflate

Edit virtualhost in /etc/apache2/sites-available/etherpad.conf https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy#apache

Activate virtualhost : a2ensite etherpad

Restart Apache2 : systemctl reload apache2

FredMa01 avatar Nov 06 '24 20:11 FredMa01

I get Nov 06 21:22:12 ubuntu apachectl[13570]: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

SamTV12345 avatar Nov 06 '24 20:11 SamTV12345

sorry : a2enmode rewrite

FredMa01 avatar Nov 06 '24 20:11 FredMa01

Thanks now it works. I used the very basic script.

SamTV12345 avatar Nov 06 '24 20:11 SamTV12345

It all works with the basic script for me. I copied 1 to 1. Socket IO works even websockets are succesfully connected.

SamTV12345 avatar Nov 06 '24 20:11 SamTV12345

If I use the very basic script, I have "Uncaught Error: Reconnect timed out". If I delete one line and add 2 in <Location /socket.io>:

- RewriteRule /(.*) ws://localhost:9001/socket.io/$1 [P,L]
+ ProxyPass ws://localhost:9001/socket.io
+ ProxyPassReverse ws://localhost:9001/socket.io

It all works ! I saw it in this issue with the same padbootstrap-xxxxxxxxxxxxxxxxx.min.js:56 Uncaught Error : https://github.com/ether/etherpad-lite/issues/6693

Strange... Perhaps something to change here : https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy#apache

FredMa01 avatar Nov 06 '24 21:11 FredMa01

Could be. Did you have any success in experimenting with the apache config?

SamTV12345 avatar Nov 15 '24 19:11 SamTV12345

I think that there is a problem with the apache config on the new versions of etherpad > 2.1.0 proposed here : https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy#apache The line RewriteRule /(.*) ws://localhost:9001/socket.io/$1 [P,L] is blocking and needs to be deactivated Then you have to add these 2 lines

ProxyPass ws://localhost:9001/socket.io
ProxyPassReverse ws://localhost:9001/socket.io

FredMa01 avatar Nov 15 '24 20:11 FredMa01

Hi, same error today after git pull & docker rebuild today. I try with and without the RewriteRule in apache config. Works many months until today. Seems really related to apache proxy conf, with vpn and direct ip access everything works.

ralfi avatar Nov 20 '24 14:11 ralfi

2024-11-20T14:07:32.703] [INFO] settings - Your Etherpad version is 2.2.6 (970df6c)
[2024-11-20T14:07:34.466] [INFO] http - HTTP server listening for connections
[2024-11-20T14:07:34.466] [INFO] settings - You can access your Etherpad instance at http://0.0.0.0:9001/
[2024-11-20T14:07:34.466] [INFO] settings - The plugin admin page is at http://0.0.0.0:9001/admin/plugins
[2024-11-20T14:07:34.466] [INFO] server - Etherpad is running
[2024-11-20T14:08:04.651] [INFO] Minify - Compress CSS file skins/colibris/index.css.
[2024-11-20T14:08:04.680] [INFO] Minify - Compress JS file skins/colibris/index.js.
[2024-11-20T14:08:11.111] [INFO] Minify - Compress CSS file css/pad.css.
[2024-11-20T14:08:11.175] [INFO] Minify - Compress CSS file skins/colibris/pad.css.
[2024-11-20T14:08:11.176] [INFO] Minify - Compress CSS file /opt/etherpad-lite/src/plugin_packages/ep_table_of_contents/static/css/toc.css.
[2024-11-20T14:08:11.177] [INFO] Minify - Compress CSS file /opt/etherpad-lite/src/plugin_packages/ep_special_characters/static/css/main.css.
[2024-11-20T14:08:11.178] [INFO] Minify - Compress JS file skins/colibris/pad.js.
▲ [WARNING] Comments in CSS use "/* ... */" instead of "//" [js-comment-in-css]

    plugin_packages/.versions/[email protected]/static/css/toc.css:94:43:
      94 │ ...nts-active #toc { width: 20% } // a bit smaller when the commen...
         ╵                                   ~~

[2024-11-20T14:08:11.234] [INFO] Minify - Compress JS file /opt/etherpad-lite/src/plugin_packages/ep_special_characters/static/js/main.js.
[2024-11-20T14:08:11.235] [INFO] Minify - Compress JS file /opt/etherpad-lite/src/plugin_packages/ep_table_of_contents/static/js/toc.js.
[2024-11-20T14:08:13.351] [INFO] access - [CREATE] pad:Test2 socket:1H_RooNan3KdAMvIAAAB IP:ANONYMOUS authorID:a.uRzDLKvhfHru91Fo
[2024-11-20T14:08:13.594] [INFO] Minify - Compress CSS file css/iframe_editor.css.
[2024-11-20T14:08:13.598] [INFO] Minify - Compress CSS file /opt/etherpad-lite/src/plugin_packages/ep_font_size/static/css/size.css.
[2024-11-20T14:08:13.607] [INFO] Minify - Compress CSS file /opt/etherpad-lite/src/plugin_packages/ep_font_family/static/css/fonts.css.
[2024-11-20T14:08:13.608] [INFO] Minify - Compress CSS file /opt/etherpad-lite/src/plugin_packages/ep_font_color/static/css/color.css.
[2024-11-20T14:08:13.609] [INFO] Minify - Compress CSS file /opt/etherpad-lite/src/plugin_packages/ep_headings2/static/css/editor.css.
[2024-11-20T14:08:13.627] [INFO] Minify - Compress CSS file /opt/etherpad-lite/src/plugin_packages/ep_special_characters/static/css/ace.css.
[2024-11-20T14:10:55.495] [INFO] access - [LEAVE] pad:Test2 socket:1H_RooNan3KdAMvIAAAB IP:ANONYMOUS authorID:a.uRzDLKvhfHru91Fo
[2024-11-20T14:17:40.238] [INFO] access - [CREATE] pad:Test2 socket:F17lsAp-RJtmK2nMAAAD IP:ANONYMOUS authorID:a.uRzDLKvhfHru91Fo
[2024-11-20T14:17:44.087] [INFO] access - [LEAVE] pad:Test2 socket:F17lsAp-RJtmK2nMAAAD IP:ANONYMOUS authorID:a.uRzDLKvhfHru91Fo
[2024-11-20T14:17:47.054] [INFO] access - [CREATE] pad:Test2 socket:mj_IqZy5YALPJlZJAAAF IP:ANONYMOUS authorID:a.uRzDLKvhfHru91Fo
[2024-11-20T14:17:48.947] [INFO] access - [LEAVE] pad:Test2 socket:mj_IqZy5YALPJlZJAAAF IP:ANONYMOUS authorID:a.uRzDLKvhfHru91Fo

see here a warn message with access via ip address over vpn, related?

ralfi avatar Nov 20 '24 14:11 ralfi

my apache reverse conf

    ProxyVia On
    ProxyRequests Off
    ProxyPreserveHost On

  <Location />
      ProxyPass http://localhost:9001/ retry=0 timeout=30
      ProxyPassReverse http://localhost:9001/
  </Location>

  <Location /socket.io>
      RewriteEngine On
      RewriteCond %{QUERY_STRING} transport=websocket    [NC]
      RewriteRule /(.*) ws://localhost:9001/socket.io/$1 [P,L]
      ProxyPass http://localhost:9001/socket.io retry=0 timeout=30
      ProxyPassReverse http://localhost:9001/socket.io
  </Location>

  <Proxy *>
      Options FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      Allow from all
  </Proxy>

#    Loglevel Info
#    ErrorLog ${APACHE_LOG_DIR}/etherpad-error.log
#    CustomLog ${APACHE_LOG_DIR}/etherpad-access.log combined

ralfi avatar Nov 20 '24 14:11 ralfi

@SamTV12345 Can you get a look please, of course also with disabled Rewrite Rule line

ralfi avatar Nov 21 '24 07:11 ralfi

Our 2.2.6 installation randomly stopped working with the same "Error: Reconnect timed out". Logs were identical to those posted above.

It turned out it was the browser/workstation, a restart sorted it. Worth a try.

fmcsecurity avatar Jan 05 '25 23:01 fmcsecurity

I've a similar error. The documentation doesn't mention to set previliges for the etherpad folder like ´chown -R etherpad:etherpad /home/etherpad´. Besided the user and group does not exist on my system.

nise avatar Jan 17 '25 07:01 nise

If it used to work before for you, but stopped.

The problems come from apache changing how websocket proxies are configured in version >=2.4.47, apparently.

I figured this out via https://github.com/dani-garcia/vaultwarden/discussions/3598#discussioncomment-6355293 so props there.

Check your version $ apache2 -v

And replace something like

    RewriteEngine On
    RewriteCond %{QUERY_STRING} transport=websocket    [NC]
    RewriteRule /(.*) ws://localhost:9001/socket.io/$1 [P,L]
    ProxyPass http://localhost:9001/socket.io retry=0 timeout=30
    ProxyPassReverse http://localhost:9001/socket.io

to only

    ProxyPass ws://localhost:9001/socket.io upgrade=websocket timeout=30
    ProxyPassReverse ws://localhost:9001/socket.io

dcht00 avatar Apr 09 '25 16:04 dcht00

I've updated the wiki: https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy/_compare/e2594486677bcc0af01926de7e6fa9f027d9f594...53fe64bfef7eb19871c8347cb851c08ef7fb8ef8

dcht00 avatar Apr 09 '25 16:04 dcht00