Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find context with specified id #1370

Closed
a-hat opened this issue Jul 20, 2020 · 9 comments
Closed

Cannot find context with specified id #1370

a-hat opened this issue Jul 20, 2020 · 9 comments
Assignees
Labels

Comments

@a-hat
Copy link

a-hat commented Jul 20, 2020

Our tests are very flaky. We sometimes get the stacktrace you can see below when using the goto function to navigate to a URL. Any input on a probable cause would be appreciated.

11:09:02          Error Message: Error: Cannot find context with specified id
11:09:02          Stacktrace: 
11:09:02          Error: Cannot find context with specified id
11:09:02              at /opt/integration-tests/node_modules/chrome-remote-interface/lib/chrome.js:93:35
11:09:02              at Chrome._handleMessage (/opt/integration-tests/node_modules/chrome-remote-interface/lib/chrome.js:256:17)
11:09:02              at WebSocket.<anonymous> (/opt/integration-tests/node_modules/chrome-remote-interface/lib/chrome.js:234:22)
11:09:02              at WebSocket.emit (events.js:315:20)
11:09:02              at Receiver.receiverOnMessage (/opt/integration-tests/node_modules/ws/lib/websocket.js:800:20)
11:09:02              at Receiver.emit (events.js:315:20)
11:09:02              at Receiver.dataMessage (/opt/integration-tests/node_modules/ws/lib/receiver.js:436:14)
11:09:02              at /opt/integration-tests/node_modules/ws/lib/receiver.js:393:23
11:09:02              at /opt/integration-tests/node_modules/ws/lib/permessage-deflate.js:306:9
11:09:02              at /opt/integration-tests/node_modules/ws/lib/permessage-deflate.js:385:7

Versions

node: v13.14.0
taiko: 1.0.14
@NivedhaSenthil
Copy link
Member

This should not be happening, Taiko tries to handle this exception seems like a missed case. Thanks for reporting we will be fixing this soon. Any repro for this issue will be of great help to identify the case sooner.

@a-hat
Copy link
Author

a-hat commented Jul 21, 2020

Thanks for taking care of this, @NivedhaSenthil!
I am not sure if I can help you reproduce the issue, probably has something to do with the application we are testing. But if I can provide more information like logs or verbose output, then please let me know.

NivedhaSenthil added a commit that referenced this issue Jul 27, 2020
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
NivedhaSenthil added a commit that referenced this issue Jul 27, 2020
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@NivedhaSenthil NivedhaSenthil self-assigned this Jul 27, 2020
NivedhaSenthil added a commit that referenced this issue Jul 27, 2020
* #1370 handle error from error message

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>

* #1370 handle case without executionContextId

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>

* Bump up version 1.0.16

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@NivedhaSenthil
Copy link
Member

There is new release(1.0.16) with a fix for one of the missed cases, can you please try and let us know if that fixes your problem?

@VolodymyrLavrenchuk
Copy link

taiko --version
Version: 1.0.16 (Chromium: 85.0.4168.0) RELEASE

node --version
v10.16.3

gauge --version
Gauge version: 1.1.1
Commit Hash: 6e0d83f

Plugins
-------
html-report (4.0.12)
js (2.3.12)
screenshot (0.0.1)

Have the same issue:

{ Error: Cannot find context with specified id
at _enqueueCommand (E:\programs\quest\ondemand-seed\e2e\node_modules\chrome-remote-interface\lib\chrome.js:93:35)
at Chrome._handleMessage (E:\programs\quest\ondemand-seed\e2e\node_modules\chrome-remote-interface\lib\chrome.js:256:17)
at WebSocket._ws.on (E:\programs\quest\ondemand-seed\e2e\node_modules\chrome-remote-interface\lib\chrome.js:234:22)
at WebSocket.emit (events.js:198:13)
at Receiver.receiverOnMessage (E:\programs\quest\ondemand-seed\e2e\node_modules\ws\lib\websocket.js:800:20)
at Receiver.emit (events.js:198:13)
at Receiver.dataMessage (E:\programs\quest\ondemand-seed\e2e\node_modules\ws\lib\receiver.js:436:14)
at perMessageDeflate.decompress (E:\programs\quest\ondemand-seed\e2e\node_modules\ws\lib\receiver.js:393:23)
at _decompress (E:\programs\quest\ondemand-seed\e2e\node_modules\ws\lib\permessage-deflate.js:306:9)
at _inflate.flush (E:\programs\quest\ondemand-seed\e2e\node_modules\ws\lib\permessage-deflate.js:385:7)
request:
{ method: 'Runtime.getProperties',
params:
{ type: 'object',
subtype: 'array',
className: 'Array',
description: 'Array(0)',
objectId: '{"injectedScriptId":18,"id":394}' } },
response:
{ code: -32000,
message: 'Cannot find context with specified id' } }

@NivedhaSenthil
Copy link
Member

Thanks for the logs it helps.. have never seen Cannot find context with specified id error before in 'Runtime.getProperties'

@NivedhaSenthil NivedhaSenthil removed their assignment Aug 4, 2020
@NivedhaSenthil NivedhaSenthil self-assigned this Aug 18, 2020
NivedhaSenthil added a commit that referenced this issue Aug 18, 2020
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
zabil pushed a commit that referenced this issue Aug 18, 2020
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@zabil
Copy link
Member

zabil commented Sep 2, 2020

Should be fixed in version 1.0.21

@zabil zabil closed this as completed Sep 2, 2020
@a-hat
Copy link
Author

a-hat commented Sep 3, 2020

Should be fixed in version 1.0.21

Thanks for the support. Our problem was not fixed with 1.0.16. We just upgraded to 1.0.21, and I will provide feedback if the error persists

@markvillar
Copy link

I have the same issue.

ProtocolError: Cannot find context with specified id
at /workspace/test/node_modules/chrome-remote-interface/lib/chrome.js:93:35
at Chrome._handleMessage (/workspace/test/node_modules/chrome-remote-interface/lib/chrome.js:256:17)
at WebSocket.<anonymous> (/workspace/test/node_modules/chrome-remote-interface/lib/chrome.js:234:22)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (/workspace/test/node_modules/ws/lib/websocket.js:797:20)
at Receiver.emit (events.js:314:20)
at Receiver.dataMessage (/workspace/test/node_modules/ws/lib/receiver.js:437:14)
at /workspace/test/node_modules/ws/lib/receiver.js:394:23
at /workspace/test/node_modules/ws/lib/permessage-deflate.js:306:9
at /workspace/test/node_modules/ws/lib/permessage-deflate.js:385:7 {
request: {
method: 'DOM.getBoxModel',
params: { objectId: '{"injectedScriptId":9,"id":504}' }
},
response: { code: -32000, message: 'Cannot find context with specified id' }
}
[Gauge] [CRITICAL] js runner quit unexpectedly. Check logs for more details.
ErrorMessage: transport is closing
Node: v14.11.0
Taiko: 1.0.23 (Chromium: 86.0.4240.0) RELEASE

Gauge version: 1.1.4
Commit Hash: c982558

Plugins
-------
html-report (4.0.12)
js (2.3.12)
screenshot (0.0.1)

@markushinz
Copy link

I am still having the same issue with version 1.2.0.
The good news is that I found a workaround. I am simply waiting for 1 second after calling goto:

step('Navigate to <url>', async url => {
    await goto(url)
    await new Promise(resolve => setTimeout(resolve, 1000)) // Hack to prevent "Error Message: Error: Cannot find context with specified id"
});

Maybe this helps @NivedhaSenthil @zabil to solve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants