Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. N8N
  3. n8n - Puppeteer - shared libraries failure

n8n - Puppeteer - shared libraries failure

Scheduled Pinned Locked Moved N8N
5 Posts 3 Posters 462 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    djxx
    wrote on last edited by
    #1

    I'm trying to use Puppeteer in n8n and getting an error. Normally I would just install the package, but since these are in a docker container and /var/lib/dpkg is read-only, that doesn't seem like it will work. Does anyone have a workaround, either for getting puppeteer to work or to install packages in an app? I don't want to use a 3rd party browserless/headless service.

    Problem in node β€˜Puppeteerβ€˜

    Failed to launch/connect to browser: Failed to launch the browser process! /home/cloudron/.cache/puppeteer/chrome/linux-135.0.7049.84/chrome-linux64/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://pptr.dev/troubleshooting

    1bfaf9a0-bca1-4b18-8356-9d24ae533935-image.png

    1 Reply Last reply
    1
    • BrutalBirdieB Offline
      BrutalBirdieB Offline
      BrutalBirdie
      Partner
      wrote on last edited by BrutalBirdie
      #2

      Hey @djxx
      Please see: https://docs.cloudron.io/apps/n8n/#custom-node-modules
      This might solve your issue already πŸ™‚

      For the forum seo and searchability tho 😏


      Custom node modules

      To install custom node modules, edit /app/data/env.sh using the File manager:

      # note: this is a space separated list
      export EXTRA_NODE_MODULES="handlebars@4.7.7 jsonata@2.0.2 marked@4.3.0"
      

      The modules have to be whitelisted for use:

      # note: this is a comma separated list
      export NODE_FUNCTION_ALLOW_EXTERNAL=handlebars,jsonata,marked
      

      Restart the app and use the module in Function nodes. Restarting the app will install the modules specified in EXTRA_NODE_MODULES automatically. See upstream docs for more information.

      Like my work? Consider donating a drink. Cheers!

      1 Reply Last reply
      2
      • D Offline
        D Offline
        djxx
        wrote on last edited by
        #3

        @BrutalBirdie - thanks, but these are Node modules and not OS modules. Luckily, I did find a workaround. Step by step, I found all the missing modules, downloaded the deb files from https://packages.debian.org/, then extracted them into = /app/data/libatk/ (because that was the first missing library)

        f4e99437-2a55-4546-a116-f145740b55be-image.png

        After this, I discovered the entrypoint script calls an editable script and edited /app/data/env.sh with these lines:

        export PATH="/app/data/libatk:$PATH"
        export LD_LIBRARY_PATH="/app/data/libatk"
        

        Once I did this, I was able to enable Add Container Arguments on the Puppeteer nodes options in n8n and it worked just fine. The "container arguments" has it ignore all sandboxing best practices (which is OK since we're running in a container).

        It would be good if the base n8n application for Cloudron would include the dependencies mentioned above, because my hack will get overwritten at each application update.

        1 Reply Last reply
        4
        • BrutalBirdieB Offline
          BrutalBirdieB Offline
          BrutalBirdie
          Partner
          wrote on last edited by BrutalBirdie
          #4

          OH WOW! This is one impressive hack I've not seen or thought of yet.
          Impressive!
          I don't think this is how the /app/data/env.sh was ever intended to extend the PATH variable.
          But it works! 😱

          I believe, I do not have to tell you that these librarys do not get automatically updated. And thus might be a security risk. If you are able to pull off this stunt, you must know this πŸ™‚

          @djxx said in n8n - Puppeteer - shared libraries failure:

          because my hack will get overwritten at each application update.

          No, no it will not 😬 since you store everything in /app/data/ this is part of the backup.
          Nothing in /app/data/ will be overwritten with an app update.

          Like my work? Consider donating a drink. Cheers!

          1 Reply Last reply
          2
          • robiR Offline
            robiR Offline
            robi
            wrote on last edited by robi
            #5

            Yes, I've been doing this for years, you just have to make /app/data friendly enough for apps to find what they need. This generally involves setting a few env variables:

            1. HOME
            2. PATH (including NODE_PATH avoiding npm i -g)
            3. LD_LIBRARY_PATH (less common)
            4. other app specific ENVs

            All of these changes do not affect the running app since it's already running with its own ENVs.
            So these are great for additional services.

            Nice work @djxx

            Conscious tech

            1 Reply Last reply
            4
            • J joseph moved this topic from Support on
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search