-
Notifications
You must be signed in to change notification settings - Fork 307
Beta 8 Hosting error: HTTP Error 502.3 - Bad Gateway #466
Comments
@Tratcher can you take a look? |
Also https://docs.asp.net/en/latest/publishing/iis.html#common-errors. Most of the bad gateway errors we've seen were the result of installing the incorrect HttpPlatformHandler. |
@mdmoura Explicitly confirm the version at |
@guardrex I checked and I have HTTP Plataform Handler 1.2.1959 installed. I followed the information you posted and now I get a very strange behavior: When I click on IIS "Browser website ... " in IIS the browser opens and I see on the browser title "Http Error 502.3 - Bad gateway" for a short moment even if the error is not displayed on the page ... And after that short moment the browser starts to load the website and I see "Waiting for ..." but nothing happens ... |
@mdmoura And you're using Kestrel not WebListener right? |
@davidfowl Yes, I am using Kernel but I found the problem. My configuration was fine but I had on project.json "1.0.0-*" ... It seems there are a few RC1 packages already published but not all so I had a mix of Beta8 and RC1 ... BTW, will RC1 include a solution for hosting a project on a Virtual Dir instead of using? If not I suggest adding the 404 error to Common Errors since this is what I got when not using Map. |
@mdmoura The vdirs are not fixed for rc1 because we need an update from the HttpPlatformHandler. aspnet/IISIntegration#14. Feel free to send a PR to the docs, or just to add a comment to that page. |
I ran into the same issue this morning, and after a few hours' researching, I successfully find something. In short, the Bad Gateway error is caused by failures during communication between HTTP Platform Handler and the application. So many reasons can cause this problem, and please do a step by step validation to diagnose:
After above confirmation, you can follow these steps to deal with your problem:
After each step, do an IIS reseting to confirm if problem solved. Still get problems? Try to use the stdout to figure out what's happening during the invocation when our apps starts. Edit your wwwroot\web.config file, at httpPlatform section, change value of stdoutLogEnabled attribute to true and save. Reset IIS and reload the page again. Browse to your approot and find what's wrote in the logs directory. There should be something really helpful. After solving problems, remember to restore your wwwroot\web.config. For me, I found dnx.exe is not recognized as an internal or external command thing, which means the runtime cannot find dnx. So the fastest way to solve my problem is to include runtime in my artifact. And it seems if your command use WebListener as hosting server, you will get problems when working with Http Platform Handler Good luck and expecting your experience. |
@jijiechen could you please elaborate on this:
How did you do this? I am having the same issue as you had and I already went through all of the steps that you described so throughly - thank you for that. I do have some issues with the one that solved your problem in the end. Kind regards, |
@vladcvoinescu In my last comment, the first part is about verifying your app works correctly; and second part is trying to solve problems that can cause failures on writing output logs or creating the process for launching your app. |
@jijiechen Thank you for your response. I went through all the steps with no luck. Stdout logs are created but are empty. I get a lot of those in the Server Manager -> Local Server -> Events: http://imgur.com/7SIufhb Any ideas? PS: I just read again your comment and I realized what you meant by including runtime. I will try that now. |
@vladcvoinescu Form your image, I can only see a title without details, could you please post them as well? |
@jijiechen The details for both the Warnings and the Errors are empty: http://imgur.com/HZMFgNv PS: I opened the Event Viewer and I could see the details there: http://imgur.com/3IE3DCD |
From your posted image, I can see the process can not be started.
You can find the process startup command in your web.config file, processPath attribute of httpPlatform section. If it successes, then I think if you use your current login credential as application identity for your application pool in IIS, you can make it. |
I currently have this in my httpPlatform section: PS: If I open cmd and go to the directory above wwwroot (the project's directory) and run dnx web, it runs the website perfectly fine. Is this what you meant? |
This is an example that runs successfully:
In your configuration, you sepcified to use %DNX_PATH% environment variable as processPath and %DNX_ARGS% as arguments. |
And here is content in the web.cmd, I hope it helps. @echo off IF EXIST %LOCAL_DNX% ( for %%a in (%DNX_HOME%) do ( :continue IF "%HOME_DNX%" NEQ "" ( IF "%DNX_PATH%" == "" ( @"%DNX_PATH%" --project "%~dp0packages\live.asp.net\1.0.0\root" --configuration Debug web %* |
Hello,
I created a new MVC Beta 8 project using simply the default template.
When I publish the project and host it on a server using IIS 8.5 I get the error:
What might be wrong?
Thank You,
Miguel
The text was updated successfully, but these errors were encountered: