Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker-compose] Missing Module rusty-store-kv in Docker Build for Etherpad Lite 2.2.2 #6638

Closed
bharath-naik opened this issue Sep 7, 2024 · 5 comments

Comments

@bharath-naik
Copy link

bharath-naik commented Sep 7, 2024

Description
When building the Docker image for Etherpad Lite 2.2.2 from the official GitHub source, the build fails with a MODULE_NOT_FOUND error for the rusty-store-kv module. This issue does not occur when running pnpm run prod locally, but it consistently fails in the Docker environment.

To Reproduce
Steps to reproduce the behavior:
download the the Etherpad Lite repository (v2.2.2) zip.
Build a Docker image using the provided Dockerfile.
Start the container with docker-compose up with the build context refering to the local Dockerfile.
Observe the error during startup.

Expected behavior
Ther etherpad should run with mongodb connection by considering the settings.json file
Screenshots
If applicable, add screenshots to help explain your problem.

Server (please complete the following information):

  • Etherpad version: 2.2.2
  • OS: Ubuntu 22
  • Node.js version (22):
  • npm version (10.8):
  • Is the server free of plugins: yes

Additional context

Using skin "colibris" in dir: /opt/etherpad-lite/src/static/skins/colibris
pages2.2_1       | [2024-09-07T12:33:22.456] [WARN] settings - DirtyDB is used. This is not recommended for production. File location: /opt/etherpad-lite/var/dirty.db
pages2.2_1       | [2024-09-07T12:33:22.457] [INFO] settings - Random string used for versioning assets: c4b3f3b9
pages2.2_1       | /opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:2
pages2.2_1       | //# sourceMappingURL=data:application/json;base64,`,N=c(()=>process.sourceMapsEnabled??!0,"shouldApplySourceMap"),S=c(({code:t,map:e})=>t+Z+Buffer.from(JSON.stringify(e),"utf8").toString("base64"),"inlineSourceMap"),q=[".cts",".mts",".ts",".tsx",".jsx"],ee=[".js",".cjs",".mjs"],C=[".ts",".tsx",".jsx"],w=c((t,e,r,n)=>{const s=Object.getOwnPropertyDescriptor(t,e);s?.set?t[e]=r:(!s||s.configurable)&&Object.defineProperty(t,e,{value:r,enumerable:s?.enumerable||n?.enumerable,writable:n?.writable??(s?s.writable:!0),configurable:n?.configurable??(s?s.configurable:!0)})},"safeSet"),te=c((t,e,r)=>{const n=e[".js"],s=c((a,o)=>{if(t.enabled===!1)return n(a,o);const[l,f]=o.split("?");if((new URLSearchParams(f).get("namespace")??void 0)!==r)return n(a,o);U.parent?.send&&U.parent.send({type:"dependency",path:l});const d=q.some(h=>l.endsWith(h)),P=ee.some(h=>l.endsWith(h));if(!d&&!P)return n(a,l);let u=G.readFileSync(l,"utf8");if(l.endsWith(".cjs")){const h=v.transformDynamicImport(o,u);h&&(u=N()?S(h):h.code)}else if(d||v.isESM(u)){const h=v.transformSync(u,o,{tsconfigRaw:exports.fileMatcher?.(l)});u=N()?S(h):h.code}a._compile(u,l)},"transformer");w(e,".js",s);for(const a of C)w(e,a,s,{enumerable:!r,writable:!0,configurable:!0});return w(e,".mjs",s,{writable:!0,configurable:!0}),()=>{e[".js"]===s&&(e[".js"]=n);for(const a of[...C,".mjs"])e[a]===s&&delete e[a]}},"createExtensions"),se=c(t=>e=>{if((e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),_.test(e)){let r=m.join(e,"index.js");e.startsWith("./")&&(r=`./${r}`);try{return t(r)}catch{}}try{return t(e)}catch(r){const n=r;if(n.code==="MODULE_NOT_FOUND")try{return t(`${e}${m.sep}index.js`)}catch{}throw n}},"createImplicitResolver"),A=[".js",".json"],J=[".ts",".tsx",".jsx"],ne=[...J,...A],re=[...A,...J],g=Object.create(null);g[".js"]=[".ts",".tsx",".js",".jsx"],g[".jsx"]=[".tsx",".ts",".jsx",".js"],g[".cjs"]=[".cts"],g[".mjs"]=[".mts"];const Q=c(t=>{const e=t.split("?"),r=e[1]?`?${e[1]}`:"",[n]=e,s=m.extname(n),a=[],o=g[s];if(o){const f=n.slice(0,-s.length);a.push(...o.map(i=>f+i+r))}const l=!(t.startsWith(E)||y(n))||n.includes($)||n.includes("/node_modules/")?re:ne;return a.push(...l.map(f=>n+f+r)),a},"mapTsExtensions"),b=c((t,e,r)=>{if(_.test(e)||!r&&!exports.allowJs)return;const n=Q(e);if(n)for(const s of n)try{return t(s)}catch(a){const{code:o}=a;if(o!=="MODULE_NOT_FOUND"&&o!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw a}},"resolveTsFilename"),ae=c((t,e)=>r=>{if(y(r)){const n=b(t,r,e);if(n)return n}try{return t(r)}catch(n){const s=n;if(s.code==="MODULE_NOT_FOUND"){if(typeof s.path=="string"&&s.path.endsWith(`${m.sep}package.json`)){const o=s.message.match(/^Cannot find module '([^']+)'$/);if(o){const f=o[1],i=b(t,f,e);if(i)return i}const l=s.message.match(/^Cannot find module '([^']+)'. Please verify that the package.json has a valid "main" entry$/);if(l){const f=l[1],i=b(t,f,e);if(i)return i}}const a=b(t,r,e);if(a)return a}throw s}},"createTsExtensionResolver"),I="at cjsPreparseModuleExports (node:internal",ce=c(t=>{const e=t.stack.split(`
pages2.2_1       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
pages2.2_1       | 
pages2.2_1       | Error: Cannot find module 'rusty-store-kv'
pages2.2_1       | Require stack:
pages2.2_1       | - /opt/etherpad-lite/node_modules/.pnpm/ueberdb2@4.2.103/node_modules/ueberdb2/dist/index.js
pages2.2_1       | - /opt/etherpad-lite/src/node/db/DB.ts
pages2.2_1       | - /opt/etherpad-lite/src/node/server.ts
pages2.2_1       |     at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
pages2.2_1       |     at nextResolveSimple (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:3:942)
pages2.2_1       |     at /opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:2:2486
pages2.2_1       |     at /opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:2:1560
pages2.2_1       |     at resolveTsPaths (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:3:760)
pages2.2_1       |     at Function._resolveFilename (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:3:1035)
pages2.2_1       |     at Module._load (node:internal/modules/cjs/loader:1074:27)
pages2.2_1       |     at TracingChannel.traceSync (node:diagnostics_channel:315:14)
pages2.2_1       |     at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
pages2.2_1       |     at Module.require (node:internal/modules/cjs/loader:1339:12) {
pages2.2_1       |   code: 'MODULE_NOT_FOUND',
pages2.2_1       |   requireStack: [
pages2.2_1       |     '/opt/etherpad-lite/node_modules/.pnpm/ueberdb2@4.2.103/node_modules/ueberdb2/dist/index.js',
pages2.2_1       |     '/opt/etherpad-lite/src/node/db/DB.ts',
pages2.2_1       |     '/opt/etherpad-lite/src/node/server.ts'
pages2.2_1       |   ]
pages2.2_1       | }
pages2.2_1       | 
pages2.2_1       | Node.js v22.8.0
pages2.2_1       | /opt/etherpad-lite/src:
pages2.2_1       |  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ep_etherpad-lite@2.2.2 prod: `cross-env NODE_ENV=production node --require tsx/cjs node/server.ts`
pages2.2_1       | Exit status 1
pages2.2_1       |  ELIFECYCLE  Command failed with exit code 1.
    ...
Node.js v22.8.0

@SamTV12345
Copy link
Member

Description When building the Docker image for Etherpad Lite 2.2.2 from the official GitHub source, the build fails with a MODULE_NOT_FOUND error for the rusty-store-kv module. This issue does not occur when running pnpm run prod locally, but it consistently fails in the Docker environment.

To Reproduce Steps to reproduce the behavior: download the the Etherpad Lite repository (v2.2.2) zip. Build a Docker image using the provided Dockerfile. Start the container with docker-compose up with the build context refering to the local Dockerfile. Observe the error during startup.

Expected behavior Ther etherpad should run with mongodb connection by considering the settings.json file Screenshots If applicable, add screenshots to help explain your problem.

Server (please complete the following information):

  • Etherpad version: 2.2.2
  • OS: Ubuntu 22
  • Node.js version (22):
  • npm version (10.8):
  • Is the server free of plugins: yes

Additional context

Using skin "colibris" in dir: /opt/etherpad-lite/src/static/skins/colibris
pages2.2_1       | [2024-09-07T12:33:22.456] [WARN] settings - DirtyDB is used. This is not recommended for production. File location: /opt/etherpad-lite/var/dirty.db
pages2.2_1       | [2024-09-07T12:33:22.457] [INFO] settings - Random string used for versioning assets: c4b3f3b9
pages2.2_1       | /opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:2
pages2.2_1       | //# sourceMappingURL=data:application/json;base64,`,N=c(()=>process.sourceMapsEnabled??!0,"shouldApplySourceMap"),S=c(({code:t,map:e})=>t+Z+Buffer.from(JSON.stringify(e),"utf8").toString("base64"),"inlineSourceMap"),q=[".cts",".mts",".ts",".tsx",".jsx"],ee=[".js",".cjs",".mjs"],C=[".ts",".tsx",".jsx"],w=c((t,e,r,n)=>{const s=Object.getOwnPropertyDescriptor(t,e);s?.set?t[e]=r:(!s||s.configurable)&&Object.defineProperty(t,e,{value:r,enumerable:s?.enumerable||n?.enumerable,writable:n?.writable??(s?s.writable:!0),configurable:n?.configurable??(s?s.configurable:!0)})},"safeSet"),te=c((t,e,r)=>{const n=e[".js"],s=c((a,o)=>{if(t.enabled===!1)return n(a,o);const[l,f]=o.split("?");if((new URLSearchParams(f).get("namespace")??void 0)!==r)return n(a,o);U.parent?.send&&U.parent.send({type:"dependency",path:l});const d=q.some(h=>l.endsWith(h)),P=ee.some(h=>l.endsWith(h));if(!d&&!P)return n(a,l);let u=G.readFileSync(l,"utf8");if(l.endsWith(".cjs")){const h=v.transformDynamicImport(o,u);h&&(u=N()?S(h):h.code)}else if(d||v.isESM(u)){const h=v.transformSync(u,o,{tsconfigRaw:exports.fileMatcher?.(l)});u=N()?S(h):h.code}a._compile(u,l)},"transformer");w(e,".js",s);for(const a of C)w(e,a,s,{enumerable:!r,writable:!0,configurable:!0});return w(e,".mjs",s,{writable:!0,configurable:!0}),()=>{e[".js"]===s&&(e[".js"]=n);for(const a of[...C,".mjs"])e[a]===s&&delete e[a]}},"createExtensions"),se=c(t=>e=>{if((e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),_.test(e)){let r=m.join(e,"index.js");e.startsWith("./")&&(r=`./${r}`);try{return t(r)}catch{}}try{return t(e)}catch(r){const n=r;if(n.code==="MODULE_NOT_FOUND")try{return t(`${e}${m.sep}index.js`)}catch{}throw n}},"createImplicitResolver"),A=[".js",".json"],J=[".ts",".tsx",".jsx"],ne=[...J,...A],re=[...A,...J],g=Object.create(null);g[".js"]=[".ts",".tsx",".js",".jsx"],g[".jsx"]=[".tsx",".ts",".jsx",".js"],g[".cjs"]=[".cts"],g[".mjs"]=[".mts"];const Q=c(t=>{const e=t.split("?"),r=e[1]?`?${e[1]}`:"",[n]=e,s=m.extname(n),a=[],o=g[s];if(o){const f=n.slice(0,-s.length);a.push(...o.map(i=>f+i+r))}const l=!(t.startsWith(E)||y(n))||n.includes($)||n.includes("/node_modules/")?re:ne;return a.push(...l.map(f=>n+f+r)),a},"mapTsExtensions"),b=c((t,e,r)=>{if(_.test(e)||!r&&!exports.allowJs)return;const n=Q(e);if(n)for(const s of n)try{return t(s)}catch(a){const{code:o}=a;if(o!=="MODULE_NOT_FOUND"&&o!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw a}},"resolveTsFilename"),ae=c((t,e)=>r=>{if(y(r)){const n=b(t,r,e);if(n)return n}try{return t(r)}catch(n){const s=n;if(s.code==="MODULE_NOT_FOUND"){if(typeof s.path=="string"&&s.path.endsWith(`${m.sep}package.json`)){const o=s.message.match(/^Cannot find module '([^']+)'$/);if(o){const f=o[1],i=b(t,f,e);if(i)return i}const l=s.message.match(/^Cannot find module '([^']+)'. Please verify that the package.json has a valid "main" entry$/);if(l){const f=l[1],i=b(t,f,e);if(i)return i}}const a=b(t,r,e);if(a)return a}throw s}},"createTsExtensionResolver"),I="at cjsPreparseModuleExports (node:internal",ce=c(t=>{const e=t.stack.split(`
pages2.2_1       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
pages2.2_1       | 
pages2.2_1       | Error: Cannot find module 'rusty-store-kv'
pages2.2_1       | Require stack:
pages2.2_1       | - /opt/etherpad-lite/node_modules/.pnpm/ueberdb2@4.2.103/node_modules/ueberdb2/dist/index.js
pages2.2_1       | - /opt/etherpad-lite/src/node/db/DB.ts
pages2.2_1       | - /opt/etherpad-lite/src/node/server.ts
pages2.2_1       |     at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
pages2.2_1       |     at nextResolveSimple (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:3:942)
pages2.2_1       |     at /opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:2:2486
pages2.2_1       |     at /opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:2:1560
pages2.2_1       |     at resolveTsPaths (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:3:760)
pages2.2_1       |     at Function._resolveFilename (/opt/etherpad-lite/node_modules/.pnpm/tsx@4.17.0/node_modules/tsx/dist/register-C1urN2EO.cjs:3:1035)
pages2.2_1       |     at Module._load (node:internal/modules/cjs/loader:1074:27)
pages2.2_1       |     at TracingChannel.traceSync (node:diagnostics_channel:315:14)
pages2.2_1       |     at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
pages2.2_1       |     at Module.require (node:internal/modules/cjs/loader:1339:12) {
pages2.2_1       |   code: 'MODULE_NOT_FOUND',
pages2.2_1       |   requireStack: [
pages2.2_1       |     '/opt/etherpad-lite/node_modules/.pnpm/ueberdb2@4.2.103/node_modules/ueberdb2/dist/index.js',
pages2.2_1       |     '/opt/etherpad-lite/src/node/db/DB.ts',
pages2.2_1       |     '/opt/etherpad-lite/src/node/server.ts'
pages2.2_1       |   ]
pages2.2_1       | }
pages2.2_1       | 
pages2.2_1       | Node.js v22.8.0
pages2.2_1       | /opt/etherpad-lite/src:
pages2.2_1       |  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ep_etherpad-lite@2.2.2 prod: `cross-env NODE_ENV=production node --require tsx/cjs node/server.ts`
pages2.2_1       | Exit status 1
pages2.2_1       |  ELIFECYCLE  Command failed with exit code 1.
    ...
Node.js v22.8.0

Hi sorry for the issues. Please try the just released 2.2.4 . The version was automatically upgraded and ueberdb2 included a breaking change because I wanted to integrate it deeply in Etherpad for the next release. This is released in 2.2.4

@bharath-naik
Copy link
Author

Thanks @SamTV12345 That got fixed

@dcht00
Copy link
Collaborator

dcht00 commented Sep 9, 2024

Fwiw, got the same issue when trying a fresh install of 2.1.1, which has been suggested to evade the iframe problems in 2.2.4 :)

@SamTV12345
Copy link
Member

Fwiw, got the same issue when trying a fresh install of 2.1.1, which has been suggested to evade the iframe problems in 2.2.4 :)

I sometimes hate npm and package.json. Remove the ^ before the version in ueberdb and do pnpm install. That should fix the problem.

@SamTV12345
Copy link
Member

I'll release a fix for ueberdb2 and do a major version bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants