couldn't render HTML file to PDF: exit status 2
Closed this issue · 12 comments
Run on Docker version 26.1.0, build 9714adc
Command used:
root@server:/home/user# docker run --rm -v ${PWD}/reports:/app/reports wallarm/gotestwaf --url="https://domain.it" --noEmailReport --skipWAFBlockCheck
Ends up with error:
time="2024-04-23T09:21:02Z" level=error msg="caught error in main function" error="couldn't export full report: couldn't render HTML report to PDF: couldn't render HTML file to PDF: exit status 2"
Servers OS is Ubuntu 22.04 LTS
Tried on bultiple hosts. Scan goues fine, also witout --skipWAFBlockCheck key, bat cannot generate PDF
Thank you in advice
Hi!
Could you tell me what version of GTW you have?
docker run --rm wallarm/gotestwaf --version
Hi!
Could you tell me what version of GTW you have?
docker run --rm wallarm/gotestwaf --version
Sure.
GoTestWAF v0.4.18
Thank you
Let's see if chrome can render a simple html page inside a container. Run the commands sequentially and provide the chrome output.
docker run --rm -it --entrypoint /bin/sh wallarm/gotestwaf
wget https://example.com
chromium-browser --headless --no-zygote--no-sandbox --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf=test.pdf index.html
Let's see if chrome can render a simple html page inside a container. Run the commands sequentially and provide the chrome output.
docker run --rm -it --entrypoint /bin/sh wallarm/gotestwaf wget https://example.com chromium-browser --headless --no-zygote--no-sandbox --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf=test.pdf index.html
And here is result as NON root:
olexandr@nessus:~$ docker run --rm -it --entrypoint /bin/sh wallarm/gotestwaf
wget https://example.com
chromium-browser --headless --no-zygote--no-sandbox --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf=test.pdf index.html
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
--2024-04-23 10:42:00-- https://example.com/
Resolving example.com (example.com)... 93.184.215.14, 2606:2800:21f:cb07:6820:80da:af6b:8b2c
Connecting to example.com (example.com)|93.184.215.14|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1256 (1.2K) [text/html]
Saving to: ‘index.html.4’
index.html.4 100%[=====================================================>] 1.23K --.-KB/s in 0s
2024-04-23 10:42:00 (31.6 MB/s) - ‘index.html.4’ saved [1256/1256]
/usr/bin/chromium-browser: 12: xdg-settings: not found
[0423/104201.280907:INFO:config_dir_policy_loader.cc(118)] Skipping mandatory platform policies because no policy file was found at: /etc/chromium/policies/managed
[0423/104201.282056:INFO:config_dir_policy_loader.cc(118)] Skipping recommended platform policies because no policy file was found at: /etc/chromium/policies/recommended
MoTTY X11 proxy: No authorisation provided
[0423/104201.309358:ERROR:angle_platform_impl.cc(44)] DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
ERR: DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
[0423/104201.310825:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
[0423/104201.310951:ERROR:gl_display.cc(515)] EGL Driver message (Critical) eglInitialize: Not initialized.
[0423/104201.311053:ERROR:gl_display.cc(786)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
[0423/104201.313042:ERROR:gl_display.cc(820)] Initialization of all EGL display types failed.
[0423/104201.313183:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
MoTTY X11 proxy: No authorisation provided
[0423/104201.370367:ERROR:angle_platform_impl.cc(44)] DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
ERR: DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
[0423/104201.370750:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
[0423/104201.370895:ERROR:gl_display.cc(515)] EGL Driver message (Critical) eglInitialize: Not initialized.
[0423/104201.371086:ERROR:gl_display.cc(786)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
[0423/104201.371184:ERROR:gl_display.cc(820)] Initialization of all EGL display types failed.
[0423/104201.371349:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[0423/104201.392792:ERROR:viz_main_impl.cc(198)] Exiting GPU process due to errors during initialization
[0423/104201.414001:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
[0423/104201.418808:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable.
MoTTY X11 proxy: No authorisation provided
[0423/104201.536755:ERROR:angle_platform_impl.cc(44)] DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
ERR: DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
[0423/104201.537146:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
[0423/104201.537345:ERROR:gl_display.cc(515)] EGL Driver message (Critical) eglInitialize: Not initialized.
[0423/104201.537565:ERROR:gl_display.cc(786)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
[0423/104201.537751:ERROR:gl_display.cc(820)] Initialization of all EGL display types failed.
[0423/104201.537929:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
MoTTY X11 proxy: No authorisation provided
[0423/104201.603554:ERROR:angle_platform_impl.cc(44)] DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
ERR: DisplayVkXcb.cpp:58 (initialize): xcb_connect() failed, error 1
[0423/104201.603976:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Not initialized.
[0423/104201.604227:ERROR:gl_display.cc(515)] EGL Driver message (Critical) eglInitialize: Not initialized.
[0423/104201.604386:ERROR:gl_display.cc(786)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
[0423/104201.604527:ERROR:gl_display.cc(820)] Initialization of all EGL display types failed.
[0423/104201.604708:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[0423/104201.608907:ERROR:viz_main_impl.cc(198)] Exiting GPU process due to errors during initialization
[0423/104201.717380:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
[0423/104201.781733:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
660 bytes written to file test.pdf
test.pdf is empty
Can it be because i'm on the server with no GUI?
Any solution for this one?
The last two commands need to be executed inside docker, so it's best not to paste them all at once. Execute the first command, wait the container shell, and then execute the second and third inside the container.
I missed a space in the command, try running Chrome in a container like this:
chromium-browser --headless --no-zygote --no-sandbox --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf=test.pdf index.html
I missed a space in the command, try running Chrome in a container like this:
chromium-browser --headless --no-zygote --no-sandbox --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf=test.pdf index.html
Something is written, even if there are alot of errors:
How i can check it? I'm not very good with dockers
It looks like the file rendered successfully. To check this, you need to add -v $(pwd)/app:/app
to docker run command. So you can find test.pdf in $(pwd)/app
dir.