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

[Question]Exception : com.microsoft.playwright.PlaywrightException: Failed to read message from driver, pipe closed. Skipping browsers download because PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD env variable is set. #635

Closed
agaramudhala opened this issue Oct 1, 2021 · 23 comments
Labels

Comments

@agaramudhala
Copy link

agaramudhala commented Oct 1, 2021

Hi Team,

Getting the below exception .

com.microsoft.playwright.PlaywrightException: Failed to read message from driver, pipe closed.
Skipping browsers download because PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD env variable is set. i'm running the test in playwright docker img via jenkins.

Playwright version:1.14.1
JDK : 1.8.0_275
Maven: 3.6.3
Chromium : 86.0.4240.111

@agaramudhala
Copy link
Author

Running with DEBUG=pw:protocol, got the exceptions details.

Exception in thread "RMI TCP Connection(idle)" java.lang.NoSuchFieldError: instrumentedPeer
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:831)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "RMI TCP Connection(idle)" java.lang.NoSuchFieldError: instrumentedPeer
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:831)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "RMI TCP Connection(idle)" java.lang.NoSuchFieldError: instrumentedPeer
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:831)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "RMI TCP Connection(idle)" java.lang.NoSuchFieldError: instrumentedPeer
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:831)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "RMI TCP Connection(idle)" java.lang.NoSuchFieldError: instrumentedPeer
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:831)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@yury-s yury-s added the triaging label Oct 1, 2021
@yury-s
Copy link
Member

yury-s commented Oct 1, 2021

The stack trace doesn't contain anything about Playwright, it seems to be from a client end that does remote-method-invocation. Can you collect trace/logs on the server? Also can you tell us more about your setup, how you run the tests?

@agaramudhala
Copy link
Author

I'm running tests on playwright docker container via Jenkins. Container already has chromium along with Java and maven!!

@yury-s
Copy link
Member

yury-s commented Oct 1, 2021

What is the command line that you run to launch the tests? Basically you need to prepend DEBUG=pw:browser to the mvn command that you launch on the server to get the browser output.

@agaramudhala
Copy link
Author

Used DEBUG=pw:protocol along with mvn compile exec cmd

@yury-s
Copy link
Member

yury-s commented Oct 1, 2021

Note that we need DEBUG=pw:browser rather than DEBUG=pw:protocol. Can you shared the output in that case or you are saying that it's lost somewhere?

@agaramudhala
Copy link
Author

agaramudhala commented Oct 1, 2021

tried with above cmd DEBUG=pw:browser. below is the output.
Skipping browsers download because PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD env variable is set. Exception : com.microsoft.playwright.PlaywrightException: Failed to read message from driver, pipe closed.

@yury-s
Copy link
Member

yury-s commented Oct 1, 2021

We need more information about your setup, can you share the project maybe? It looks like the driver fails to start for some reason but it's hard to tell what could go wrong with such scarce information.

@yury-s
Copy link
Member

yury-s commented Oct 1, 2021

Or can you share a minimal repro?

@agaramudhala
Copy link
Author

agaramudhala commented Oct 1, 2021

lemme try to recreate the project for sharing since i couldn't share the existing one as is due to organisation restrictions

@agaramudhala
Copy link
Author

sometimes I have got below err also while running in Jenkins.

java.lang.ClassNotFoundException: com.mycompany.app.Example
at java.net.URLClassLoader.findClass (URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass (ClassLoader.java:419)
at java.lang.ClassLoader.loadClass (ClassLoader.java:352)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:246)
at java.lang.Thread.run (Thread.java:748)

Locally I don't get this error but while running on jenkins , this error occurs

@yury-s
Copy link
Member

yury-s commented Oct 1, 2021

sometimes I have got below err also while running in Jenkins.

Something is wrong with your setup on jenkins as some of the classes are not in the classpath. Perhaps they are not properly copied into the docker image.

@agaramudhala
Copy link
Author

here is d repo for docker containers and test code repo https://github.com/agaramudhala/pw-java , https://github.com/agaramudhala/pw-docker

@yury-s
Copy link
Member

yury-s commented Oct 7, 2021

Thanks for sharing this, can you provide instructions on how to run it to reproduce the failure? I see that pw-docker does quite a lot of things, is it possible to reduce that more?

@agaramudhala
Copy link
Author

in order to reproduce, I'm jus spinning up docker playwright container via Jenkins and trigger the test class .. Lemme try to trim again and share the steps

@yury-s
Copy link
Member

yury-s commented Oct 7, 2021

I'm not familiar with Jenkins, so I would appreciate detailed steps what to do.

@agaramudhala
Copy link
Author

agaramudhala commented Oct 8, 2021

sure.. will add the steps

@agaramudhala
Copy link
Author

agaramudhala commented Oct 8, 2021

Please build docker container from this repo (should build automatically on triggering Jenkins job)in Jenkins pipeline locally or remotely and the following playwright image(pro-node-playwright) will be published and ready for consumption . Please start another Jenkins pipeline job locally or remotely. Have already added Jenkinsfile in the test repo which should pick automatically on triggering Jenkins. Test cmd is configured in same Jenkinsfile itself mvn compile exec:java -Dexec.mainClass=com.mycompany.app.Example

@yury-s
Copy link
Member

yury-s commented Oct 8, 2021

Ok, I'd need to install Jenkins to reproduce all this. Can you reproduce the problem with Docker manually to eliminate Jenkins from the setup? Basically just launch docker and run the same command Jenkins would do.

Looking at Example.java I see that you launch browser with setHeadless(false) which is bound to fail inside docker which doesn't have an X display. Could you remove the options and launch in headless mode?

Please build docker container from this repo

Building image with that docker file fails.

@agaramudhala
Copy link
Author

Forgot to update headless as true in the repo. But I'm running in headless mode only.

@agaramudhala
Copy link
Author

agaramudhala commented Oct 13, 2021

sed -i "external url"\ @yury-s . pls replace External url with corresponding docker.com [internal/external/public] or you can remove tat line and please try to rerun again

@yury-s
Copy link
Member

yury-s commented Oct 13, 2021

At this point it's unclear to me how to reproduce it, the setup is quite complex and I feel like the problem should be reproducible without Jenkins if it's a playwrigh issue but the docker image you uploaded doesn't build out of the box, so it's hard to tell what is not working at the later stages. Feel free to open a new issue with a small repro.

@yury-s yury-s closed this as completed Oct 13, 2021
@kb33git
Copy link

kb33git commented Jun 14, 2022

I am getting exact same issue, because of organization policies we are not allowed to download any external jars/software hence I added PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 to User environment variable and trying to use installed browser binaries. I am not using any docker, jenkins etc. its simple maven project with playwright dependency and one line of code "Playwright play = Playwright.create();" stack trace as below

I:\ds\tools\jdk8\1.8.0_321\bin\java.exe ...
Skipping browsers download because "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD eny variable is set
Exception in thread "main" com.microsoft.playwright.PlaywrightException : Failed to read message from driver, pipe closed.
at com.microsoft.playwright.impl.Pipe Transport.poll(Pipe Transport.java:75)
at com.microsoft.playwright.impl.Connection.processone Message (Connection.java:202),
at com.microsoft.playwright.impl.ChannelOwner.rununtil(ChannelOwner.java:101)
at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:115)
at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:94)
at com.microsoft.playwright.impl.Connections Root.initialize(Connection.java:82)
at com.microsoft.playwright.impl.Connection.initializePlaywright(Connection.java:183)
at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:45)
at com.microsoft.playwright.Playwright.create(Playwright.java:92)
at com.microsoft.playwright.Playwright.create(Playwright.java:96)
at com.jpmorgan.projectplaywright.PlaywrightTest.main(PlaywrightTest.java:7)
Caused by: java.io.EOFException
at com.microsoft.playwright.impl. ReaderThread.readIntLE(Pipe Transport.java:110)
at com.microsoft.playwright.impl. ReaderThread.readMessage(Pipe Transport.java:139)
at com.microsoft.playwright.impl. ReaderThread.run(Pipe Transport.java:125)
Process finished with exit code 1

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

No branches or pull requests

3 participants