Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LXC Container generation fails with openresty failed to start #118

Closed
DjQuro opened this issue May 22, 2023 · 17 comments
Closed

LXC Container generation fails with openresty failed to start #118

DjQuro opened this issue May 22, 2023 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@DjQuro
Copy link

DjQuro commented May 22, 2023

Script
nginx-proxy-manager

Describe the bug
After running curl -sL https://raw.githubusercontent.com/ej52/proxmox/main/lxc/nginx-proxy-manager/create.sh | bash -s the below mentioned error occurs
System info:

  • Proxmox Version: 7.4-3
  • Alpine Version: Sorrry, I don't know

Screenshots
https://share-your-photo.com/6054c31801

Additional context

[error] Starting services
/tmp/npm_install.sh: line 250: rc-service openresty start
4
configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
openresty failed to start
[error] 195 NULL: pct exec $_ctid -- sh -c "wget --no-cache -qO - $_raw_base/setup.sh | sh"
@DjQuro DjQuro added the bug Something isn't working label May 22, 2023
@florian30491
Copy link

Script nginx-proxy-manager

Describe the bug After running curl -sL https://raw.githubusercontent.com/ej52/proxmox/main/lxc/nginx-proxy-manager/create.sh | bash -s the below mentioned error occurs System info:

  • Proxmox Version: 7.4-3
  • Alpine Version: Sorrry, I don't know

Screenshots https://share-your-photo.com/6054c31801

Additional context

[error] Starting services
/tmp/npm_install.sh: line 250: rc-service openresty start
4
configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
openresty failed to start
[error] 195 NULL: pct exec $_ctid -- sh -c "wget --no-cache -qO - $_raw_base/setup.sh | sh"

I am receiving the same error.

@cmseasy
Copy link

cmseasy commented May 23, 2023

Same error here on Proxmox 7.4-3

@wylie39
Copy link

wylie39 commented May 23, 2023

Same on 7.3-3

@Glitch3dPenguin
Copy link

I am also having this issue running Alpine 3.16 running on Proxmox 7.4-3

@ExCoderAtWork
Copy link

I am having the same exact issue.

@Glitch3dPenguin
Copy link

I got this working with these steps:
https://klabsdev.com/posts/NginxProxyManager/

@florian30491
Copy link

I got this working with these steps: https://klabsdev.com/posts/NginxProxyManager/

Just works. Thanks for your help.

@MyCleverGirl
Copy link

I got this working with these steps: https://klabsdev.com/posts/NginxProxyManager/

i got it install and working but when i reboot it dont work. no matter how many times i install it?

@jidehem92
Copy link

jidehem92 commented Jun 11, 2023

it's related to the nginx.pid file for some reason.
log into container, edit /usr/local/openresty/nginx/conf/nginx.conf and comment the line starting with pid like this :
# pid /run/nginx/nginx.pid;

it works ok, even after reboot, but SSL certificates are not working proprely

@MoncefYabi
Copy link

it's related to the nginx.pid file for some reason. log into container, edit /usr/local/openresty/nginx/conf/nginx.conf and comment the line starting with pid like this : # pid /run/nginx/nginx.pid;

it works ok, even after reboot, but SSL certificates are not working proprely

Thanks for providing this workaround.
I can confirm this. I commented out pid /run/nginx/nginx.pid; and the proxy manager started after I reboot the LXC container.
What did you mean with "but SSL certificates are not working proprely"?

@jidehem92
Copy link

certbot was failing with error mentionned here : https://community.letsencrypt.org/t/nginx-proxy-manager-and-cert/198147
I've found a workaround : edit /opt/certbot/pyvenv.cfg and change :
include-system-site-packages = false
to
include-system-site-packages = true

@Glitch3dPenguin
Copy link

it's related to the nginx.pid file for some reason.

log into container, edit /usr/local/openresty/nginx/conf/nginx.conf and comment the line starting with pid like this :

# pid /run/nginx/nginx.pid;

it works ok, even after reboot, but SSL certificates are not working proprely

I am going to edit my script to do this on install so that isn't an issue any longer. Thanks for pointing this out!

@DocDrydenn
Copy link

DocDrydenn commented Jun 15, 2023

My findings:

The script creates the /run/nginx/ folder, however by the time it reaches the end of the script to start the services, that /run/nginx/ folder is missing. (unsure as to why/how, but it's not there)

After running the script, and letting it error out on the whole nginx.pid stuff, I manually create the /run/nginx/ folder and restart the services... they fire right up without issue.

@Glitch3dPenguin
Copy link

it's related to the nginx.pid file for some reason. log into container, edit /usr/local/openresty/nginx/conf/nginx.conf and comment the line starting with pid like this : # pid /run/nginx/nginx.pid;

it works ok, even after reboot, but SSL certificates are not working proprely

I had to run a restart and ran into the same issue. After commenting out line 3 in /usr/local/openresty/nginx/conf/nginx.conf I no longer get the same error. Not sure why the script is removing the folder on reboot or on startup. Not sure why this happens but regardless I did update my post.

@jennec
Copy link

jennec commented Jun 23, 2023

The container is removed after this error occurs. There is nothing to connect to or change to be able to work around this problem.

@jidehem92
Copy link

@jennec Follow this tutorial : https://klabsdev.com/posts/NginxProxyManager/ (Tested on proxmox 7.4.3 & alpine 3.16)

@DocDrydenn
Copy link

DocDrydenn commented Jun 23, 2023

Again, I've tested and repeated this numerous times... however I don't know why it's happening.

alphine.sh @ line 142, the /run/nginx/ folder is created, however, by the time it reaches line 250, the /run/nginx/ folder is gone. This causes line 250 runcmd rc-service openresty start to fail.

  1. Manually create the folder with mkdir /run/nginx/
  2. Start openresty with rc-service openresty start
  3. Restart npm with rc-service npm restart

Everything fires up like it should.

Also, a reboot of the container also somehow removes the /run/nginx/ folder, so you end up right back to where you were by running the install script. Just repeat the above three steps and it will fire up like it should.

This all stems around the missing /run/nginx folder.

(Note: I'm still running v2.10.1, so I'm not sure if this is still the case for the newer v2.10.3... I heard that the newer version also requires a npm user be created... again, not exactly sure about v2.10.3.)

@ej52 ej52 closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests