scrapinghub / splash

Lightweight, scriptable browser as a service with an HTTP API
BSD 3-Clause "New" or "Revised" License
4.09k stars 513 forks source link

Getting The X11 connection broke: I/O error (code 1) After started using V3.5 #1083

Open nasaf-uc opened 3 years ago

nasaf-uc commented 3 years ago

Hey, I am using splash in kebernetes, started getting The X11 connection broke: I/O error (code 1) after i changed the version from 3.4 to 3.5.

I get the following log when the pod gets restarted. The X11 connection broke: I/O error (code 1) XIO: fatal IO error 22 (Invalid argument) on X server ":755893205" after 751 requests (747 known processed) with 0 events remaining.

This happens after crawling few pages continuously. there is no much difference in the page crawled, its the same page with different post parameters. The pod gets restarted randomly after few requests [like around 20-30 pages]

Pod setup:

image: scrapinghub/splash:3.5 commandArgs: args: ["--slots=10", "--max-timeout=3600", "--maxrss=1200"] resources: cpu: "100m" memory: "1400Mi"

Any help to know what causes this issue and solution for it, will be appreciated!

nasaf-uc commented 3 years ago

Any update on this?

de-finit-ively commented 2 years ago

I also have this error since 3.5. Did some testing and seems to me that it occurs due to XVFB being killed on container restart. I noticed that it occurs mostly when the maxrss limit is reached and twisted is restarted.

astam006 commented 2 years ago

I have also started to experience this issue recently. Restarting the Docker container does fix it, but its not practical unfortunately.

de-finit-ively commented 2 years ago

@astam006, with aquarium the container restart is being applied. but as you said, it is pretty impractical. I also have some containers that randomly hang on encountering this issue. The server receives requests and i can see splash downloading stuff. But on rendering the XVFB just stalls consistently. This happens every now and then, and as long as this issue persisted, the container wont actually serve any requests, it will accept it though, but give error as respose.

davidkong0987 commented 2 years ago

I tried using 3.4, and I have the same problem described here https://github.com/TeamHG-Memex/aquarium/issues/1 . This time it did not say X11 connection broke, but everything else was the same