msimerson / Mail-Toaster-6

Mail Toaster 6
https://github.com/msimerson/Mail-Toaster-6/wiki
BSD 3-Clause "New" or "Revised" License
46 stars 16 forks source link

provisioning of haraka jail fails (Cannot find module 'nopt') #505

Closed kdkayat closed 2 years ago

kdkayat commented 2 years ago

Expected behavior

since all previous steps worked as documented, provision harakashould work

Observed behavior

   ***   installing Haraka   ***

jexec stage git clone --depth=1 https://github.com/haraka/Haraka.git /root/Haraka
Cloning into '/root/Haraka'...
remote: Enumerating objects: 417, done.
remote: Counting objects: 100% (417/417), done.
remote: Compressing objects: 100% (373/373), done.
remote: Total 417 (delta 19), reused 184 (delta 13), pack-reused 0
Receiving objects: 100% (417/417), 2.19 MiB | 10.18 MiB/s, done.
Resolving deltas: 100% (19/19), done.
jexec stage npm set user 0
jexec stage npm set -g unsafe-perm true
jexec stage npm install -g --only=prod /root/Haraka
npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'Haraka@2.8.28',
npm WARN EBADENGINE   required: { node: '>=14.18.2' },
npm WARN EBADENGINE   current: { node: 'v14.18.1', npm: '8.7.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'Haraka@2.8.28',
npm WARN EBADENGINE   required: { node: '>=14.18.2' },
npm WARN EBADENGINE   current: { node: 'v14.18.1', npm: '8.7.0' }
npm WARN EBADENGINE }

added 1 package, and audited 3 packages in 525ms

found 0 vulnerabilities
jexec stage bash -c cd /data && npm install --only=prod ws express haraka-plugin-log-reader haraka-plugin-known-senders haraka-plugin-aliases haraka-plugin-dmarc-perl
npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.

added 85 packages, and audited 86 packages in 9s

8 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

   ***   installing Haraka, stage 2   ***

jexec stage haraka -i /data
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'nopt'
Require stack:
- /root/Haraka/bin/haraka
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/root/Haraka/bin/haraka:9:14)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/root/Haraka/bin/haraka' ]
}

# jls
   JID  IP Address      Hostname                      Path
     3  172.16.15.3     dns                           /jails/dns
     5  172.16.15.4     mysql                         /jails/mysql
     7  172.16.15.16    redis                         /jails/redis
    11  172.16.15.48    dcc                           /jails/dcc
    13  172.16.15.13    rspamd                        /jails/rspamd
    15  172.16.15.8     vpopmail                      /jails/vpopmail
    17  172.16.15.15    dovecot                       /jails/dovecot
    21  172.16.15.17    geoip                         /jails/geoip
    25  172.16.15.254   haraka                        /jails/stage

# uname -a
FreeBSD 12.3-RELEASE FreeBSD 12.3-RELEASE r371126 GENERIC  amd64

Steps to reproduce

provision haraka
msimerson commented 2 years ago

working on it...

msimerson commented 2 years ago

fixed.