greghesp/assistant-relay

TypeError: Cannot read property 'converse' of undefined

Milithor opened this issue · 4 comments

Describe the bug
When trying the sandbox if commands get executed correctly, I'm getting following error: "TypeError: Cannot read property 'converse' of undefined".

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Assistant Relay UI'
  2. Click on 'Sandbox'
  3. Enter following:
{
    "command": "Hello, World",
    "broadcast": true,
    "user": "MyName",
    "converse": false
}
  1. See error:
2021-04-02T09:41:12.756204525Z 0|www  | TypeError: Cannot read property 'converse' of undefined
2021-04-02T09:41:12.756226930Z 0|www  |     at new Conversation (/assistant_relay/node_modules/google-assistant/components/conversation.js:136:34)
2021-04-02T09:41:12.756240754Z 0|www  |     at /assistant_relay/helpers/assistant.js:19:38
2021-04-02T09:41:12.756305151Z 0|www  |     at processTicksAndRejections (internal/process/task_queues.js:93:5)
2021-04-02T09:41:12.756779817Z 0|www  | POST /assistant 500 57.571 ms - 44

Expected behavior
A working sandbox, nothing seems to work and fails on that error.

Desktop (please complete the following information):

  • Platform Ubuntu 18.04
  • Browser Chrome
  • Version --> not visible in the UI, stuck on ''fetching'' --> I'm using the latest docker image by Apipa.

Extra Info
I have tried the 'workaround' in #207
But this does not help for me.

@Apipa169

I notice now that on user creation there was a DNS error as well.
It's trying to resolve oauth2.googleapis.com/token --> does not exist.
oauth2.googleapis.com --> does exist.

2021-04-02T09:58:12.602184572Z 0|www  |     url: 'https://oauth2.googleapis.com/token',
2021-04-02T09:58:52.662564724Z 0|www  | Error: 14 UNAVAILABLE: DNS resolution failed

Any movement on this? Just installed was working for a few minutes then same error in log. Persistent after restart.

`
Assistant Relay is now starting...

assistant-relay@3.2.0 start /assistant_relay
pm2 start ./bin/www && pm2 log www
-------------
/\\\\\\_/\\/\\/\\\\_
_/\/////////\_/\\\
/\\\/\///////\_
/\_
/\_/\//\_/\//\_/////\_
_/\\\\\\/
/\\///\/\/
/\_
/\/
/\/////////
/\_
///\/
/\_/\//_____
/\_
/\_////\_____/\//_____
/\_/\_/\_/\/__________
/\_/\_/\_/\\\\\\\_
_////////////////////////
Runtime Edition
PM2 is a Production Process Manager for Node.js applications
with a built-in Load Balancer.
Start and Daemonize any application:
$ pm2 start app.js
Load Balance 4 instances of api.js:
$ pm2 start api.js -i 4
Monitor in production:
$ pm2 monitor
Make pm2 auto-boot at server restart:
$ pm2 startup
To go further checkout:
http://pm2.io/
-------------
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /assistant_relay/bin/www in fork_mode (1 instance)
[PM2] Done.
┌─────┬────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ www │ default │ 3.2.0 │ fork │ 55 │ 0s │ 0 │ online │ 0% │ 26.8mb │ root │ disabled │
└─────┴────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[TAILING] Tailing last 15 lines for [www] process (change the value with --lines option)
/root/.pm2/logs/www-out.log last 15 lines:
/root/.pm2/logs/www-error.log last 15 lines:
0|www | Assistant Relay Server Initialized
0|www | Visit http://172.30.33.0:3000 in a browser to configure
0|www | An update is available. Please visit https://github.com/greghesp/assistant-relay/releases
0|www | GET /sandbox 304 8.456 ms - -
0|www | GET /static/js/2.2f2d0ed6.chunk.js 304 1.127 ms - -
0|www | GET /static/css/2.4af953f8.chunk.css 304 6.078 ms - -
0|www | GET /static/js/main.4e10c66e.chunk.js 304 1.885 ms - -
0|www | POST /server/userCount 200 20.665 ms - 10
0|www | GET /favicon-32x32.png 200 1.612 ms - 1435
0|www | POST /server/getConfig 200 16.494 ms - 126
0|www | TypeError: Cannot read property 'converse' of undefined
0|www | at new Conversation (/assistant_relay/node_modules/google-assistant/components/conversation.js:136:34)
0|www | at /assistant_relay/helpers/assistant.js:19:38
0|www | at processTicksAndRejections (internal/process/task_queues.js:94:5)
0|www | POST /assistant 500 34.022 ms - 44`

egeu5 commented

Same here.

Auth error:TypeError: Cannot read property 'access_token' of undefined

Cannot read property 'converse' of undefined

Following a HomeAssistant / HASSIO Assistant-Relay setup tutorial, I encountered the above errors in the container logs when testing in the AR Sandbox. Resolved by removing and reinstalling the add-on in HASSIO and re-creating / re-authenticating my assistant-relay user.

To me this suggests the culprit is likely that the access_token initialization failed the first time around.

After that, all errors have cleared up and Assistant-Relay is working magnificently!

Related issues:

#150
#126
#242

Hope this can help anyone else who encounters this class of issue in the future.

<3