wkhtmltopdf / qtwebkit
Anonymous
TRIALOP

2 years ago

Hi! Can't get wkhtmltopdf to work in my DRF project on railway.

Project: Django DRF

Trying to add: wkhtmltopdf

Works running locally. But when added into the railway.config and ran, I get this error in a loop. Seems like qtwebkit is the issue? Does NixOS (if I understand that is what railway is running with) need another library?

Error:


#8 368.6    62 |     SVGLength(const SVGLength&);

#8 368.6       |     ^~~~~~~~~

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/SVGRadialGradientElement.h: In member function 'void WebCore::SVGRadialGradientElement::setCxBaseValue(const WebCore::SVGLength&, bool)':

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h:140:35: warning: implicitly-declared 'WebCore::SVGLength& WebCore::SVGLength::operator=(const WebCore::SVGLength&)' is deprecated [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-copy-Wdeprecated-copy8;;]

#8 368.6   140 |         m_##LowerProperty.value = type; \

#8 368.6       |                                   ^~~~

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/SVGAnimatedLength.h:33:1: note: in expansion of macro 'DECLARE_ANIMATED_PROPERTY'

#8 368.6    33 | DECLARE_ANIMATED_PROPERTY(SVGAnimatedLength, SVGLength, UpperProperty, LowerProperty, )

#8 368.6       | ^~~~~~~~~~~~~~~~~~~~~~~~~

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/SVGRadialGradientElement.h:50:9: note: in expansion of macro 'DECLARE_ANIMATED_LENGTH'

#8 368.6    50 |         DECLARE_ANIMATED_LENGTH(Cx, cx)

#8 368.6       |         ^~~~~~~~~~~~~~~~~~~~~~~

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/SVGLength.h:62:5: note: because 'WebCore::SVGLength' has user-provided 'WebCore::SVGLength::SVGLength(const WebCore::SVGLength&)'

#8 368.6    62 |     SVGLength(const SVGLength&);

#8 368.6       |     ^~~~~~~~~

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/SVGRadialGradientElement.h: In member function 'void WebCore::SVGRadialGradientElement::setCyBaseValue(const WebCore::SVGLength&, bool)':

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h:140:35: warning: implicitly-declared 'WebCore::SVGLength& WebCore::SVGLength::operator=(const WebCore::SVGLength&)' is deprecated [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-copy-Wdeprecated-copy8;;]

#8 368.6   140 |         m_##LowerProperty.value = type; \

#8 368.6       |                                   ^~~~

#8 368.6 /tmp/nix-build-qtwebkit-5.212.0-alpha4.drv-0/source/Source/WebCore/svg/SVGAnimatedLength.h:33:1: note: in expansion of macro 'DECLARE_ANIMATED_PROPERTY'

#8 368.6    33 | DECLARE_ANIMATED_PROPERTY(SVGAnimatedLength, SVGLength, UpperProperty, LowerProperty, )

#8 368.6       | ^~~~~~~~~~~~~~~~~~~~~~~~~

railway.config:

{
    "$schema": "https://schema.up.railway.app/railway.schema.json",
    "build": {
        "builder": "NIXPACKS",
        "nixpacksPlan": {
            "phases": {
                "setup": {
                    "nixPkgs": ["...", "ffmpeg", "wkhtmltopdf"],
                    "cmds": [
                        "...",
                        "sudo apt-get -y update && sudo apt-get install -y ffmpeg && sudo apt-get install -y wkhtmltopdf"
                    ]
                }
            }
        },
        "buildCommand": "poetry install"
    },
    "deploy": {
        "startCommand": "bash scripts/prod-start.sh",
        "restartPolicyType": "NEVER",
        "restartPolicyMaxRetries": 10
    }
}

2 Replies

Anonymous
TRIALOP

2 years ago

f0d00a68-5db3-4665-bf82-a4919d539271


2 years ago

you are installing the packages via nix, and then again via apt, please choose only one method


Welcome!

Sign in to your Railway account to join the conversation.

Loading...