NS8-N8N App ready, with a few validation issues

n8n.io is a Workflow automation too for technical people.

Serverd the same functions as Make/integromat and zapier, selfhosted on your server environment.

The module can be found here: compgeniuses/ns8-n8n: Nethserver 8 Module for n8nio (github.com)

After installing the module and running it into my server, I am getting a weired validation output error.

JSON Schema output validation aborted at step /home/n8n1/.config/actions/get-configuration/validate-output.json: JSON unmarshal error: unexpected end of JSON input. Input data: []

I have since tried modifying the validation output, removed it, changed it, but the error seems to persist.


One of the build worflows fails here:

Invalid workflow file: .github/workflows/build-apidoc.yml#L11
The workflow is not valid. .github/workflows/build-apidoc.yml (Line: 11, Col: 3): Error calling workflow 'NethServer/ns8-github-actions/.github/workflows/build-apidoc.yml@v1'. The workflow is requesting 'contents: write', but is only allowed 'contents: read'.

I am not sure if its a windows thing or what… also tried to resolve this.

Am building on windows, using VScode,

Anyone to assist with this?

can you check (console.log… maybe) what is the input data? Empty?
Does “show more” give additional info?

On the url, what is the leading f for?

the leading f is definetely not supposed to be there, thank you…
i dont think it could be the cause of the error, since 2 modules i am working on seem to be having that same error.

Show more does not give any more error than what is shared.

Do not know a thing of what that script supposed to do, know a reasonable amount of Python :slight_smile:

That leading f can be to compose a formatted string in which the values of variables in {curly brackets} are expanded:

image

If in this snippet of the script the value if the item with the key url in de dictionary data literally should be the string 'http://127.0.0.1:{os.environ["TCP_PORT"]}' then the leading f should not be there;
However: if value of url should contain value of (the variable) os.environ["TCP_PORT"] the f needs to be there…

2 Likes

let me re-look on the same then…

the action script is not executable

[root@R2-pve ~]# ls /home/n8n1/.config/actions/get-configuration/ -la
total 8
drwxr-xr-x. 2 n8n1 n8n1   48 Jan 21 09:23 .
drwxr-xr-x. 8 n8n1 n8n1  140 Jan 20 15:19 ..
-rw-r--r--. 1 n8n1 n8n1  527 Jan 21 09:22 20read
-rw-r--r--. 1 n8n1 n8n1 1081 Jan 21 09:23 validate-output.json
[root@R2-pve ~]# chmod a+x /home/n8n1/.config/actions/get-configuration/20read
[root@R2-pve ~]# ls /home/n8n1/.config/actions/get-configuration/ -la
total 8
drwxr-xr-x. 2 n8n1 n8n1   48 Jan 21 09:23 .
drwxr-xr-x. 8 n8n1 n8n1  140 Jan 20 15:19 ..
-rwxr-xr-x. 1 n8n1 n8n1  527 Jan 21 09:22 20read
-rw-r--r--. 1 n8n1 n8n1 1081 Jan 21 09:23 validate-output.json
[root@R2-pve ~]# api-cli run module/n8n1/get-configuration
Warning: using user "cluster" credentials from the environment
{"host": "", "http2https": false, "lets_encrypt": false}
2 Likes

running chmod and configure the host details, does not get effected, and therefore fails to initiate the module.
getting the config details afterwards, shows no config.

where did things go wrong, and any idea on solving this weired issue.

well no offense but I do love to understand things with context so I need to know what you did, please follow the template I gave

it is workable from your code I only made executable the get-configure/20read file, check in your code but like I already stated any action must be executable except the json schema validator

1 Like

None taken

Loggein to the server(user rocky)
su root, and ran these commands

ran
ls /home/n8n2/.config/actions/get-configuration/ -la

to confirm the files actually do exist.
then i ran

chmod a+x /home/n8n2/.config/actions/get-configuration/20read

and ls again.

ran below command to get configured items
api-cli run module/n8n2/get-configuration

since nothing is configured,

I decided to do the configuration

Outputs

[root@ns8 rocky]# ls /home/n8n2/.config/actions/get-configuration/ -la
total 8
drwxr-xr-x. 2 n8n2 n8n2   48 Jan 21 10:57 .
drwxr-xr-x. 8 n8n2 n8n2  140 Jan 21 10:57 ..
-rwxr-xr-x. 1 n8n2 n8n2  501 Jan 21 10:57 20read
-rw-r--r--. 1 n8n2 n8n2 1040 Jan 21 10:57 validate-output.json
[root@ns8 rocky]# chmod a+x /home/n8n2/.config/actions/get-configuration/20read
[root@ns8 rocky]# ls /home/n8n2/.config/actions/get-configuration/ -la
total 8
drwxr-xr-x. 2 n8n2 n8n2   48 Jan 21 10:57 .
drwxr-xr-x. 8 n8n2 n8n2  140 Jan 21 10:57 ..
-rwxr-xr-x. 1 n8n2 n8n2  501 Jan 21 10:57 20read
-rw-r--r--. 1 n8n2 n8n2 1040 Jan 21 10:57 validate-output.json
[root@ns8 rocky]# api-cli run module/n8n2/get-configuration
Warning: using user "cluster" credentials from the environment
{"host": "", "http2https": false, "lets_encrypt": false}
[root@ns8 rocky]# api-cli run module/n8n2/configure-module --data '{"host": "n8n.bybiz.link","lets_encrypt": false,"http2https": true}'
Warning: using user "cluster" credentials from the environment
""
[root@ns8 rocky]#

and below, seems no new configuration were applied

[root@ns8 rocky]# api-cli run module/n8n2/get-configuration
Warning: using user "cluster" credentials from the environment
{"host": "", "http2https": false, "lets_encrypt": false}
[root@ns8 rocky]# api-cli run module/n8n2/configure-module --data '{"host": "n8n.bybiz.link","lets_encrypt": false,"http2https": true}'
Warning: using user "cluster" credentials from the environment
""
[root@ns8 rocky]# api-cli run module/n8n2/get-configuration                     Warning: using user "cluster" credentials from the environment
{"host": "", "http2https": false, "lets_encrypt": false}
[root@ns8 rocky]#

Now whats more curious is, Why would that file not have write permissions, from the initial code on repo,

1 Like

ssh n8n2@localhost
runagent env

results


[n8n2@ns8 ~]$ runagent env
SHELL=/bin/bash
HISTCONTROL=ignoredups
HISTSIZE=1000
HOSTNAME=ns8
PWD=/home/n8n2
LOGNAME=n8n2
XDG_SESSION_TYPE=tty
MOTD_SHOWN=pam
HOME=/home/n8n2
LANG=C.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.m4a=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.oga=01;36:*.opus=01;36:*.spx=01;36:*.xspf=01;36:
SSH_CONNECTION=::1 44948 ::1 22
XDG_SESSION_CLASS=user
SELINUX_ROLE_REQUESTED=
TERM=xterm
LESSOPEN=||/usr/bin/lesspipe.sh %s
USER=n8n2
SELINUX_USE_CURRENT_RANGE=
SHLVL=1
XDG_SESSION_ID=54
XDG_RUNTIME_DIR=/run/user/1015
SSH_CLIENT=::1 44948 22
DEBUGINFOD_URLS=https://debuginfod.centos.org/
which_declare=declare -f
PATH=/home/n8n2/.config/bin:/var/lib/nethserver/node/bin:/usr/local/agent/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/agent/bin
SELINUX_LEVEL_REQUESTED=
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1015/bus
MAIL=/var/spool/mail/n8n2
SSH_TTY=/dev/pts/1
BASH_FUNC_which%%=() {  ( alias;
 eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@
}
_=/usr/local/bin/runagent
REGISTRY_AUTH_FILE=/etc/nethserver/registry.json
AGENT_BASEACTIONS_DIR=/usr/local/agent/actions
REDIS_ADDRESS=cluster-leader:6379
REDIS_REPLICA_ADDRESS=127.0.0.1:6379
REDIS_USER=module/n8n2
REDIS_PASSWORD=fba1d709-d09d-463d-9b58-f5e5522ea0a4
PYTHONPATH=/home/n8n2/.config/pypkg
IMAGE_DIGEST=sha256:ef1fe1a922ed3593f83700e9a9a957e476012deb54a8d84addbf795af72f5c26
IMAGE_ID=3c8f25910ae8779c049508044961adc5cde97a43c38b575830c86d687826591e
IMAGE_REOPODIGEST=ghcr.io/compgeniuses/n8n@sha256:ef1fe1a922ed3593f83700e9a9a957e476012deb54a8d84addbf795af72f5c26
IMAGE_URL=ghcr.io/compgeniuses/n8n:latest
MODULE_ID=n8n2
MODULE_UUID=86269149-611c-4df1-93dd-233dd97c2bd9
N8N_IMAGE=docker.n8n.io/n8nio/n8n:1.24.1
NODE_ID=1
POSTGRES_IMAGE=docker.io/library/postgres:15.5-bookworm
PREV_IMAGE_DIGEST=sha256:bd67e21717ca22c8379d82b739106e5fed435a5ff95b350aaafa72e2c1c21a12
PREV_IMAGE_ID=154e39ea922de0d9f07e49eb7fe45ecf8d813e5c3e0dea0bf88ba5ebb16c3bc0
PREV_IMAGE_REOPODIGEST=ghcr.io/compgeniuses/n8n@sha256:bd67e21717ca22c8379d82b739106e5fed435a5ff95b350aaafa72e2c1c21a12
PREV_IMAGE_URL=ghcr.io/compgeniuses/n8n:latest
PREV_N8N_IMAGE=docker.n8n.io/n8nio/n8n:1.24.1
PREV_POSTGRES_IMAGE=docker.io/library/postgres:15.5-bookworm
PREV_REDIS_IMAGE=docker.io/library/redis:7.2.3-bookworm
REDIS_IMAGE=docker.io/library/redis:7.2.3-bookworm
TCP_PORT=20026
TCP_PORTS=20026
AGENT_INSTALL_DIR=/home/n8n2/.config
AGENT_STATE_DIR=/home/n8n2/.config/state
AGENT_ID=module/n8n2

1 Like

[root@R2-pve ~]# ls /home/n8n1/.config/actions/configure-module/
20configure 30traefik 80start_services validate-input.json
[root@R2-pve ~]# ls /home/n8n1/.config/actions/configure-module/ -la
total 16
drwxr-xr-x. 2 n8n1 n8n1 93 Jan 20 15:19 .
drwxr-xr-x. 8 n8n1 n8n1 140 Jan 20 15:19 …
-rw-r–r–. 1 n8n1 n8n1 1433 Jan 20 15:19 20configure
-rw-r–r–. 1 n8n1 n8n1 1243 Jan 20 15:19 30traefik
-rw-r–r–. 1 n8n1 n8n1 268 Jan 20 15:19 80start_services
-rw-r–r–. 1 n8n1 n8n1 1040 Jan 20 15:19 validate-input.json

same problem, all your actions are not executable

1 Like

[root@R2-pve ~]# ls /home/wordpress3/.config/actions/configure-module/ -la
total 20
drwxr-xr-x. 2 wordpress3 wordpress3 149 Jan 21 10:09 .
drwxr-xr-x. 7 wordpress3 wordpress3 119 Jan 21 10:09 …
-rwxr-xr-x. 1 wordpress3 wordpress3 721 Jan 21 10:09 01Hostname_validation
-rwxr-xr-x. 1 wordpress3 wordpress3 1085 Jan 21 10:09 10configure_environment_vars
-rwxr-xr-x. 1 wordpress3 wordpress3 1289 Jan 21 10:09 20configure_traefik
-rwxr-xr-x. 1 wordpress3 wordpress3 308 Jan 21 10:09 80start_services
-rw-r–r–. 1 wordpress3 wordpress3 1072 Jan 21 10:09 validate-input.json

1 Like

then i dont see how i can fix the code from my windows dev environment.

the one on github that is… yikes

1 Like

Never ever use windows for coding…macos eventually but you have better for cheaper : Linux

1 Like

I am starting to see some success

[root@ns8 n8n2]# api-cli run module/n8n2/get-configuration
Warning: using user "cluster" credentials from the environment
{"host": "n8n.bybiz.link", "http2https": true, "lets_encrypt": false}
[root@ns8 n8n2]#

these are the kinds of errors that can dim someone’s confidence…

let me push an update fixing some errors i have discoverd, then if you could kindly,
just PR the module with permission fixes afterwards,

that would help.

I have even downloaded a vscode extension that promises to resolve file write permission issues…

I wonder if github codespaces can solve…

Use WSL (Windows Subsystem for Linux) and edit your code with VS-Code on windows with remote access to WSL. It’s impossible to write scripts for Linux on a NTFS or FAT filesystem due to a mismatch in file- attributes and -permissions.

EDIT:
now also available in the Microsoft Store

2 Likes

everything seems to work fine now,

the only problem is now bad gateway.

image

How do i troubleshoot for bad gateway in module

1 Like

while its possible to run the commands on wsl for vscode, its not possible for these changes to be visible to the vscode env on windows

However the vscode codespaces on github, seems to notice the changes, let me see if it works once the file competes to build

edit: nope it did not work
edit2, actually seems it worked…

Now need to figure out bad gateway

2 Likes

did you try it?
Over here it woks as a charm, clone of your repo in WSL editing with VS-code on Windows.

3 Likes

try modify the permission and see if it appears on source control
something seems different with your setup…

let me figure it out.

1 Like