VROOM-Project/vroom-express

vroom-express 1.9.0 crashes on start

Closed this issue · 7 comments

Hi,

vromm-express crashes on "docker-compose up" with the following logs:

vroom      |
vroom      | > vroom-express@0.8.0 start /vroom-express
vroom      | > node src/index.js
vroom      |
vroom      | /vroom-express/node_modules/rotating-file-stream/index.js:557
vroom      |             throw new Error(`Don't know how to handle 'options.${field}' type: ${type}`);
vroom      |             ^
vroom      |
vroom      | Error: Don't know how to handle 'options.size' type: undefined
vroom      |     at Object.size (/vroom-express/node_modules/rotating-file-stream/index.js:557:19)
vroom      |     at checkOpts (/vroom-express/node_modules/rotating-file-stream/index.js:660:20)
vroom      |     at Object.createStream (/vroom-express/node_modules/rotating-file-stream/index.js:702:18)
vroom      |     at Object.<anonymous> (/vroom-express/src/index.js:32:29)
vroom      |     at Module._compile (internal/modules/cjs/loader.js:999:30)
vroom      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
vroom      |     at Module.load (internal/modules/cjs/loader.js:863:32)
vroom      |     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
vroom      |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
vroom      |     at internal/main/run_main_module.js:17:47
vroom      | npm ERR! code ELIFECYCLE
vroom      | npm ERR! errno 1
vroom      | npm ERR! vroom-express@0.8.0 start: `node src/index.js`
vroom      | npm ERR! Exit status 1
vroom      | npm ERR!
vroom      | npm ERR! Failed at the vroom-express@0.8.0 start script.
vroom      | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
vroom      |
vroom      | npm ERR! A complete log of this run can be found in:
vroom      | npm ERR!     /root/.npm/_logs/2021-04-01T20_56_18_514Z-debug.log
vroom exited with code 1

Is there any options which should be set in the config?

Did you do any change to the default config.yml file? Is there some more output in the debug file pointed out at the end?

this is the config.yml:

  geometry: false # retrieve geometry (-g)
  threads: 4 # number of threads to use (-t)
  explore: 5 # exploration level to use (0..5) (-x)
  limit: '1mb' # max request size
  logdir: '/..' # the path for the logs relative to ./src
  maxlocations: 1000 # max number of jobs/shipments locations
  maxvehicles: 200 # max number of vehicles
  override: true # allow cli options override (-g, -t and -x)
  path: '' # VROOM path (if not in $PATH)
  port: 3000 # expressjs port
  router: 'osm' # routing backend (osrm, libosrm or ors)
  timeout: 300000 # milli-seconds
  baseurl: '/' #base url for api
routingServers:
  osrm:
    car:
      host: '0.0.0.0'
      port: '5000'
    bike:
      host: '0.0.0.0'
      port: '5000'
    foot:
      host: '0.0.0.0'
      port: '5000'
  ors:
    driving-car:
      host: 'ors-app'
      port: '8080'
    driving-hgv:
      host: 'ors-app'
      port: '8080'
    cycling-regular:
      host: 'ors-app'
      port: '8080'
    cycling-mountain:
      host: 'ors-app'
      port: '8080'
    cycling-road:
      host: 'ors-app'
      port: '8080'
    cycling-electric:
      host: 'ors-app'
      port: '8080'
    foot-walking:
      host: 'ors-app'
      port: '8080'
    foot-hiking:
      host: 'ors-app'
      port: '8080'

this is the complete log output:

vroom      | > vroom-express@0.8.0 start /vroom-express
vroom      | > node src/index.js
vroom      |
vroom      | /vroom-express/node_modules/rotating-file-stream/index.js:557
vroom      |             throw new Error(`Don't know how to handle 'options.${field}' type: ${type}`);
vroom      |             ^
vroom      |
vroom      | Error: Don't know how to handle 'options.size' type: undefined
vroom      |     at Object.size (/vroom-express/node_modules/rotating-file-stream/index.js:557:19)
vroom      |     at checkOpts (/vroom-express/node_modules/rotating-file-stream/index.js:660:20)
vroom      |     at Object.createStream (/vroom-express/node_modules/rotating-file-stream/index.js:702:18)
vroom      |     at Object.<anonymous> (/vroom-express/src/index.js:32:29)
vroom      |     at Module._compile (internal/modules/cjs/loader.js:999:30)
vroom      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
vroom      |     at Module.load (internal/modules/cjs/loader.js:863:32)
vroom      |     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
vroom      |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
vroom      |     at internal/main/run_main_module.js:17:47
vroom      | npm ERR! code ELIFECYCLE
vroom      | npm ERR! errno 1
vroom      | npm ERR! vroom-express@0.8.0 start: `node src/index.js`
vroom      | npm ERR! Exit status 1
vroom      | npm ERR!
vroom      | npm ERR! Failed at the vroom-express@0.8.0 start script.
vroom      | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
vroom      |
vroom      | npm ERR! A complete log of this run can be found in:
vroom      | npm ERR!     /root/.npm/_logs/2021-04-02T08_08_25_684Z-debug.log
vroom exited with code 1

Hm.. thought I tried that release before well.. release. Let me do a quick docker run

Yeah, can reproduce.. feel free to debug and fix @haraldkofler , else someone will look at it soonish as time allows

Now I can't reproduce anymore with a fresh install..

docker-compose up -d

Pulling vroom (vroomvrp/vroom-docker:v1.9.0)...
v1.9.0: Pulling from vroomvrp/vroom-docker
6f28985ad184: Pull complete
45d607bea48c: Pull complete
41fb1554a069: Pull complete
b0c9c4030d8b: Pull complete
5e269c64de4a: Pull complete
22046ff18f21: Pull complete
fcbf40ba4a95: Pull complete
a0b295f6b97e: Pull complete
5a8573d01d38: Pull complete
Digest: sha256:f66839afc977185a66ec944d2cd0665b2453bc3401aab65dedc06d99125df801
Status: Downloaded newer image for vroomvrp/vroom-docker:v1.9.0
Recreating vroom ... done

docker logs vroom

> vroom-express@0.8.0 start /vroom-express
> node src/index.js

vroom-express listening on port 3000!

All good. Remove the config folder and re-try. Closing for now, since this is not a vroom-express issue it seems. There's a dedicated repo for docker: https://github.com/VROOM-Project/vroom-docker

tl;dr;
Yep, deleting the config.yaml fixes the issue, or adding the following line

cliArgs:
logsize: '100M' # max log file size for rotation

I found the origin of the problem:
The exception is caused by a missing configuration in the conf/config.yaml:

logsize: '100M' # max log file size for rotation

This configuration is not present in the vroom-express v0.7.0.

So if you first launch a vroom-docker:1.8.0 it creates a config.yaml without this config (because 1.8.0 uses vroom-express v0.7.0 and does not need this configuration item).
If you then switch to vroom-docker:1.9.0 without removing the config.yaml, this existing config file is loaded, but without the necessary config item.

@haraldkofler thanks for the feedback, migth help others!