inket / dokku-buildpack-jekyll4-nginx

Jekyll 4 on Dokku
MIT License
15 stars 34 forks source link

nginx operation not permitted error #10

Open chriswhong opened 7 years ago

chriswhong commented 7 years ago

Hi, thanks for putting together this buildpack. It worked like a charm for us on https://github.com/nycplanning/labs-planninglabs.nyc , but just tried deploying to a brand new dokku server and got this error when it was deploying:

nginx: [alert] sysctl(KERN_RTSIGMAX) failed (1: Operation not permitted)
nginx: [alert] sysctl(KERN_RTSIGMAX) failed (1: Operation not permitted)
nginx: [alert] sysctl(KERN_RTSIGMAX) failed (1: Operation not permitted)
nginx: [alert] sysctl(KERN_RTSIGMAX) failed (1: Operation not permitted)
nginx: [alert] sysctl(KERN_RTSIGMAX) failed (1: Operation not permitted)
nginx: [alert] sysctl(KERN_RTSIGMAX) failed (1: Operation not permitted)

Dokku version is 0.9.4 Host machine is Ubuntu 16.04.2 LTS

Has anyone ever encountered this error before?

inket commented 7 years ago

Never seen this error before, but it's caused by nginx. I looked on Google and apparently someone had the same issue and resolved it by using a newer nginx version.

See https://botbot.me/freenode/dokku/2016-08-05/?tz=America%2FLos_Angeles&page=1

[Miguel Andrade] @savant @michaelshobbs i figured out the problem [Miguel Andrade] unbelieveble [Miguel Andrade] the nginx build the buildpack was using wasn’t running [Miguel Andrade] changed it to a version I built myself [Miguel Andrade] and a much more recent version

For now, you can try using a newer nginx version (see the buildpack's compile file), and if that doesn't work, we'll look into what's wrong with installing/running it this way.

chriswhong commented 7 years ago

Thanks, I found that exact thread and reached out to Miguel on twitter, but no response yet. I am not very experienced with this and am not clear on how to just tell it to use another nginx version. The other examples of nginx buildpacks I am finding all seem to be building nginx from source, and are much more complex. Where does "https://s3.amazonaws.com/devmynd-github/heroku-nginx-1.6.0.tar.gz" originate from, and does whoever put it there also have other versions available?

inket commented 7 years ago

I figured it would be a simple version change in the URL, but that doesn't seem to be working. I have no idea where it originates from either (if you check the fork tree at the bottom of the readme you might have an idea though).

Your best bet is to find a popular buildpack that's installing nginx and to copy the code from there :/

chriswhong commented 7 years ago

I was trying to go down that route, either bringing the jekyll stuff from yours into https://github.com/dokku/buildpack-nginx or vice versa... this one builds fine on its own but I don't know how to add the jekyll stuff properly. Is there some trick to troubleshooting these buildpacks besides just making changes, pushing code to dokku and waiting to see what happens?

inket commented 7 years ago

I'm afraid not. Afaik, you'll have to keep pushing code and monitoring builds.

You can also attempt to remove nginx code from this buildpack and use the dokku/buildpack-nginx together as described in Using multiple buildpacks

chriswhong commented 7 years ago

So, persistence paid off, I was able to get it working with dokku/buildpack-nginx plus the jekyll bits from yours. The result is here: https://github.com/NYCPlanning/dokku-buildpack-jekyll

buildpack-nginx wants to copy everything from the root of the project into www and serve from there, so I modified it to grab _site/* after jekyll does its thing. Works like a charm on Dokku 0.9.4/Ubuntu 16.04.2 LTS.

Let me know if you are interested in a PR for this... not sure if it will have any issues with older nginx/linux that yours is working fine on right now.

Thanks for your help!

inket commented 7 years ago

That's great! 👏

Lots of people are using this buildpack so suddenly changing it in such a major way might break some systems, so I'm not looking to do that until it's necessary.

If other people have this problem with my buildpack, I'll refer them to yours. I'll keep the issue open so that it's easier to find!

chriswhong commented 7 years ago

Makes sense. Feel free to reach out if / when you start making major changes, we will be happy to collaborate.