Hi there, im using the external modules of the function node to work some magic with Jsonata, all works well for sometime, but when the server need to be re-started it trows some errors trying to install jsonata;
Im hosting NR on Elastic-Beanstalk
May 7 19:03:34 ip-172-31-81-152 web: > nova-node-red@1.1.0 start
May 7 19:03:34 ip-172-31-81-152 web: > ./node_modules/.bin/node-red -s ./settings.js
May 7 19:03:36 ip-172-31-81-152 web: prepop flows
May 7 19:03:36 ip-172-31-81-152 web: 7 May 19:03:36 - [info]
May 7 19:03:36 ip-172-31-81-152 web: Welcome to Node-RED
May 7 19:03:36 ip-172-31-81-152 web: ===================
May 7 19:03:36 ip-172-31-81-152 web: 7 May 19:03:36 - [info] Node-RED version: v3.0.2
May 7 19:03:36 ip-172-31-81-152 web: 7 May 19:03:36 - [info] Node.js version: v16.16.0
May 7 19:03:36 ip-172-31-81-152 web: 7 May 19:03:36 - [info] Linux 4.14.287-215.504.amzn2.x86_64 x64 LE
May 7 19:03:37 ip-172-31-81-152 web: 7 May 19:03:37 - [info] Loading palette nodes
May 7 19:03:38 ip-172-31-81-152 web: 7 May 19:03:38 - [info] Settings file : /var/app/current/settings.js
May 7 19:03:38 ip-172-31-81-152 web: 7 May 19:03:38 - [info] Context store : 'default' [module=memory]
May 7 19:03:39 ip-172-31-81-152 web: 7 May 19:03:39 - [info] Server now running at http://127.0.0.1:8080/
May 7 19:03:40 ip-172-31-81-152 web: 7 May 19:03:40 - [warn]
May 7 19:03:40 ip-172-31-81-152 web: ---------------------------------------------------------------------
May 7 19:03:40 ip-172-31-81-152 web: Your flow credentials file is encrypted using a system-generated key.
May 7 19:03:40 ip-172-31-81-152 web: If the system-generated key is lost for any reason, your credentials
May 7 19:03:40 ip-172-31-81-152 web: file will not be recoverable, you will have to delete it and re-enter
May 7 19:03:40 ip-172-31-81-152 web: your credentials.
May 7 19:03:40 ip-172-31-81-152 web: You should set your own key using the 'credentialSecret' option in
May 7 19:03:40 ip-172-31-81-152 web: your settings file. Node-RED will then re-encrypt your credentials
May 7 19:03:40 ip-172-31-81-152 web: file using your chosen key the next time you deploy a change.
May 7 19:03:40 ip-172-31-81-152 web: ---------------------------------------------------------------------
May 7 19:03:40 ip-172-31-81-152 web: 7 May 19:03:40 - [info] Starting flows
May 7 19:03:41 ip-172-31-81-152 web: 7 May 19:03:41 - [info] Started flows
May 7 19:03:43 ip-172-31-81-152 web: 7 May 19:03:43 - [info] Stopping flows
May 7 19:03:43 ip-172-31-81-152 web: 7 May 19:03:43 - [info] Stopped flows
May 7 19:03:45 ip-172-31-81-152 web: > nova-node-red@1.1.0 start
May 7 19:03:45 ip-172-31-81-152 web: > ./node_modules/.bin/node-red -s ./settings.js
May 7 19:03:47 ip-172-31-81-152 web: prepop flows
May 7 19:03:47 ip-172-31-81-152 web: 7 May 19:03:47 - [info]
May 7 19:03:47 ip-172-31-81-152 web: Welcome to Node-RED
May 7 19:03:47 ip-172-31-81-152 web: ===================
May 7 19:03:47 ip-172-31-81-152 web: 7 May 19:03:47 - [info] Node-RED version: v3.0.2
May 7 19:03:47 ip-172-31-81-152 web: 7 May 19:03:47 - [info] Node.js version: v16.16.0
May 7 19:03:47 ip-172-31-81-152 web: 7 May 19:03:47 - [info] Linux 4.14.287-215.504.amzn2.x86_64 x64 LE
May 7 19:03:47 ip-172-31-81-152 web: 7 May 19:03:47 - [info] Loading palette nodes
May 7 19:03:48 ip-172-31-81-152 web: save settings
May 7 19:03:48 ip-172-31-81-152 web: 7 May 19:03:48 - [info] Settings file : /var/app/current/settings.js
May 7 19:03:48 ip-172-31-81-152 web: 7 May 19:03:48 - [info] Context store : 'default' [module=memory]
May 7 19:03:48 ip-172-31-81-152 web: 7 May 19:03:48 - [info] Server now running at http://127.0.0.1:8080/
May 7 19:03:49 ip-172-31-81-152 web: 7 May 19:03:49 - [warn]
May 7 19:03:49 ip-172-31-81-152 web: ---------------------------------------------------------------------
May 7 19:03:49 ip-172-31-81-152 web: Your flow credentials file is encrypted using a system-generated key.
May 7 19:03:49 ip-172-31-81-152 web: If the system-generated key is lost for any reason, your credentials
May 7 19:03:49 ip-172-31-81-152 web: file will not be recoverable, you will have to delete it and re-enter
May 7 19:03:49 ip-172-31-81-152 web: your credentials.
May 7 19:03:49 ip-172-31-81-152 web: You should set your own key using the 'credentialSecret' option in
May 7 19:03:49 ip-172-31-81-152 web: your settings file. Node-RED will then re-encrypt your credentials
May 7 19:03:49 ip-172-31-81-152 web: file using your chosen key the next time you deploy a change.
May 7 19:03:49 ip-172-31-81-152 web: ---------------------------------------------------------------------
May 7 19:03:49 ip-172-31-81-152 web: 7 May 19:03:49 - [info] Installing module: mongodb, version: latest
May 7 19:03:49 ip-172-31-81-152 web: 7 May 19:03:49 - [info] Installing module: jsonata, version: latest
May 7 19:03:49 ip-172-31-81-152 web: 7 May 19:03:49 - [info] Installing module: @google-cloud/dialogflow, version: latest
May 7 19:03:49 ip-172-31-81-152 web: 7 May 19:03:49 - [info] Installing module: moment, version: latest
May 7 19:03:49 ip-172-31-81-152 web: 7 May 19:03:49 - [info] Installing module: openai, version: latest
May 7 19:13:35 ip-172-31-81-152 web: 7 May 19:13:35 - [error] Installation of module @google-cloud/dialogflow failed:
May 7 19:13:35 ip-172-31-81-152 web: 7 May 19:13:35 - [error] ------------------------------------------
May 7 19:13:35 ip-172-31-81-152 web: 7 May 19:13:35 - [error] npm WARN config production Use `--omit=dev` instead.
May 7 19:13:35 ip-172-31-81-152 web: 7 May 19:13:35 - [error] ------------------------------------------
May 7 19:13:43 ip-172-31-81-152 web: 7 May 19:13:43 - [info] Installed module: moment
May 7 19:13:43 ip-172-31-81-152 web: save settings
May 7 19:13:43 ip-172-31-81-152 web: 7 May 19:13:43 - [info] Installed module: jsonata
May 7 19:13:43 ip-172-31-81-152 web: 7 May 19:13:43 - [info] Installed module: openai
May 7 19:13:43 ip-172-31-81-152 web: 7 May 19:13:43 - [info] Installed module: mongodb
May 7 19:13:43 ip-172-31-81-152 web: 7 May 19:13:43 - [info] Failed to load external modules required by this flow:
May 7 19:13:43 ip-172-31-81-152 web: 7 May 19:13:43 - [info] - @google-cloud/dialogflow [unexpected_error]
May 7 19:13:43 ip-172-31-81-152 web: save settings
May 7 19:13:44 ip-172-31-81-152 web: save settings
May 7 19:13:44 ip-172-31-81-152 web: save settings
May 7 19:14:38 ip-172-31-81-152 web: save settings
May 7 19:14:40 ip-172-31-81-152 web: save flow
May 7 19:14:41 ip-172-31-81-152 web: 7 May 19:14:41 - [info] Stopping flows
May 7 19:14:41 ip-172-31-81-152 web: 7 May 19:14:41 - [info] Stopped flows
May 7 19:14:41 ip-172-31-81-152 web: 7 May 19:14:41 - [info] Updated flows
May 7 19:14:41 ip-172-31-81-152 web: 7 May 19:14:41 - [info] Installing module: jsonata, version: latest
May 7 19:14:41 ip-172-31-81-152 web: 7 May 19:14:41 - [info] Installing module: @google-cloud/dialogflow, version: latest
May 7 19:14:41 ip-172-31-81-152 web: 7 May 19:14:41 - [info] Installing module: moment, version: latest
May 7 19:14:41 ip-172-31-81-152 web: 7 May 19:14:41 - [info] Installing module: openai, version: latest
May 7 19:14:48 ip-172-31-81-152 web: 7 May 19:14:48 - [error] Installation of module jsonata failed:
May 7 19:14:48 ip-172-31-81-152 web: 7 May 19:14:48 - [error] ------------------------------------------
May 7 19:14:48 ip-172-31-81-152 web: 7 May 19:14:48 - [error] npm WARN config production Use `--omit=dev` instead.
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tar ENOENT: Cannot cd into '/var/app/current/node_modules/node-red/node_modules/@node-red/util/node_modules/jsonata'
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tar ENOENT: Cannot cd into '/var/app/current/node_modules/node-red/node_modules/@node-red/util/node_modules/jsonata'
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tarball tarball data for jsonata@https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz (sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA==) seems to be corrupted. Trying again.
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tarball tarball data for jsonata@https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz (sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA==) seems to be corrupted. Trying again.
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! code ENOENT
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! syscall lstat
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! path /home/webapp/.npm/_cacache/content-v2/sha512/64/7d/933d874d3f625e70e97f1efac7e3b5dcfbd8a689b10c43862a2b2fc5fc5accfb66babdf6c6c5e097db7741f45afabaf1b0bfe8217f52b1581de2664d3dc0
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! errno -2
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! enoent ENOENT: no such file or directory, lstat '/home/webapp/.npm/_cacache/content-v2/sha512/64/7d/933d874d3f625e70e97f1efac7e3b5dcfbd8a689b10c43862a2b2fc5fc5accfb66babdf6c6c5e097db7741f45afabaf1b0bfe8217f52b1581de2664d3dc0'
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! enoent This is related to npm not being able to find a file.
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! enoent
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! A complete log of this run can be found in:
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! /home/webapp/.npm/_logs/2023-05-07T19_14_43_237Z-debug-0.log
May 7 19:14:48 ip-172-31-81-152 web: 7 May 19:14:48 - [error] ------------------------------------------
May 7 19:14:49 ip-172-31-81-152 web: 7 May 19:14:49 - [info] Installed module: openai
May 7 19:14:49 ip-172-31-81-152 web: 7 May 19:14:49 - [info] Installed module: moment
May 7 19:14:54 ip-172-31-81-152 web: 7 May 19:14:54 - [info] Installed module: @google-cloud/dialogflow
May 7 19:14:54 ip-172-31-81-152 web: save settings
May 7 19:14:54 ip-172-31-81-152 web: 7 May 19:14:54 - [info] Failed to load external modules required by this flow:
May 7 19:14:54 ip-172-31-81-152 web: 7 May 19:14:54 - [info] - jsonata [unexpected_error]
May 7 19:15:07 ip-172-31-81-152 web: save flow
May 7 19:15:08 ip-172-31-81-152 web: 7 May 19:15:08 - [info] Stopping flows
May 7 19:15:08 ip-172-31-81-152 web: 7 May 19:15:08 - [info] Stopped flows
May 7 19:15:08 ip-172-31-81-152 web: 7 May 19:15:08 - [info] Updated flows
May 7 19:15:08 ip-172-31-81-152 web: 7 May 19:15:08 - [info] Installing module: jsonata, version: latest
May 7 19:15:08 ip-172-31-81-152 web: 7 May 19:15:08 - [info] Installing module: moment, version: latest
May 7 19:15:08 ip-172-31-81-152 web: 7 May 19:15:08 - [info] Installing module: openai, version: latest
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [info] Installed module: moment
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [info] Installed module: openai
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [info] Installed module: jsonata
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [info] Starting flows
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:48c52d7356034c3b] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:25c5f79ba22fe7fd] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:5d9e23f01c89a776] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:c3acc92d0cd28f2c] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:97e57ba62e4e7372] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:482b532b67055bd2] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:09884f403104359c] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:107cc6014eb69b72] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:a499299e8670eb64] Error: Module not allowed
May 7 19:15:13 ip-172-31-81-152 web: 7 May 19:15:13 - [error] [function:1a5c4ddf0106599e] Error: Module not allowed
I think the interesting part is this one;
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tar ENOENT: Cannot cd into '/var/app/current/node_modules/node-red/node_modules/@node-red/util/node_modules/jsonata'
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tar ENOENT: Cannot cd into '/var/app/current/node_modules/node-red/node_modules/@node-red/util/node_modules/jsonata'
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tarball tarball data for jsonata@https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz (sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA==) seems to be corrupted. Trying again.
May 7 19:14:48 ip-172-31-81-152 web: npm WARN tarball tarball data for jsonata@https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz (sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA==) seems to be corrupted. Trying again.
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! code ENOENT
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! syscall lstat
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! path /home/webapp/.npm/_cacache/content-v2/sha512/64/7d/933d874d3f625e70e97f1efac7e3b5dcfbd8a689b10c43862a2b2fc5fc5accfb66babdf6c6c5e097db7741f45afabaf1b0bfe8217f52b1581de2664d3dc0
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! errno -2
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! enoent ENOENT: no such file or directory, lstat '/home/webapp/.npm/_cacache/content-v2/sha512/64/7d/933d874d3f625e70e97f1efac7e3b5dcfbd8a689b10c43862a2b2fc5fc5accfb66babdf6c6c5e097db7741f45afabaf1b0bfe8217f52b1581de2664d3dc0'
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! enoent This is related to npm not being able to find a file.
May 7 19:14:48 ip-172-31-81-152 web: npm ERR! enoent
Maybe related to Jsonata being already available to other core nodes like the change node?