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

Installed plugins won’t appear as installed

Open dertuxmalwieder opened this issue 3 years ago • 23 comments

Describe the bug I set up Etherpad Lite without any plugins installed and I decided to install a plugin:

[2021-03-16 15:28:57.075] [INFO] server - Etherpad is running
[2021-03-16 15:29:12.960] [INFO] plugins - Installing plugin ep_mypads...

It seems to have worked:

[2021-03-16 15:31:30.113] [INFO] runCmd|npm - + [email protected]
[2021-03-16 15:31:30.113] [INFO] runCmd|npm - added 54 packages from 84 contributors, removed 570 packages, updated 471 packages, moved 5 packages and audited 1374 packages in 136.155s
[2021-03-16 15:31:31.148] [INFO] runCmd|npm - 
[2021-03-16 15:31:31.148] [INFO] runCmd|npm - 38 packages are looking for funding
[2021-03-16 15:31:31.148] [INFO] runCmd|npm -   run `npm fund` for details
[2021-03-16 15:31:31.148] [INFO] runCmd|npm - 
[2021-03-16 15:31:31.150] [INFO] runCmd|npm - found 69 vulnerabilities (46 low, 7 moderate, 16 high)
[2021-03-16 15:31:31.151] [INFO] runCmd|npm -   run `npm audit fix` to fix them, or `npm audit` for details
[2021-03-16 15:31:31.196] [INFO] plugins - Successfully installed plugin ep_mypads

Yet, the plugin won’t appear in the Plugin Manager even after pressing F5:

Screenshot

It is still listed as available. Why?

Server (please complete the following information):

  • Etherpad version: 1.8.12
  • OS: FreeBSD 12.2
  • Node.js version (node --version): v15.9.0
  • npm version (npm --version): 6.14.8

dertuxmalwieder avatar Mar 16 '21 14:03 dertuxmalwieder

Do other plugins exhibit similar behavior? We have CI for this afaik so it should be working...

JohnMcLear avatar Mar 16 '21 14:03 JohnMcLear

Yes, it also happens with other plugins:

[2021-03-16 15:38:32.895] [INFO] plugins - Successfully installed plugin ep_pad-lister

Yet, it is neither listed as installed nor active (which I can see because there is no pad list on the index page). But it has, at least, done something:

% cd etherpad-lite/node_modules/
% ls | grep ep_
ep_etherpad-lite
ep_pad-lister
%

dertuxmalwieder avatar Mar 16 '21 14:03 dertuxmalwieder

https://app.saucelabs.com/tests/281638fa1d95440baa3130cba1ccf2d2 is a video of the CI runner showing that the functionality is working -_-

JohnMcLear avatar Mar 16 '21 14:03 JohnMcLear

Try a plugin provided by @ether IE ep_align

JohnMcLear avatar Mar 16 '21 14:03 JohnMcLear

Well, sorry, it obviously is not.

ep_align:

[2021-03-16 15:46:37.057] [INFO] plugins - Installing plugin ep_align...
[2021-03-16 15:48:09.326] [ERROR] runCmd|npm - npm WARN enoent ENOENT: no such file or directory, open '/usr/home/etherpad/etherpad-lite/package.json'
[2021-03-16 15:48:09.358] [ERROR] runCmd|npm - npm WARN etherpad-lite No description
[2021-03-16 15:48:09.380] [ERROR] runCmd|npm - npm WARN etherpad-lite No repository field.
[2021-03-16 15:48:09.397] [ERROR] runCmd|npm - npm WARN etherpad-lite No README data
[2021-03-16 15:48:09.419] [ERROR] runCmd|npm - npm WARN etherpad-lite No license field.
[2021-03-16 15:48:09.421] [ERROR] runCmd|npm - 
[2021-03-16 15:48:09.428] [INFO] runCmd|npm - + [email protected]

Same results.

I have a strong feeling that the missing package.json file could be the culprit here. But then, the message about the successful installation makes no sense. So... how can I make Etherpad Lite create that file?

(I’ll be out for a few hours, I’ll look into it afterwards.)

dertuxmalwieder avatar Mar 16 '21 14:03 dertuxmalwieder

In CI it has that warning msg too btw... I'm not ruling it out, I just don't think it's the culprit.. I assume after successful installation the plugin actually works, it's just not listed in the admin UI? And I assume the problem persists after restart of Etherpad?

My guess is that your /admin javascript/html is cached and your browser cache needs clearing, but that's a guess..

JohnMcLear avatar Mar 16 '21 14:03 JohnMcLear

I only verified the pad-lister plugin yet and there is no pad list, so it’s probably not working at all. I’ll try the cache reset when I’m back home...

dertuxmalwieder avatar Mar 16 '21 15:03 dertuxmalwieder

Yes, the problem persists after a restart of Etherpad and after clearing my cache.

I’ll go back to 94a6506 for the time being. This pad is actually for productive use...

If I can help you to trace down the bug anyway, please inform me.

dertuxmalwieder avatar Mar 16 '21 18:03 dertuxmalwieder

hrm, I wonder if it's npm 6 related..

try this in your etherpad root folder:

npm install --no-save --legacy-peer-deps
npm install ep_align

afaik we are testing npm6 in CI tho...

JohnMcLear avatar Mar 16 '21 18:03 JohnMcLear

Sorry, cannot reproduce on a fresh virtualbox install of FreeBSD 12.2-RELEASE, node v15.10.0 and npm 6.14.8. I did:

./bin/installDeps.sh
uncomment users section in settings.json
node src/node/server.js

installing via /admin/plugins works (I tested ep_align and pad-lister).

webzwo0i avatar Mar 16 '21 22:03 webzwo0i

Hmm. Current state of things:

  1. Take the old Etherpad Lite revision with plug-ins installed.
  2. ./bin/installDeps.sh
  3. npm install --no-save --legacy-peer-deps
  4. NODE_ENV=production ./bin/run.sh

My old problem with the failing pad startup is fixed, at least, so I can finally have the latest revision as a working Etherpad for my team(s). But:

$ npm install ep_align
npm WARN saveError ENOENT: no such file or directory, open '/usr/home/etherpad/etherpad-lite/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/usr/home/etherpad/etherpad-lite/package.json'
npm WARN etherpad-lite No description
npm WARN etherpad-lite No repository field.
npm WARN etherpad-lite No README data
npm WARN etherpad-lite No license field.

+ [email protected]
updated 1 package and audited 1629 packages in 15.157s

41 packages are looking for funding
  run `npm fund` for details

found 100 vulnerabilities (63 low, 14 moderate, 23 high)
  run `npm audit fix` to fix them, or `npm audit` for details
$ NODE_ENV=production ./bin/run.sh

The plug-in is there now. But I can not install it over the Plugin Manager: While I get the + ep_align message, it just won’t appear as installed.

dertuxmalwieder avatar Mar 17 '21 15:03 dertuxmalwieder

When you say "Take the old Etherpad Lite revision with plug-ins installed." you mean 94a6506?

webzwo0i avatar Mar 17 '21 16:03 webzwo0i

Yup. That was the previous installation which worked (mostly) well for me.

Currently, I’m on 5c9514f926c1dbdf6a9ed82e81961c655bf48deb.

dertuxmalwieder avatar Mar 17 '21 16:03 dertuxmalwieder

git checkout 94a6506
rm -rf node_modules src/node_modules
# there is no package.json or package-lock.json in the root directory
# copy over settings.json with users section, all other settings are default
git checkout node_modules/ep_etherpad-lite # our symlink to ./src for peerDependency
./bin/installDeps.sh
env NODE_ENV=production node src/node/server.js
# now installing mypads, align and pad-lister via /admin/plugins in parallel (ie not waiting for a plugin to be ready, before installing the second and third one)
# watch messages in console like "HTTP server closed" etc.
# all plugins are listed under "Installed" and seem to work
# ctrl+c, notice a package-lock.json was created in the root directory
git checkout 5c9514f9
./bin/installDeps.sh
env NODE_ENV=production node src/node/server.js
# console says only ep_mypads was loaded and only ep_mypads is listed in /admin/plugins
# mypads and ep_align is listed in node_modules though, weird.
# install ep_align via /admin/plugins
# it compiles sqlite3, so I assume it's not respecting npm --no-optional
# after install /admin/plugins still does not list ep_align

Okay, so I can reproduce now. Multiple bugs imo (compiling sqlite3, plugin not installed currently, removing plugins during upgrade - probably because ./bin/installDeps.sh is removing things from ./node_modules.

It should not occur on clean installations, though. The missing info was that you were updating an existing installation. Can you confirm that the bug only happens when you update, but not when you reinstall etherpad to a clean directory, copy your settings.json over, start it and install plugins via /admin/plugins?

webzwo0i avatar Mar 17 '21 19:03 webzwo0i

Can you confirm that the bug only happens when you update, but not when you reinstall etherpad to a clean directory, copy your settings.json over, start it and install plugins via /admin/plugins?

Testing:

% mv etherpad-lite etherpad-lite-old
% git clone https://github.com/ether/etherpad-lite ; cd etherpad-lite
% git checkout 5c9514f9
% ./bin/installDeps.sh
# ... this will take a while ...
% cp ../etherpad-lite-old/settings.json .
% NODE_ENV=production ./bin/run.sh
# Error: sqlite3 not found. Ah, this again.
% npm install sqlite3
% NODE_ENV=production ./bin/run.sh

Installing ep_align via /admin/plugins:

[2021-03-18 02:44:32.919] [INFO] plugins - Installing plugin ep_align...
[2021-03-18 02:44:43.682] [ERROR] runCmd|npm - npm WARN enoent ENOENT: no such file or directory, open '/usr/home/etherpad/ep-new/package.json'
[2021-03-18 02:44:43.705] [ERROR] runCmd|npm - npm WARN ep-new No description
[2021-03-18 02:44:43.728] [ERROR] runCmd|npm - npm WARN ep-new No repository field.
[2021-03-18 02:44:43.744] [ERROR] runCmd|npm - npm WARN ep-new No README data
[2021-03-18 02:44:43.765] [ERROR] runCmd|npm - npm WARN ep-new No license field.
[2021-03-18 02:44:43.767] [ERROR] runCmd|npm - 
[2021-03-18 02:44:43.887] [INFO] runCmd|npm - + [email protected]
[2021-03-18 02:44:43.887] [INFO] runCmd|npm - added 1 package from 1 contributor and audited 1043 packages in 9.593s
[2021-03-18 02:44:44.635] [INFO] runCmd|npm - 
[2021-03-18 02:44:44.635] [INFO] runCmd|npm - 40 packages are looking for funding
[2021-03-18 02:44:44.635] [INFO] runCmd|npm -   run `npm fund` for details
[2021-03-18 02:44:44.635] [INFO] runCmd|npm - 
[2021-03-18 02:44:44.637] [INFO] runCmd|npm - found 0 vulnerabilities
[2021-03-18 02:44:44.637] [INFO] runCmd|npm - 
[2021-03-18 02:44:44.686] [INFO] plugins - Successfully installed plugin ep_align
[2021-03-18 02:44:44.687] [INFO] plugins - Running npm to get a list of installed plugins...
[2021-03-18 02:44:50.621] [INFO] plugins - Loading plugin ep_etherpad-lite...
[2021-03-18 02:44:50.625] [INFO] plugins - Loaded 1 plugins

🤨

Reloading the Plugin Manager: No ep_align for me.

dertuxmalwieder avatar Mar 18 '21 01:03 dertuxmalwieder

@dertuxmalwieder Can you still produce this on the latest version of Etherpad? Also same issue if you use fastRun.sh?

JohnMcLear avatar Sep 09 '21 14:09 JohnMcLear

Wait I think I can replicate... Commands...

npm install sqlite3
bin/installDeps.sh 
npm install sqlite3
NODE_ENV=production ./bin/run.sh

When trying to install ep_define

[2021-09-09 15:08:46.098] [INFO] plugins - Successfully installed plugin ep_define
[2021-09-09 15:08:46.098] [INFO] plugins - Running npm to get a list of installed plugins...
[2021-09-09 15:08:47.744] [INFO] plugins - Loading plugin ep_align...
[2021-09-09 15:08:47.745] [INFO] plugins - Loading plugin ep_etherpad-lite...
[2021-09-09 15:08:47.745] [INFO] plugins - Loaded 2 plugins

Note that ep_define is not there¬

JohnMcLear avatar Sep 09 '21 14:09 JohnMcLear

[2021-09-09 15:08:46.098] [INFO] plugins - Successfully installed plugin ep_define
[2021-09-09 15:08:46.098] [INFO] plugins - Running npm to get a list of installed plugins...
[2021-09-09 15:08:47.744] [INFO] plugins - Loading plugin ep_align...
[2021-09-09 15:08:47.745] [INFO] plugins - Loading plugin ep_etherpad-lite...
[2021-09-09 15:08:47.745] [INFO] plugins - Loaded 2 plugins

Clicking uninstall gave me

[2021-09-09 15:10:20.663] [INFO] plugins - Running npm to get a list of installed plugins...
[2021-09-09 15:10:22.334] [ERROR] runCmd|npm - npm ERR! missing: [email protected], required by 1

[2021-09-09 15:10:22.354] [ERROR] server - Error: Command exited with code 1: npm ls --long --json --depth=0 --no-production
    at exports (/home/jose/proxyDemo/1/src/node/utils/run_cmd.js:119:25)
    at Object.exports.getPackages (/home/jose/proxyDemo/1/src/static/js/pluginfw/plugins.js:125:48)
    at Object.exports.update (/home/jose/proxyDemo/1/src/static/js/pluginfw/plugins.js:99:34)
    at Object.exports.uninstall (/home/jose/proxyDemo/1/src/static/js/pluginfw/installer.js:45:17)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-09-09 15:10:22.355] [INFO] server - Exiting...
[2021-09-09 15:10:22.355] [INFO] server - Stopping Etherpad...
[2021-09-09 15:10:22.355] [INFO] http - Closing HTTP server...
[2021-09-09 15:10:22.355] [INFO] socket.io - Closing socket.io engine...
[2021-09-09 15:10:22.356] [INFO] access - [LEAVE] pad:5ymYEsn1Pl0qhbvSzJt9 socket:cgb0F-lOuKq1StzDAAAF IP:127.0.0.1 authorID:a.Q5oT7SV1YdSxvVPA username:admin
[2021-09-09 15:10:22.356] [INFO] socket.io - All socket.io clients have disconnected
[2021-09-09 15:10:22.358] [INFO] http - Waiting for 2 HTTP clients to disconnect...
[2021-09-09 15:10:22.358] [INFO] console - Database closed
[2021-09-09 15:10:22.360] [INFO] http - HTTP server closed
[2021-09-09 15:10:22.361] [INFO] server - Etherpad stopped
[2021-09-09 15:10:22.361] [INFO] server - Waiting for Node.js to exit...

JohnMcLear avatar Sep 09 '21 14:09 JohnMcLear

Clean install, the issue is caused by this command

npm install sqlite3

So why is this command being run in root? Well because ueberdb needs it as an optional dep: https://github.com/ether/ueberDB/blob/master/package.json#L38

@rhansen Afaik you are using sqlite3, what's the correct procedure here to install sqlite3 without breaking plugins?

JohnMcLear avatar Sep 09 '21 14:09 JohnMcLear

I migrated from SQLite to MySQL (MariaDB) a month ago. I’m not sure whether that already fixed the problem - I am afraid of trying too many “known broken” things in Production…

dertuxmalwieder avatar Sep 09 '21 17:09 dertuxmalwieder

@rhansen Afaik you are using sqlite3, what's the correct procedure here to install sqlite3 without breaking plugins?

Install sqlite3 under src/, not top-level.

rhansen avatar Sep 10 '21 05:09 rhansen

Sorry for reviving this thread but I seem to have a related issue. When trying to install plugins (as stated in the documentation) I also get that error of a missing package.json in the root directory

enoent ENOENT: no such file or directory, open '/home/etherpad/etherpad-lite/package.json'

So am I missing something? After all there is none in the root folder when checking out. Have I missed something? There is one in the src folder but I guess that is not the place to install plugins.

TobiasReich avatar Jul 18 '22 10:07 TobiasReich

I think the issue is still prevalent with the latest version...

waridrox avatar Aug 16 '22 16:08 waridrox