Open vladimirdulov opened 1 month ago
It is fixed in ep_openid_connect v3.0.7
@SamTV12345 Thanks for the fix!
I faced the same error too, I have upgraded ep_openid_connect to 3.0.7, but I still seemed to be getting the same error.
therpad-1 | [2024-04-17T01:49:33.464] [ERROR] settings - Failed to load hook function "/opt/etherpad-lite/src/plugin_packages/ep_openid_connect:authenticate" for plugin "ep_openid_connect" part "main" hook set "hooks" hook "authenticate": TypeError: LRU is not a constructor
etherpad-1 | at Object.<anonymous> (/opt/etherpad-lite/src/plugin_packages/openid-client/lib/helpers/request.js:62:16)
etherpad-1 | at Module._compile (node:internal/modules/cjs/loader:1368:14)
etherpad-1 | at Object.S (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.7.2/node_modules/tsx/dist/cjs/index.cjs:1:1292)
etherpad-1 | at Module.load (node:internal/modules/cjs/loader:1205:32)
etherpad-1 | at Module._load (node:internal/modules/cjs/loader:1021:12)
etherpad-1 | at Module.require (node:internal/modules/cjs/loader:1230:19)
etherpad-1 | at require (node:internal/modules/helpers:179:18)
etherpad-1 | at Object.<anonymous> (/opt/etherpad-lite/src/plugin_packages/openid-client/lib/client.js:25:17)
etherpad-1 | at Module._compile (node:internal/modules/cjs/loader:1368:14)
etherpad-1 | at Object.S (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.7.2/node_modules/tsx/dist/cjs/index.cjs:1:1292)
etherpad-1 | at Module.load (node:internal/modules/cjs/loader:1205:32)
etherpad-1 | at Module._load (node:internal/modules/cjs/loader:1021:12)
etherpad-1 | at Module.require (node:internal/modules/cjs/loader:1230:19)
etherpad-1 | at require (node:internal/modules/helpers:179:18)
etherpad-1 | at Object.<anonymous> (/opt/etherpad-lite/src/plugin_packages/openid-client/lib/issuer.js:5:19)
etherpad-1 | at Module._compile (node:internal/modules/cjs/loader:1368:14)
I am running etherpad with docker. And I checked the installed packages and the following appears to be happening:
ep_openid_connect
(/opt/etherpad-lite/src/plugin_packages/ep_openid_connect/package.json
) is 3.0.7
correctly.lru-cache
in plugin_packages (/opt/etherpad-lite/src/plugin_packages/lru-cache/package.json
) is 6.0.0 (ep_openid_connect
depends on openid-client
, which depends on lru-cache@^6.0.0
.)lru-cache
in node_modules (/opt/etherpad-lite/src/node_modules/lru-cache/package.json
) is 10.2.0.I found out that etherpad-lite
requires lru-cache@^10.2.0
( code ). Therefore, the version of lru-cache
referenced by openid-client
seems to be unexpectedly newer and is failing.
Could Etherpad's plugin mechanism of 2.0.x not work properly if there are version conflicts in the packages it depends on?
@SamTV12345 Thanks for the fix!
I faced the same error too, I have upgraded ep_openid_connect to 3.0.7, but I still seemed to be getting the same error.
therpad-1 | [2024-04-17T01:49:33.464] [ERROR] settings - Failed to load hook function "/opt/etherpad-lite/src/plugin_packages/ep_openid_connect:authenticate" for plugin "ep_openid_connect" part "main" hook set "hooks" hook "authenticate": TypeError: LRU is not a constructor etherpad-1 | at Object.<anonymous> (/opt/etherpad-lite/src/plugin_packages/openid-client/lib/helpers/request.js:62:16) etherpad-1 | at Module._compile (node:internal/modules/cjs/loader:1368:14) etherpad-1 | at Object.S (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.7.2/node_modules/tsx/dist/cjs/index.cjs:1:1292) etherpad-1 | at Module.load (node:internal/modules/cjs/loader:1205:32) etherpad-1 | at Module._load (node:internal/modules/cjs/loader:1021:12) etherpad-1 | at Module.require (node:internal/modules/cjs/loader:1230:19) etherpad-1 | at require (node:internal/modules/helpers:179:18) etherpad-1 | at Object.<anonymous> (/opt/etherpad-lite/src/plugin_packages/openid-client/lib/client.js:25:17) etherpad-1 | at Module._compile (node:internal/modules/cjs/loader:1368:14) etherpad-1 | at Object.S (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.7.2/node_modules/tsx/dist/cjs/index.cjs:1:1292) etherpad-1 | at Module.load (node:internal/modules/cjs/loader:1205:32) etherpad-1 | at Module._load (node:internal/modules/cjs/loader:1021:12) etherpad-1 | at Module.require (node:internal/modules/cjs/loader:1230:19) etherpad-1 | at require (node:internal/modules/helpers:179:18) etherpad-1 | at Object.<anonymous> (/opt/etherpad-lite/src/plugin_packages/openid-client/lib/issuer.js:5:19) etherpad-1 | at Module._compile (node:internal/modules/cjs/loader:1368:14)
I am running etherpad with docker. And I checked the installed packages and the following appears to be happening:
- The version of
ep_openid_connect
(/opt/etherpad-lite/src/plugin_packages/ep_openid_connect/package.json
) is3.0.7
correctly.- The version of
lru-cache
in plugin_packages (/opt/etherpad-lite/src/plugin_packages/lru-cache/package.json
) is 6.0.0 (ep_openid_connect
depends onopenid-client
, which depends onlru-cache@^6.0.0
.)- However, the version of
lru-cache
in node_modules (/opt/etherpad-lite/src/node_modules/lru-cache/package.json
) is 10.2.0.I found out that
etherpad-lite
requireslru-cache@^10.2.0
( code ). Therefore, the version oflru-cache
referenced byopenid-client
seems to be unexpectedly newer and is failing.Could Etherpad's plugin mechanism of 2.0.x not work properly if there are version conflicts in the packages it depends on?
Oh that is a bummer. It's the client. I opened a pr over there that bumps the LRU cache to version 10. Then I can do a final update of the openid-client and it should work again https://github.com/panva/node-openid-client/pull/674
Oh that is a bummer. It's the client. I opened a pr over there that bumps the LRU cache to version 10. Then I can do a final update of the openid-client and it should work again panva/node-openid-client#674
Thank you for making the Pull Request on node-openid-client. (Unfortunately, the pull request was closed without being merged...)
Such version conflicts seem to occur in several other npm packages. (For example, in my plugin ep_kodama, openai-node seemed to contain such a conflict. https://github.com/yacchin1205/ep_kodama/issues/1 ) I assume npm allows for such conflicts https://stackoverflow.com/questions/42147243/how-does-npm-handle-version-conflicts . So I think that Etherpad's plugin mechanism should also allow for such conflicts so that it can accept a wide variety of plugins ☺️
Oh that is a bummer. It's the client. I opened a pr over there that bumps the LRU cache to version 10. Then I can do a final update of the openid-client and it should work again panva/node-openid-client#674
Thank you for making the Pull Request on node-openid-client. (Unfortunately, the pull request was closed without being merged...)
Such version conflicts seem to occur in several other npm packages. (For example, in my plugin ep_kodama, openai-node seemed to contain such a conflict. yacchin1205/ep_kodama#1 ) I assume npm allows for such conflicts https://stackoverflow.com/questions/42147243/how-does-npm-handle-version-conflicts . So I think that Etherpad's plugin mechanism should also allow for such conflicts so that it can accept a wide variety of plugins ☺️
I agree we need to find a more sophisticated way to store plugins. The question is only how. If you can think about a solution for this problem that would be great. I haven't found a solution on how to tell node that there is an alternative path in plugin_packages for that
I agree we need to find a more sophisticated way to store plugins. The question is only how. If you can think about a solution for this problem that would be great. I haven't found a solution on how to tell node that there is an alternative path in plugin_packages for that
Thanks for the reply. I will try to improve this behavior. I checked the code and it seems that the live-plugin-manager used by etherpad-lite also recognizes this as a known issue, and it says "Plugin dependencies can be specified only as NPM dependencies (version number) or github dependencies (owner/repo), url or other kind of dependencies are not supported". (Issue https://github.com/davideicardi/live-plugin-manager/issues/3 still exists) So I will consider including suggestions for improvements to live-plugin-manager.
Is there any news on a fix for this error?
I just published the fix. Now I noticed that the node-live-plugin manger has some issues with other registries as I published the patched version of openid-client on jsr https://jsr.io/@etherpad/node-openid-client/publish . I'll try to come up with a solution tomorrow.
Oh wow thank you so much!! Etherpad was the last bit of infrastructure I wanted to include in my SSO network and tuesday the first users are coming in, hugely appreciate your work!!!
(Issue davideicardi/live-plugin-manager#3 still exists) So I will consider including suggestions for improvements to live-plugin-manager.
FYI I am preparing code for improvements to live-plugin-manager. (Branch https://github.com/yacchin1205/live-plugin-manager/tree/feature/version-management ) I would like to test and submit a Pull Request in the next few days.
I have submitted a Pull Request for live-plugin-manager. If merged, using the modified live-plugin-manager and making minor fixes to etherpad-lite should resolve this issue.
The pull request for live-plugin-manager has been merged, and I will submit a pull request here when new version of the live-plugin-manager is published!
The pull request for live-plugin-manager has been merged, and I will submit a pull request here when new version of the live-plugin-manager is published!
Awesome did you ask him for a new release :) ?
Awesome did you ask him for a new release :) ?
Yes 😄 It may be released in the near future.
Could you advise if the
suggested plugin
"ep_openid_connect" is still working with v2.0.x? I get the following error in the etherpad-lite log, openid connect plugin doesn't seem to work.Ethepad-lite version: 2.0.2 (it seems all 2.0.x affected)