Nodejs Passport.local works fine on linux but not in docker container: 502 error

Issue

I have a Node application with passport-local authentication. In Visual Studio on Ubuntu, when I run the app it works fine, if login is successful it redirects to the homepage.

When I build a docker container from that app in ubuntu, pages that do not need login work fine, but pages that need login give the problem: when I log in with correct username and pw, instead of redirecting it gives a http 502 error, "currently unable to handle this request". I do not see any errors or logs.

The same app on MacOS, works from Visual studio AND works from a container that is build in the same way.

Hope someone can help, thanks!

Solution

Problem solved. Probably due to alpine container, if I build it wit bullseye-slim it works as it should be.

Strange because when built on mac with alpine, container runs fine, but when built and run on linux it gives 139 error.

So when using bullseye-slim it is ok. No more alpine… although I regret this.

Answered By – Herman

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published