Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

502.3 bad gateway when some controller can't load due to forgotten inheritance #5596

Closed
arielcloud opened this issue Dec 5, 2016 · 9 comments

Comments

@arielcloud
Copy link

I have controllerA and serviceA which injected to controllerA.
I forgot to inherit serviceA : IServiceA.
I got no error on compilation, since I'm using structureMap WithDefaultConventions(), so I didnt need to AddTransient<> explicitly.
Once I tried to post a http request to controllerA - the request is pending a long time, and then I got 502.3 bad gateway.
I tried to debug and ask visual studio to break on all exceptions, but no exception thrown.
so, it was very very hard to debug the problem...

any idea?

@pranavkm
Copy link
Contributor

pranavkm commented Dec 5, 2016

It's likely that your application is failing to start and running in to this - aspnet/Tooling#363. Try running it from the command line (dotnet run) to see if that's the case.

@arielcloud
Copy link
Author

arielcloud commented Dec 5, 2016

no, it's not failing to start, since I succeeded to get and post to other controllers, just if I trying call controllerA I get this error (I also tried running from the command line, and it is start without any error)

@Eilon
Copy link
Contributor

Eilon commented Dec 15, 2016

@arielcloud what component do you feel should be throwing an exception? As far as MVC is concerned it appears that the controller doesn't exist, and that's at most a 404 error (there are of course infinitely many controllers that don't exist, and those don't thrown an exception).

@arielcloud
Copy link
Author

arielcloud commented Dec 15, 2016

can u help me to feel this component?... do u know which component return this 502.3, so I'll ask them to give 404 which is maybe more indicative, otherwise u can close this, thanks!

@Eilon
Copy link
Contributor

Eilon commented Dec 15, 2016

@arielcloud the ASP.NET Core Module (AspNetCoreModule / ANCM), which is an IIS module, is what's related to the 502.3. It shows that error when it can't even start the ASP.NET Core application.

@arielcloud
Copy link
Author

@Eilon , but as I said - in this case the app was up, and I could post and get to other controllers, so maybe it is a bug?

@arielcloud
Copy link
Author

arielcloud commented Dec 15, 2016

should I open an issue here ?

@Eilon
Copy link
Contributor

Eilon commented Dec 15, 2016

@arielcloud the 502.3 is I think generally only when the app can't load, or if the app completely crashed during a request. The question is what error is happening. So I recommend enabling logging to see what the exception is.

@arielcloud
Copy link
Author

thanks, the logs are good!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants