formio / formio

A Form and Data Management Platform for Progressive Web Applications.

Home Page:https://form.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker container error. node:domain module not found

shuhaib-aot opened this issue · comments

2023-12-04 16:17:45 
2023-12-04 16:17:46   formio:db Opening new connection to mongodb://mongo:27017/formio +0ms
2023-12-04 16:17:46   __  __                          _       __
2023-12-04 16:17:46  / / / _| ___  _ __ _ __ ___     (_) ___  \ \
2023-12-04 16:17:46 / / | |_ / _ \| '__| '_ ` _ \    | |/ _ \  \ \
2023-12-04 16:17:46 \ \ |  _| (_) | |  | | | | | | _ | | (_) | / /
2023-12-04 16:17:46  \_\|_|  \___/|_|  |_| |_| |_|(_)|_|\___/ /_/
2023-12-04 16:17:46 
2023-12-04 16:17:46 Welcome to the Form.io application server!
2023-12-04 16:17:46 
2023-12-04 16:17:46   - Help: https://help.form.io
2023-12-04 16:17:46   - Code: https://github.com/formio
2023-12-04 16:17:46   - Love: https://form.io
2023-12-04 16:17:46 
2023-12-04 16:17:46   formio:db Connection successful +46ms
2023-12-04 16:17:46   formio:db Schema collection opened +2ms
2023-12-04 16:17:47 Checking for db setup.
2023-12-04 16:17:47   formio:db Collections found: 7 +809ms
2023-12-04 16:17:47  > Setup complete.
2023-12-04 16:17:47 
2023-12-04 16:17:47 Determine MongoDB compatibility.
2023-12-04 16:17:47 Collation indexes are supported.
2023-12-04 16:17:47   formio:db Update found: 1.0.0.js +72ms
2023-12-04 16:17:47   formio:db Update found: 1.1.0.js +1ms
2023-12-04 16:17:47   formio:db Update found: 2.0.0.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.0.1.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.1.0.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.2.0.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.2.1.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.2.2.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.3.0.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.3.1.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.3.2.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.4.0.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.4.1.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.4.2.js +0ms
2023-12-04 16:17:47   formio:db Update found: 2.4.3.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.0.js +1ms
2023-12-04 16:17:47   formio:db Update found: 3.0.1.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.2.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.3.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.4.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.5.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.6.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.7.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.8.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.0.9.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.1.0.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.1.1.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.1.2.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.1.3.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.1.4.js +0ms
2023-12-04 16:17:47   formio:db Update found: 3.1.5.js +0ms
2023-12-04 16:17:47   formio:db Final updates +1ms
2023-12-04 16:17:47   formio:db [
2023-12-04 16:17:47   formio:db   {
2023-12-04 16:17:47   formio:db     _id: new ObjectId("656da99c777686c08eebf9ad"),
2023-12-04 16:17:47   formio:db     key: 'formio',
2023-12-04 16:17:47   formio:db     isLocked: false,
2023-12-04 16:17:47   formio:db     version: '3.1.4'
2023-12-04 16:17:47   formio:db   }
2023-12-04 16:17:47   formio:db ] +6ms
2023-12-04 16:17:47   formio:db Lock engaged +11ms
2023-12-04 16:17:47 Checking for db schema updates.
2023-12-04 16:17:47   formio:db Current database (3.1.4) and Pending code sversions (3.1.4) are the same. +0ms
2023-12-04 16:17:47  > No updates found.
2023-12-04 16:17:47 
2023-12-04 16:17:47   formio:db Lock unlocked +4ms
2023-12-04 16:17:47   formio:db Lock unlocked +3ms
2023-12-04 16:17:47 Initializing API Server.
2023-12-04 16:17:47 (node:1) [MONGOOSE] DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7. Use `mongoose.set('strictQuery', false);` if you want to prepare for this change. Or use `mongoose.set('strictQuery', true);` to suppress this warning.
2023-12-04 16:17:47 (Use `node --trace-deprecation ...` to show where the warning was created)
2023-12-04 16:17:47  > Mongo connection established.
2023-12-04 16:17:49 (node:1) UnhandledPromiseRejectionWarning: Error: Cannot find module 'node:domain'
2023-12-04 16:17:49 Require stack:
2023-12-04 16:17:49 - /app/node_modules/formio-workers/Formio.js
2023-12-04 16:17:49 - /app/node_modules/formio-workers/Worker.js
2023-12-04 16:17:49 - /app/node_modules/formio-workers/Thread.js
2023-12-04 16:17:49 - /app/src/worker/Worker.js
2023-12-04 16:17:49 - /app/src/util/email.js
2023-12-04 16:17:49 - /app/src/actions/EmailAction.js
2023-12-04 16:17:49 - /app/src/actions/actions.js
2023-12-04 16:17:49 - /app/index.js
2023-12-04 16:17:49 - /app/server.js
2023-12-04 16:17:49 - /app/main.js
2023-12-04 16:17:49     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
2023-12-04 16:17:49     at Function.Module._load (internal/modules/cjs/loader.js:730:27)
2023-12-04 16:17:49     at Module.require (internal/modules/cjs/loader.js:957:19)
2023-12-04 16:17:49     at require (internal/modules/cjs/helpers.js:88:18)
2023-12-04 16:17:49     at Object.<anonymous> (/app/node_modules/formio-workers/Formio.js:6:16)
2023-12-04 16:17:49     at Module._compile (internal/modules/cjs/loader.js:1068:30)
2023-12-04 16:17:49     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
2023-12-04 16:17:49     at Module.load (internal/modules/cjs/loader.js:933:32)
2023-12-04 16:17:49     at Function.Module._load (internal/modules/cjs/loader.js:774:14)
2023-12-04 16:17:49     at Module.require (internal/modules/cjs/loader.js:957:19)
2023-12-04 16:17:49 (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
2023-12-04 16:17:49 (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@travist which node version is we need to use for 3.3.5 version

Hey @shuhaib-aot and @Shabinder we currently bundle node 18.x with our enterprise offering, that should work for OSS Formio 3.3.5

@brendanbond I am using node v18.19.0 in my host :
image

But error, still remains, also in logs node v 14 is being mentioned within docker logs, check below

formio-formio-1  | Initializing API Server.
formio-formio-1  | (node:1) [MONGOOSE] DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7. Use `mongoose.set('strictQuery', false);` if you want to prepare for this change. Or use `mongoose.set('strictQuery', true);` to suppress this warning.
formio-formio-1  | (Use `node --trace-deprecation ...` to show where the warning was created)
formio-mongo-1   | 2023-12-13T15:34:18.737+0000 I  NETWORK  [listener] connection accepted from 192.168.240.3:38536 #3 (3 connections now open)
formio-mongo-1   | 2023-12-13T15:34:18.740+0000 I  NETWORK  [conn3] received client metadata from 192.168.240.3:38536 conn3: { driver: { name: "nodejs|Mongoose", version: "4.17.1|6.12.3" }, platform: "Node.js v14.17.0, LE", os: { name: "linux", architecture: "arm64", version: "5.15.0-1047-oracle", type: "Linux" } }
formio-formio-1  |  > Mongo connection established.
formio-formio-1  | (node:1) UnhandledPromiseRejectionWarning: Error: Cannot find module 'node:domain'
formio-formio-1  | Require stack:
formio-formio-1  | - /app/node_modules/formio-workers/Formio.js
formio-formio-1  | - /app/node_modules/formio-workers/Worker.js
formio-formio-1  | - /app/node_modules/formio-workers/Thread.js
formio-formio-1  | - /app/src/worker/Worker.js
formio-formio-1  | - /app/src/util/email.js
formio-formio-1  | - /app/src/actions/EmailAction.js
formio-formio-1  | - /app/src/actions/actions.js
formio-formio-1  | - /app/index.js
formio-formio-1  | - /app/server.js
formio-formio-1  | - /app/main.js
formio-formio-1  |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
formio-formio-1  |     at Function.Module._load (internal/modules/cjs/loader.js:730:27)
formio-formio-1  |     at Module.require (internal/modules/cjs/loader.js:957:19)
formio-formio-1  |     at require (internal/modules/cjs/helpers.js:88:18)
formio-formio-1  |     at Object.<anonymous> (/app/node_modules/formio-workers/Formio.js:6:16)
formio-formio-1  |     at Module._compile (internal/modules/cjs/loader.js:1068:30)
formio-formio-1  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
formio-formio-1  |     at Module.load (internal/modules/cjs/loader.js:933:32)
formio-formio-1  |     at Function.Module._load (internal/modules/cjs/loader.js:774:14)
formio-formio-1  |     at Module.require (internal/modules/cjs/loader.js:957:19)
formio-formio-1  | (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
formio-formio-1  | (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Your host won't matter here, you'll need to update the Dockerfile to pull an image that includes Node LTS. In fact, you could even make a PR to modify the Dockerfile to (a) pull down a newer version of Alpine and (b) download Node from the APK edge repositories, something like

RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories &&\
    apk add --upgrade \
    nodejs npm nghttp2 nghttp2-libs

I also encountered this problem. The images I created before were able to start normally. However, after about a year, when I re-imaged and started, I got this error.