Giter Club home page Giter Club logo

Comments (4)

SamTV12345 avatar SamTV12345 commented on May 28, 2024

Describe the bug I'm building a custom docker image of Etherpad which includes some public plugins and a single local one (not published to npm).

The command looks something like:

docker build --build-arg ETHERPAD_PLUGINS="ep_user_displayname ep_openid_connect ./ep_my_custom_plugin" --tag ether .

The build completes successfully, and plugins are installed correctly:

#13 [ 9/13] RUN { [ -z "ep_user_displayname ep_openid_connect ./ep_my_custom_plugin" ] ||       npm install --no-save --legacy-peer-deps ep_user_displayname ep_openid_connect ./ep_my_custom_plugin; } &&     src/bin/installDeps.sh &&     rm -rf ~/.npm
#13 sha256:e52e9bed489766190c2ebb2c9883195caf4db1edc0a866e411658a4f2015aab6
j#13 31.10 npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
#13 49.08 npm WARN enoent ENOENT: no such file or directory, open '/opt/etherpad-lite/package.json'
#13 49.08 npm WARN etherpad-lite No description
#13 49.08 npm WARN etherpad-lite No repository field.
#13 49.08 npm WARN etherpad-lite No README data
#13 49.08 npm WARN etherpad-lite No license field.
#13 49.08
#13 49.09 + [email protected]
#13 49.09 + [email protected]
#13 49.09 + [email protected]
#13 49.09 added 819 packages from 1190 contributors and audited 813 packages in 48.122s
#13 49.36
#13 49.36 79 packages are looking for funding
#13 49.36   run `npm fund` for details
#13 49.36
#13 49.36 found 26 vulnerabilities (18 moderate, 8 high)
#13 49.36   run `npm audit fix` to fix them, or `npm audit` for details
#13 49.91 Copy the settings template to settings.json...
#13 49.91 Installing dependencies...
#13 49.91 Installing production dependencies
#13 63.28 added 351 packages in 12.462s
#13 63.30 Clearing minified cache...
#13 DONE 64.0s

However, when I start the container via:

docker run -p 9001:9001 --env-file .env ether

I'm getting an error that looks like this:

[2024-01-15T15:15:34.327] [ERROR] server - Error: Failed to get package 'ep_my_custom_plugin' Response error 404 Not Found
    at Object.<anonymous> (/opt/etherpad-lite/src/node_modules/live-plugin-manager/dist/src/httpUtils.js:68:19)
    at Generator.next (<anonymous>)
    at fulfilled (/opt/etherpad-lite/src/node_modules/live-plugin-manager/dist/src/httpUtils.js:24:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2024-01-15T15:15:34.327] [INFO] server - Exiting...
[2024-01-15T15:15:34.328] [INFO] server - Waiting for Node.js to exit...
[2024-01-15T15:15:39.331] [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
[2024-01-15T15:15:39.333] [ERROR] server - Enable `dumpOnUncleanExit` setting to get a dump of objects preventing a clean exit
[2024-01-15T15:15:39.335] [ERROR] server - Forcing an unclean exit...

I suspect that it might be due to changes introduced by #6018.

*UPD: I was able to confirm that the 'breaking change' was indeed introduced the PR mentioned above, since using a commit before that one works well.

Server (please complete the following information):

  • Etherpad version: 1.9.6 develop branch (9c14a4f)

Thanks for the issue. I'll take a look. I hope the plugin was installed but only the error because the plugin is not available in npmjs is not handled properly.

from etherpad-lite.

dhalenok avatar dhalenok commented on May 28, 2024

@SamTV12345

I did some more research and was able to pinpoint that the error is being thrown in migratePluginsFromNodeModules due to live-plugin-manager trying to install a local package from npm.

I was also able to come up with a (very hacky) workaround:

await Promise.all(Object.entries(dependencies).map(async ([pkg, info]) => {
  if (pkg.startsWith(plugins.prefix) && pkg !== 'ep_etherpad-lite') {
    if (!Object.prototype.hasOwnProperty.call(info, '_resolved')) {
      await exports.manager.installFromPath(`./${pkg}`)
    } else {
      await exports.manager.install(pkg)
    }
  }
}));

Hopefully, that can help you somehow in coming up with a proper fix.

from etherpad-lite.

SamTV12345 avatar SamTV12345 commented on May 28, 2024

Oh sorry. Haven't notified you. It should be fixed in develop.

from etherpad-lite.

dhalenok avatar dhalenok commented on May 28, 2024

Thanks! The problem seems to be fixed.

from etherpad-lite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.