Server Set Up Error in Docker

I have followed the server setup steps for installing n8n on Umbuntu with docker.

When I try and start docker composer I get the following error

ERROR: yaml.parser.ParserError: while parsing a block mapping
in “./docker-compose.yml”, line 1, column 1
expected , but found ‘’
in “./docker-compose.yml”, line 1, column 14

Can anybody point me in the right direction as to what I have do wrong?

Welcome to the community @commissionly!

This error means in plain English: “Your YAML file is messed up”

Most likely do you use spaces on some lines and tabs on others. Or anything else that breaks the YAML. You can try an online linter like this one: http://www.yamllint.com to find out what exactly is wrong.

Hi Jan

Thanks for the response - I am copying the example file directly from the setup document. I have tried using both Vim and Nano but both are giving an error. Any other way I can get this file onto the server?

Thanks
Martin

I have tried the linted version and get a different error

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
in “./docker-compose.yml”, line 1, column 13

on


services:
n8n:
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER
- N8N_BASIC_AUTH_PASSWORD
- “N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}”
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- “WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/”
- “VUE_APP_URL_BASE_API=https://${SUBDOMAIN}.${DOMAIN_NAME}/”
image: n8nio/n8n
labels:
- traefik.enable=true
- “traefik.http.routers.n8n.rule=Host(${SUBDOMAIN}.${DOMAIN_NAME})”
- traefik.http.routers.n8n.tls=true
- traefik.http.routers.n8n.entrypoints=websecure
- traefik.http.routers.n8n.tls.certresolver=mytlschallenge
- traefik.http.middlewares.n8n.headers.SSLRedirect=true
- traefik.http.middlewares.n8n.headers.STSSeconds=315360000
- traefik.http.middlewares.n8n.headers.browserXSSFilter=true
- traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
- traefik.http.middlewares.n8n.headers.forceSTSHeader=true
- “traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}”
- traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
- traefik.http.middlewares.n8n.headers.STSPreload=true
ports:
- “127.0.0.1:5678:5678”
restart: always
volumes:
- “/var/run/docker.sock:/var/run/docker.sock”
- “${DATA_FOLDER}/.n8n:/root/.n8n”
traefik:
command:
- “–api=true”
- “–api.insecure=true”
- “–providers.docker=true”
- “–providers.docker.exposedbydefault=false”
- “–entrypoints.websecure.address=:443”
- “–certificatesresolvers.mytlschallenge.acme.tlschallenge=true”
- “–certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}”
- “–certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json”
image: traefik
ports:
- “443:443”
restart: always
volumes:
- “${DATA_FOLDER}/letsencrypt:/letsencrypt”
- “/var/run/docker.sock:/var/run/docker.sock:ro”
version: “3”

Why is the first line version: "3" for you in the last line?

That’s what came back in the linted version.

I have solved the issue by installing the JED editor onto the server and creating the file with this. The other editors seemed to be messing with the layout.

Ah interesting. Great to hear that you could find a solution!

A solution to running composer -which takes me to the next error

ERROR: for ubuntu_traefik_1 Cannot start service traefik: OCI runtime create failed: container_linux.go:34
9: starting container process caused "process_linux.go:449: container init caused "process_linux.go:432: r
Creating ubuntu_n8n_1 … done

ERROR: for traefik Cannot start service traefik: OCI runtime create failed: container_linux.go:349: starti
ng container process caused “process_linux.go:449: container init caused “process_linux.go:432: running pr
estart hook 0 caused \“error running hook: signal: killed, stdout: , stderr: \”””: unknown

No idea what is going on here or why it seems to work fine for everybody but not you. What operating system are you using? Anything else which is special in your case?

But to be honest I will probably not be able to help you here at all. I can help you with n8n related issues but this here has nothing to do with n8n directly. Is not that I do not want to help you, it is simply that I do not have enough low level docker experience to be able to. Guess your best chance is to google this errors and hope that somebody else had the same ones and found a solution for it.

The server is AWS Lightsail - Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-1018-aws x86_64)

Does seem I am running into issues that other are not.

Do you have a recommended OS version , I can kill this server and start again

Sadly could not test with Lightsail, because when I try to create an instance I get the error ResourceLimitExceed. So I used Digital Ocean instead and created a totally new and clean droplet. For it I selected Ubuntu 20.04 and then followed the Server Setup Guide. I made a few changes while doing that to account for version 20.04, to also upgrade all packages to the latest version (never a bad idea):

at the end of it, my instance did run totally fine and was reachable via https and its subdomain.

The slightly updated guide is not on the website yet but here in the Github repository:

Not sure if it makes a difference in your case and if there is a difference between the Ubuntu Lightsail uses and the on from Digital Ocean but if you follow this guide it should theoretically work with Ubuntu 18.04 and 20.04.

I am in some sort of circle of hell with this software.

I have spun up a digital ocean server, followed the instructions through to the part to create the yml file - when I try and copy it onto the server none of the editors can do it, they all mess it up

Just tell me how to set this up or email me and I will give you the log in to the box and you can try because this is a pain.

I simply used vi to do it. But write you a short private message.