Arcanox
Arcanox

Reputation: 1547

ASP.NET Core app only works as root

I just updated all the Microsoft packages on my ASP.NET core app to the latest 2.1 versions (as well as updated the SDK to 2.1.4 on my CentOS server) and pushed the code to the server. I rebuilt the code server-side and deployed it to the web root. I can't get the server to respond now unless it runs as root. When attempting to connect through the Apache proxy, I get a 502 Proxy Error and when I attempt to connect directly to the SSL port the Kestrel server is listening on, I get ERR_CONNECTION_CLOSED in Chrome.

If I run the site manually as root user (dotnet WebsiteMainDll.dll) it works fine. If I run it manually as the user it should run as (sudo -u siteuser dotnet WebsiteMainDll.dll), it doesn't work.

There are no errors shown in the console. It just shows Now listening on https://0.0.0.0:44313 and is silent from that point on.

I have another instance of the site running on the pre-updated codebase and it works fine running as site user. This instance worked fine pre-update. What's going on?

Upvotes: 3

Views: 1374

Answers (1)

Arcanox
Arcanox

Reputation: 1547

I discovered this was due to permissions issues on some local SSL certificates. I feel either the .NET SDK update installed new packages on my system that messed up permissions, or one of the new ASP.NET Core NuGet packages changed the way SSL is handled in Core.

I found the solution here: https://github.com/dotnet/cli/issues/9391

Upvotes: 2

Related Questions