onokje / node-red-contrib-tesla

Node red nodes to control Tesla vehicles and devices
MIT License
20 stars 11 forks source link

Total node-red crash on initial configuration #7

Closed ybizeul closed 2 years ago

ybizeul commented 3 years ago

When configuring my login and password, and running the node, node-red crashes in a loop with the following exception :

geen token gevonden, ga nu call doen
5 Jan 08:24:42 - [info] Started modified flows
5 Jan 08:24:43 - [red] Uncaught Exception:
5 Jan 08:24:43 - TypeError: Cannot read property 'access_token' of undefined
    at Request._callback (/data/node_modules/teslajs/teslajs.js:377:96)
    at self.callback (/data/node_modules/teslajs/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/data/node_modules/teslajs/node_modules/request/request.js:877:8)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-docker@1.2.5 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-red-docker@1.2.5 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/.npm/_logs/2021-01-05T08_24_43_439Z-debug.log

Had to manually remove the module before starting node-red.

cat _logs/2021-01-05T08_24_43_439Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   '--no-update-notifier',
1 verbose cli   '--no-fund',
1 verbose cli   'start',
1 verbose cli   '--cache',
1 verbose cli   '/data/.npm',
1 verbose cli   '--',
1 verbose cli   '--userDir',
1 verbose cli   '/data' ]
2 info using npm@6.14.8
3 info using node@v10.23.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle node-red-docker@1.2.5~prestart: node-red-docker@1.2.5
6 info lifecycle node-red-docker@1.2.5~start: node-red-docker@1.2.5
7 verbose lifecycle node-red-docker@1.2.5~start: unsafe-perm in lifecycle true
8 verbose lifecycle node-red-docker@1.2.5~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/node-red/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle node-red-docker@1.2.5~start: CWD: /usr/src/node-red
10 silly lifecycle node-red-docker@1.2.5~start: Args: [ '-c',
10 silly lifecycle   'node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"' ]
11 silly lifecycle node-red-docker@1.2.5~start: Returned: code: 1  signal: null
12 info lifecycle node-red-docker@1.2.5~start: Failed to exec start script
13 verbose stack Error: node-red-docker@1.2.5 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid node-red-docker@1.2.5
15 verbose cwd /usr/src/node-red
16 verbose Linux 5.4.72-v7l+
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "--no-update-notifier" "--no-fund" "start" "--cache" "/data/.npm" "--" "--userDir" "/data"
18 verbose node v10.23.0
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error node-red-docker@1.2.5 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
22 error Exit status 1
23 error Failed at the node-red-docker@1.2.5 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
onokje commented 3 years ago

Sorry for the late response. It looks like the error happened in the teslajs library. I don't really know the cause, and i also cannot reproduce it. However, I have updated the teslajs library today to a newer version. Maybe this resolves your issue as well. Let me know if you still have this issue after updating.