State cannot be written to file when set to do so in the configuration. The process exists with a FATAL error due to an uncaught exception, probably due to a coding error.
The state should have been written to the file /var/lib/whiteflag/whiteflag.state, and the process should have continued.
Actual result
The process exists with a fatal error and exit code 2.
npm[114613]: [FATAL] api: UNCAUGHT EXCEPTION: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type boolean
npm[114613]: at Object.open (fs.js:408:3)
npm[114613]: at Object.writeFile (fs.js:1172:6)
npm[114613]: at saveState (/srv/src/whiteflag-api/lib/protocol/state.js:237:12)
Description
State cannot be written to file when set to do so in the configuration. The process exists with a FATAL error due to an uncaught exception, probably due to a coding error.
Environment / Versions
Software
OS: Ubuntu 16.04.6 LTS Node.js:
v10.20.1
whiteflag-api:v1.0.0-beta
Blockchain
N/A
Symptoms and Problem details
Steps to reproduce
whiteflag.toml
configuration file to save the state to the specified file:whiteflag-api
service.Expected result
The state should have been written to the file
/var/lib/whiteflag/whiteflag.state
, and the process should have continued.Actual result
The process exists with a fatal error and exit code
2
.Also, the exit code
2
is (correctly) interpreted by the system asINVALIDARGUMENT
i.a.w. https://freedesktop.org/software/systemd/man/systemd.exec.html#id-1.20.8, but that is not in line with the root cause of the error.