Azure Site (Windows) ASP.NET Core 2.2 stdout logging not working and 502.5

0

I have an ASP.NET Core 2.2 site deployed to an Azure Site (App Service? Web Site?) running Windows (10, powershell says). I've installed the ASP.NET Core 2.2 service extension that contains the ancmv2 (I know where the actual DLL is) but I'm not 100% sure it works, so I'm specifying the old ANCM in the web.config.

I have supplied a web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="true" stdoutLogFile="\\?\%HOME%\LogFiles\stdout"
forwardWindowsAuthToken="false" /> </system.webServer> </location> </configuration>

Note that I've tried \?\D:\home\LogFiles\stdout, \?\%home%\LogFiles\stdout, as well as plain "D:\home\LogFiles\stdout" but nothing has worked. Recently.

However, not only do I get a 502.5 when browsing the app, in the eventlog.xml in the LogFiles directory I get the following:

Warning: Could not create stdoutLogFile \\?\home\Logfiles\stdout_12384_201922410542.log, ErrorCode = -2147024893.

I mean, the 502.5 is annoying and stuff, but I would have a chance of fixing it myself if only it gave me console logging. As an additional clue - this is the only other log entry I get:

Application 'MACHINE/WEBROOT/APPHOST/MYAPP' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline '%LAUNCHER_PATH% %LAUNCHER_ARGS%', ErrorCode = '0x80070002' : 0.

This leads me to believe my web.config isn't being read at all, that it would have some dodgy default web.config that it tries to use instead. I have no supporting evidence of this, and Google has nothing for me - but given the thousands of things I've changed, including DELETING the web.config completely without errors changing much, this starts to seem plausible to me.

EDIT - there is no tag for ASP.NET Core. That feels like a pretty huge omission. sadly I don't have the power to rectify.

windows
web.config
azure-web-apps
502-error
stdout
asked on Server Fault Feb 24, 2019 by hrillo666

1 Answer

-1

This is not the issue.

The actual web.config is wrong. The logfile is stated as \.\home\LogFiles\stdout

The problem is that I had to reconfigure Kudu to be able to edit the file in the interface due to the minimal amount of files the UI can handle. I had no idea how to do that at first, so I just copied the web.config to the parent folder and looked at it. Naturally I then made the corrections, saved the file and tried to copy it back. This did NOT WORK.

I then modified Kudu (by pasting some javascript into the console as instructed) and browsed the main folder again and tried to edit the web.config. Again NOT ALLOWED.

So the basic problems is that an invalid version of web.config has been saved and is now locked, and I can't fix it. WinSCP thinks that the only reasonable way to deal with the file being locked is to silently fail and let me think that my changes have been persisted.

Anyway - not the problem I thought I had. A very locked file, that's it. Have Azure support on the case, hopefully they can help me.

answered on Server Fault Feb 24, 2019 by hrillo666

User contributions licensed under CC BY-SA 3.0