bari86
March 18, 2022, 7:49am
1
HiI am trying to use this code below in ecosystem.config.js via pm2 but it is not working. i can use up to N8N_BASIC_AUTH_PASSWORD correctly, but not anything beyond that.
code used
module.exports = {
apps : [{
name : "n8n",
env: {
N8N_BASIC_AUTH_ACTIVE:true,
N8N_BASIC_AUTH_USER:"user",
N8N_BASIC_AUTH_PASSWORD:"pass"
N8N_HOST=subdomain.domain.com
WEBHOOK_URL=https://subdomain.domain.com
GENERIC_TIMEZONE=Europe/London
EXECUTIONS_TIMEOUT=3600
EXECUTIONS_TIMEOUT_MAX=7200
}
}]
}
the error shows
[PM2][ERROR] File /root/ecosystem.config.js malformated
/root/ecosystem.config.js:8
N8N_HOST=subdomain.domain.com
^^^^^^^^
please help
Jon
March 18, 2022, 7:52am
2
Hey @bari86 ,
Looks like the first few have " " around it, have you tried adding those around the others?
1 Like
Looks like there are also a few commas missing. For example N8N_BASIC_AUTH_USER:"user",
ends with one, but the next line doesn’t. Check out PM2 - Environment Variables (keymetrics.io) for an example ecosystem file.
bari86
March 18, 2022, 8:11am
4
Sorry. I did miss the commas. Added commas to all line now except the last line. Now I put and it shows this error. i tried with " " and without.
N8N_HOST=sub.domain.com,
^^^^^^^^^^^^^^^^^^^^^^
bari86
March 18, 2022, 8:15am
5
I think its working now. I made few other error like : with =
module.exports = {
apps : [{
name : "n8n",
env: {
N8N_BASIC_AUTH_ACTIVE:true,
N8N_BASIC_AUTH_USER:"user",
N8N_BASIC_AUTH_PASSWORD:"password",
N8N_HOST:"sub.domain.com",
WEBHOOK_URL:"https://sub.domain.com",
GENERIC_TIMEZONE:"Europe/London",
EXECUTIONS_TIMEOUT:3600,
EXECUTIONS_TIMEOUT_MAX:7200
}
}]
}
2 Likes
Great news and thanks for sharing your working config!