new 4.3.0 won't render PDF



  • We upgraded to the latest version to test with and it won't render any of our PDFs. To be sure, we took an export of https://playground.jsreport.net/w/admin/hBfqC7af and imported it in to our environment and it just hangs at "Executing recipe chrome-pdf". If we run this same thing on 4.2 we do not have any issues. We did not change our docker at all except to install the new version so it's still got this line in it for Chrome:
    apt install -y chromium-browser=112.0.5615.49-0ubuntu0.18.04.1 chromium-codecs-ffmpeg=112.0.5615.49-0ubuntu0.18.04.1 && \



  • Our official jsreport/jsreport:4.3.0-full image works fine. So we need to find what's different in your image.

    Here is the dockerfile used for the official full image, could you compare it with your image?
    https://github.com/jsreport/jsreport/blob/master/packages/jsreport/docker/full/Dockerfile



  • We don't do anything with OracleDB, so i am assuming i don't need anything with that section.

    We had this in there from before. Not sure if it's needed or not:

    WORKDIR /${APPDIR}
    # the chrome was already installed from apt-get
    ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
    ENV NODE_OPTIONS "--openssl-legacy-provider"
    
    RUN npm install -g @jsreport/jsreport-cli
    RUNN npm install -g @jsreport/jsreport-unoconv
    
    RUN jsreport init
    

    We use elasticSearch in our for logging, so i have

    RUN npm install --save winston winston-elasticsearch
    

    We have a couple more NPM packages

    RUN npm install --save chart.js
    RUN npm install --save request
    

    I also have a couple of extra lines at the bottom that we may not need:

    ENV PATH "$PATH:/fop-2.1"
    ENV NODE_ENV production
    #ENV chrome_launchOptions_executablePath /usr/bin/chromium-browser
    ENV chrome_launchOptions_args --no-sandbox,--disable-dev-shm-usage
    

    Everything else lines up. The versions all match for NPM packages. Anything else that's in our dockerfile are AWS specific for our hosting


  • administrators

    hi! i don't see any steps you do that can cause an issue

    what if you test the jsreport/jsreport:4.3.0-full directly? check if Chrome works there

    what is the host in which you are running this? i mean if you are using Docker for Windows, Docker for Macos or just running Docker directly on linux

    the reason chrome may not work can be a combination of the host and some steps in the dockerfile, so it is not clear what can be the issue for you



  • It's definitely an issue with jsreports to chromium, but i don't know what it would be. If i run my docker to a bash shell and then execute

    /app-rprt$ /usr/bin/chromium-browser --no-sandbox --disable-dev-shm-usage --headless --disable-gpu --print-to-pdf $1
    

    it generates output.pdf with content in it. This is the output though.

    [0322/121710.387637:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    [0322/121710.391744:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    [0322/121710.391805:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    [0322/121710.400029:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
    [0322/121710.441692:WARNING:sandbox_linux.cc(393)] InitializeSandbox() called with multiple threads in process gpu-process.
    659 bytes written to file output.pdf
    

    Not sure if that matters or not in what you guys are doing with the return. I did not run your docker to see what the output looks like on your side. Could you please let me know if you think this is the issue?


  • administrators

    i don't know what can be the problem, as mentioned, the full docker image work for us, we are using it with docker for windows/macos and also running it on linux directly, so it is working fine.

    if this issue only happens when you are building your own image, then something must be wrong there, but we can not know without testing a complete docker image.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.