heroku / heroku-buildpack-static

[DEPRECATED] Heroku buildpack for handling static sites and single page web apps
MIT License
673 stars 427 forks source link

Add support for Heroku-20 #166

Closed edmorley closed 3 years ago

edmorley commented 4 years ago

Testing this buildpack against the upcoming Heroku-20 stack, the build is marked as successful, however at runtime nginx fails to start, due to:

app[web.1]: Starting log redirection...
app[web.1]: Starting nginx...
app[web.1]: bin/nginx: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
app[web.1]: Process exited unexpectedly: nginx

libcrypto is part of libssl: https://packages.ubuntu.com/bionic/libssl1.0.0

...and the reason this error occurs is that Ubuntu 20.04 (on which Heroku-20 is based) no longer provides the v1.0.0 version of libssl, only v1.1: https://packages.ubuntu.com/focal/libssl1.1

Conversely, Cedar-14 and Heroku-16 don't ship with libssl1.1, so there isn't a single version that can be used by all of them.

As such, stack specific binaries will be required, and so adding support for Heroku-20 is blocked on #165 being fixed first.

edmorley commented 4 years ago

@hone @mars Hi! Just checking this is on your radar? It would be great to have heroku-buildpack-static / CRA support for Heroku-20 when it goes public beta (though we wouldn't block on it).

edmorley commented 4 years ago

Heroku-20 is now in beta: https://devcenter.heroku.com/changelog-items/1937

valentinoli commented 3 years ago

I was just updating my app's Heroku stack to heroku-20 and came across this issue. Thank you for updating the buildpack to support it :)

edmorley commented 3 years ago

@valentinoli You're welcome! :-)

valentinoli commented 3 years ago

I updated the stack, re-added the buildpack and redeployed. However, I get this error. It appears to be related to the proxies configuration option:

2020-11-19T12:58:32.002847+00:00 app[web.1]: Starting nginx...
2020-11-19T12:58:32.124327+00:00 app[web.1]: nginx: [emerg] unknown directive "proxy_ssl_server_name" in ./config/nginx.conf:90
2020-11-19T12:58:32.129480+00:00 app[web.1]: Process exited unexpectedly: nginx
2020-11-19T12:58:32.129581+00:00 app[web.1]: Going down, terminating child processes...

Any ideas?

valentinoli commented 3 years ago

I see this line in the Heroku build log:

-----> Installed nginx 1.19.0 to /app/bin

And proxy_ssl_server_name should be supported by versions > 1.7.0 according to nginx docs

edmorley commented 3 years ago

Hmm that's strange. Could you file a new issue, and in it include your static.json? I'd also be interested to see the contents of the generated /app/config/nginx.conf to see if the error message is perhaps caused by something else (eg previous lines broken meaning the directive isn't correctly inside the location block etc).

valentinoli commented 3 years ago

Will do, thanks

valentinoli commented 3 years ago

How do I see the contents of the generated nginx.conf? I can't see it anywhere on the Heroku dyno...

edmorley commented 3 years ago

@valentinoli I've actually just managed to reproduce this using the proxy example in the README. I'm happy to file the issue now if that helps?

valentinoli commented 3 years ago

Ok that's great! Sure go ahead :) I can post my static.json there if that helps

edmorley commented 3 years ago

Filed #185.