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


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
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

Cloudron Forum

Apps | Demo | Docs | Install

Using the n8n CLI

Scheduled Pinned Locked Moved Solved N8N
10 Posts 4 Posters 561 Views
    • 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.
  • S Offline
    S Offline
    sparkwise
    wrote on last edited by
    #1

    n8n ships with a n8n CLI (found on Cloudron at /app/code/node_modules/.bin/n8n.) When I try to use it to export a workflow, I run into this...

    /app/code/node_modules/.bin/n8n export:workflow --backup --output=/tmp/n8n/
    

    Error exporting workflows. See log messages for details.
    EROFS: read-only file system, mkdir '/root/.n8n'

    Is there a different way to invoke the command that works on Cloudron?

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

    looks at the command options and see if there's a way to specify the configuration directory, since it seems it is failing trying to create one.

    Life of sky tech

    JOduMonTJ 1 Reply Last reply
    0
  • JOduMonTJ Offline
    JOduMonTJ Offline
    JOduMonT
    replied to sparkwise on last edited by JOduMonT
    #3

    @sparkwise said in Using the n8n CLI:

    Is there a different way to invoke the command that works on Cloudron?

    I exactly encounter the same error on the same command

    Personally I thought to run the command with as user cloudron (1000)
    but then I have another issue πŸ˜‰

    su -c '/app/code/node_modules/n8n/bin/n8n export:workflow --backup --output=/app/data/user/backups/' cloudron
    

    /usr/bin/env: β€˜node’: No such file or directory

    PS: I also tried your variation but end with the same issue

    su -c '/app/code/node_modules/.bin/n8n export:workflow --backup --output=/app/data/user/backups/' cloudron
    

    UPDATE

    This work'ish

    su -c '/usr/local/node-16.15.0/bin/node /app/code/node_modules/n8n/bin/n8n export:workflow --backup --output=/app/data/user/backups/' cloudron
    

    but it came with the almost with the same error then you

    Error exporting workflows. See log messages for details.
    EROFS: read-only file system, mkdir '/home/cloudron/.n8n'

    also it is not really sustainable since the node version is hard-coded in my command.

    1 Reply Last reply
    0
  • JOduMonTJ Offline
    JOduMonTJ Offline
    JOduMonT
    replied to robi on last edited by JOduMonT
    #4

    @robi said in Using the n8n CLI:

    looks at the command options and see if there's a way to specify the configuration directory, since it seems it is failing trying to create one.

    sadly, the command is not very voluble on that information

    /app/code/node_modules/.bin/n8n --help                                                             
    n8n Workflow Automation Tool
    
    VERSION
      n8n/0.179.0 linux-x64 node-v16.15.0
    
    USAGE
      $ n8n [COMMAND]
    
    TOPICS
      db               Revert last database migration
      export           Export credentials
      import           Import credentials
      list
      update           Update workflows
      user-management
    
    COMMANDS
      execute
      executeBatch
      start         Starts n8n. Makes Web-UI available and starts active workflows
      webhook       Starts n8n webhook process. Intercepts only production URLs.
      worker
    
    • I asked them n8n community
    robiR 1 Reply Last reply
    0
  • robiR Offline
    robiR Offline
    robi
    replied to JOduMonT on last edited by robi
    #5

    This may be the way, setting it via an environment variable since it doesn't appear to have a CLI parameter:
    https://docs.n8n.io/hosting/configuration/

    Life of sky tech

    1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by
    #6

    @JOduMonT @sparkwise the n8n user directory has to be set.

    # export N8N_USER_FOLDER="/app/data/user"
    # export N8N_CONFIG_FILES="/app/data/configs/default.json"
    # gosu cloudron /app/code/node_modules/.bin/n8n export:workflow --backup --output=/tmp/n8n/
    
    Loading configuration overwrites from:
     - /app/data/configs/default.json
    
    Error exporting workflows. See log messages for details.
    No workflows found with specified filters.
    

    I will move the env vars into the Dockerfile, so this will work out of the box.

    1 Reply Last reply
    3
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by
    #7

    Please try in the latest package. I put this in the docs as well - https://docs.cloudron.io/apps/n8n/#cli

    S JOduMonTJ 3 Replies Last reply
    1
  • S Offline
    S Offline
    sparkwise
    replied to girish on last edited by
    #8

    @girish That worked perfectly! Thank you.

    1 Reply Last reply
    0
  • S Offline
    S Offline
    sparkwise
    replied to girish on last edited by
    #9

    @girish said in Using the n8n CLI:

    I put this in the docs as well - https://docs.cloudron.io/apps/n8n/#cli

    In the docs, it could be helpful to linking "n8n CLI" to the documentation link: https://docs.n8n.io/reference/cli-commands/

    1 Reply Last reply
    3
  • nebulonN nebulon marked this topic as a question on
  • nebulonN nebulon has marked this topic as solved on
  • JOduMonTJ Offline
    JOduMonTJ Offline
    JOduMonT
    replied to girish on last edited by
    #10

    @girish + @nebulon it is very nice to have access to you; you are very responsive and highly competent πŸ˜‰
    thank you!

    1 Reply Last reply
    4

  • Login

  • Don't have an account? Register

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

  • Don't have an account? Register

  • Login or register to search.