Skip to content

PDF Export never finishes for a document, Weasyprint service seems to crash, Docker container restart is necessary #53

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

Closed
nweidemann opened this issue Sep 5, 2024 · 2 comments · Fixed by #54 or #55
Labels
bug Something isn't working

Comments

@nweidemann
Copy link

Current Behavior

PDF Export never finishes for a specific document (but we are not able to share this),
Regular documents from DrivePilot Example do work without problems.

Weasyprint service seems to crash, the about page of PDF Exporter is not available after the try of this export.
It is available again, after docker container is stopped (and started again).

When trying to export this page again, after cancellation of the 1st export a error regarding Weasyprint is shown (status 500)
pdf exporter

Please see the output of _docker logs weasyprint-service

[0904/140236.570244:ERROR:angle_platform_impl.cc(44)] Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display. ERR: Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display. [0904/140236.570514:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Could not open the default X display. [0904/140236.570625:ERROR:gl_display.cc(772)] eglInitialize Default failed with error EGL_NOT_INITIALIZED [0904/140236.570766:ERROR:gl_display.cc(806)] Initialization of all EGL display types failed. [0904/140236.570878:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed. [0904/140236.571122:ERROR:angle_platform_impl.cc(44)] Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display. ERR: Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display. [0904/140236.571257:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Could not open the default X display. [0904/140236.571373:ERROR:gl_display.cc(772)] eglInitialize Default failed with error EGL_NOT_INITIALIZED [0904/140236.571501:ERROR:gl_display.cc(806)] Initialization of all EGL display types failed. [0904/140236.571614:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed. [0904/140236.574681:ERROR:viz_main_impl.cc(166)] Exiting GPU process due to errors during initialization [0904/140236.615758:WARNING:runtime_features.cc(685)] AttributionReporting cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement in addition. [0904/140236.616041:WARNING:runtime_features.cc(699)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition. [0904/140237.215126:ERROR:validation_errors.cc(117)] Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED [0904/140237.215221:ERROR:interface_endpoint_client.cc(722)] Message 290137554 rejected by interface viz.mojom.CopyOutputResultSender [0904/140237.223286:ERROR:gpu_process_host.cc(1007)] GPU process exited unexpectedly: exit_code=9 [0904/140237.223318:WARNING:gpu_process_host.cc(1443)] The GPU process has crashed 1 time(s) [0904/140237.234738:WARNING:gpu_process_host.cc(1029)] Reinitialized the GPU process after a crash. The reported initialization time was 0 ms ERROR:root:Unexpected error due converting to PDF: [Errno 2] No such file or directory: '/tmp/8b3a0745-97ac-4b2d-8985-74635d2b740d.png' Traceback (most recent call last): File "/opt/weasyprint/app/WeasyprintController.py", line 38, in convert_html html = SvgUtils.process_svg(html) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/weasyprint/app/SvgUtils.py", line 15, in process_svg return re.sub(pattern, replace_img_base64, html) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/re/__init__.py", line 186, in sub return _compile(pattern, flags).sub(repl, string, count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/weasyprint/app/SvgUtils.py", line 46, in replace_img_base64 replaced_content_base64 = replace_svg_with_png(svg_content) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/weasyprint/app/SvgUtils.py", line 101, in replace_svg_with_png with open(png_filepath, 'rb') as img_file: ^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/tmp/8b3a0745-97ac-4b2d-8985-74635d2b740d.png' ::ffff:172.17.0.1 - - [2024-09-04 14:02:37] "POST /convert/html?presentational_hints=true&pdf_variant=pdf%2Fa-2b HTTP/1.1" 500 159 11.868129 ::ffff:172.17.0.1 - - [2024-09-04 14:03:00] "GET /version HTTP/1.1" 200 177 0.001164 ::ffff:172.17.0.1 - - [2024-09-04 14:03:00] "POST /convert/html?presentational_hints=true&pdf_variant=pdf%2Fa-2b HTTP/1.1" 200 6163 0.104040

pdf exporter_about

Any clues what could be wrong?

Kind Regards,
Niko Weidemann
DB Systel GmbH

Expected Behavior

pdf export finishes and does not crash weasyprint docker container

Steps To Reproduce

pdfexporter version: 5.7.0
weasyprint-service:62.4.0

Anything else

No response

@nweidemann nweidemann added the bug Something isn't working label Sep 5, 2024
Jumas added a commit that referenced this issue Sep 6, 2024
@Jumas Jumas linked a pull request Sep 6, 2024 that will close this issue
4 tasks
Jumas added a commit that referenced this issue Sep 6, 2024
#54)

fix: chromium gpu usage disabled, proper error result handling when taking a chromium screenshot

Refs: #53
@Jumas Jumas closed this as completed in #54 Sep 6, 2024
@nweidemann
Copy link
Author

Thanks for the quick new release. We will try and let you know

@nweidemann
Copy link
Author

good news is that a pdf is now created, but there are several errors in the log. I Will open another issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant