Error handling request 5 TypeError: Cannot read properties of undefined (reading 'bringToFront') #43

Open
opened 2022-07-17 03:35:30 -04:00 by daktak · 1 comment
 $ xvfb-run yarn start
yarn run v1.22.19
$ node ./src/main.js
[Main] Reading config from config.json
[API] Starting server
[API] Now listening at /var/run/matrix-puppeteer-line/puppet.sock
[API/0] Received connection 0
[API/0] Received request 1 with command register
[API/@daktak:domo.ddns.net/0] Registered socket 0 -> @daktak:domo.ddns.net
[API/@daktak:domo.ddns.net/0] Received request 2 with command start
[API/@daktak:domo.ddns.net/0] Opening new puppeteer for @daktak:domo.ddns.net
[Puppeteer/@daktak:domo.ddns.net] Launching browser
[API/@daktak:domo.ddns.net/0] Received request 3 with command start
[API/@daktak:domo.ddns.net/0] Error handling request 2 TimeoutError: waiting for target failed: timeout 30000ms exceeded
    at Object.waitWithTimeout (/pub/git/matrix-puppeteer-line/puppet/node_modules/puppeteer/lib/cjs/puppeteer/common/helper.js:224:26)
    at Browser.waitForTarget (/pub/git/matrix-puppeteer-line/puppet/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:295:45)
    at ChromeLauncher.launch (/pub/git/matrix-puppeteer-line/puppet/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:104:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MessagesPuppeteer.start (file:///pub/git/matrix-puppeteer-line/puppet/src/puppet.js:88:18)
    at async handleStart (file:///pub/git/matrix-puppeteer-line/puppet/src/client.js:170:4)
    at async Client.handleLine (file:///pub/git/matrix-puppeteer-line/puppet/src/client.js:277:20)
[API/@daktak:domo.ddns.net/0] Connection closed (user: @daktak:domo.ddns.net)

[API/1] Received connection 1
[API/1] Received request 1 with command register
[API/@daktak:domo.ddns.net/1] Registered socket 1 -> @daktak:domo.ddns.net
[API/@daktak:domo.ddns.net/1] Received request 2 with command start
[API/@daktak:domo.ddns.net/1] Received request 3 with command start
[API/@daktak:domo.ddns.net/1] Received request 4 with command start
[API/@daktak:domo.ddns.net/1] Received request 5 with command login
[API/@daktak:domo.ddns.net/1] Error handling request 5 TypeError: Cannot read properties of undefined (reading 'bringToFront')
    at MessagesPuppeteer.waitForLogin (file:///pub/git/matrix-puppeteer-line/puppet/src/puppet.js:211:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.handleLine (file:///pub/git/matrix-puppeteer-line/puppet/src/client.js:277:20)
``` $ xvfb-run yarn start yarn run v1.22.19 $ node ./src/main.js [Main] Reading config from config.json [API] Starting server [API] Now listening at /var/run/matrix-puppeteer-line/puppet.sock [API/0] Received connection 0 [API/0] Received request 1 with command register [API/@daktak:domo.ddns.net/0] Registered socket 0 -> @daktak:domo.ddns.net [API/@daktak:domo.ddns.net/0] Received request 2 with command start [API/@daktak:domo.ddns.net/0] Opening new puppeteer for @daktak:domo.ddns.net [Puppeteer/@daktak:domo.ddns.net] Launching browser [API/@daktak:domo.ddns.net/0] Received request 3 with command start [API/@daktak:domo.ddns.net/0] Error handling request 2 TimeoutError: waiting for target failed: timeout 30000ms exceeded at Object.waitWithTimeout (/pub/git/matrix-puppeteer-line/puppet/node_modules/puppeteer/lib/cjs/puppeteer/common/helper.js:224:26) at Browser.waitForTarget (/pub/git/matrix-puppeteer-line/puppet/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:295:45) at ChromeLauncher.launch (/pub/git/matrix-puppeteer-line/puppet/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:104:27) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MessagesPuppeteer.start (file:///pub/git/matrix-puppeteer-line/puppet/src/puppet.js:88:18) at async handleStart (file:///pub/git/matrix-puppeteer-line/puppet/src/client.js:170:4) at async Client.handleLine (file:///pub/git/matrix-puppeteer-line/puppet/src/client.js:277:20) [API/@daktak:domo.ddns.net/0] Connection closed (user: @daktak:domo.ddns.net) [API/1] Received connection 1 [API/1] Received request 1 with command register [API/@daktak:domo.ddns.net/1] Registered socket 1 -> @daktak:domo.ddns.net [API/@daktak:domo.ddns.net/1] Received request 2 with command start [API/@daktak:domo.ddns.net/1] Received request 3 with command start [API/@daktak:domo.ddns.net/1] Received request 4 with command start [API/@daktak:domo.ddns.net/1] Received request 5 with command login [API/@daktak:domo.ddns.net/1] Error handling request 5 TypeError: Cannot read properties of undefined (reading 'bringToFront') at MessagesPuppeteer.waitForLogin (file:///pub/git/matrix-puppeteer-line/puppet/src/puppet.js:211:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Client.handleLine (file:///pub/git/matrix-puppeteer-line/puppet/src/client.js:277:20) ```
Author

It appears it is some issue with sandboxing. It works with the following changes

diff --git a/puppet/src/puppet.js b/puppet/src/puppet.js
index 361083f..75466a1 100644
--- a/puppet/src/puppet.js
+++ b/puppet/src/puppet.js
@@ -80,6 +80,8 @@ export default class MessagesPuppeteer {
                        `--disable-extensions-except=${MessagesPuppeteer.extensionDir}`,
                        `--load-extension=${MessagesPuppeteer.extensionDir}`,
                        `--window-size=${MessagesPuppeteer.viewport.width},${MessagesPuppeteer.viewport.height+120}`,
+                       `--no-sandbox`,
+                       `--disable-setuid-sandbox`,
                ]
                if (MessagesPuppeteer.noSandbox) {
                        args = args.concat(`--no-sandbox`)
It appears it is some issue with sandboxing. It works with the following changes ``` diff --git a/puppet/src/puppet.js b/puppet/src/puppet.js index 361083f..75466a1 100644 --- a/puppet/src/puppet.js +++ b/puppet/src/puppet.js @@ -80,6 +80,8 @@ export default class MessagesPuppeteer { `--disable-extensions-except=${MessagesPuppeteer.extensionDir}`, `--load-extension=${MessagesPuppeteer.extensionDir}`, `--window-size=${MessagesPuppeteer.viewport.width},${MessagesPuppeteer.viewport.height+120}`, + `--no-sandbox`, + `--disable-setuid-sandbox`, ] if (MessagesPuppeteer.noSandbox) { args = args.concat(`--no-sandbox`) ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fair/matrix-puppeteer-line#43
No description provided.