Existing MVC project internal server error with only one error shown in the output from Diagnostic Hub

So one of my projects as an intern is to see what problems we run into when trying to run existing applications in Docker. The first project took some time but eventually worked like a charm. Now I’m trying to run another project in Docker but I’m having issues with little to no information on why it’s not working.

I added docker-compose through Add -> Docker Support, available in Visual Studio 2017. Debug will throw me an 500 internal server error. In the output of Visual Studio it will only show me:

Each line is from debugging once, so I’ve tried multiple solutions 6 times here.

What I’ve tried so far is as following:
Changing the target platform to x86 and x64.
Changing the dynamic connection string to a hard coded string with a valid uid and pwd (double checked that it still worked the old way)

My error/warning/messages list are all empty and the application is running in the traditional debug.

The application is a large MVC application that’s a copy from production, a large well known website in my country.

I am totally clueless what could be wrong or how to figure out as to how to solve this. I’m specialising in Software Engineering, so this is brand new territory for me.

Please post the docker-compose.yml file and details on the project you’re trying to build. Ideally, extract a code-snippet that reproduces the problem that others can test and help fix.

version: '2.1'

services:
  unknown.frontend.website:
    image: unknown.frontend.website
    build:
      context: .\unknown\Frontend\unknown.Frontend.Website
      dockerfile: Dockerfile

is the docker-compose.yml file, where unknown is the websites name, censored for secrecy policy. Its the standard one generated by adding Docker Support through Visual Studio 2017.

I wish I could add a code snippet to reproduce this problem, but visual studio gives me no info as to where this error is happening.

For the project itself, its a .net 4.5 framework MVC project. I’m currently only trying to run our frontend in Docker as a test to then follow it up by testing the backend and so fort.

The container starts succesfully and will run. However the site throws me an internal server error and the picture I showed is the only thing that I can find that could impose an issue, as the error is not there in the traditional debugging mode.

What happens if you use docker-compose build and docker-compose run from the commandline? Maybe that’ll give you better errors - I don’t know a lot about the VS tools.

I had decided to built the image and container from scratch. So I published my project, built an image, ran the container, but it gives me a Server Error - 500 - Internal server error.

Building the image and running the container was a painless proces. This however gives me no information as to why its not showing my view correctly. Whereas running it in the traditional way it works.

Kevin,

Have you tried to update the project so that it shows debugging/error details. If this is running in IIS then you should be able to modify your web.config to get more error details. This type of error is usually left intentionally generic for the production/release builds. How to enable this might be something specific to your codebase however the following example is how it is usually done…

<system.web>
<customErrors mode=“Off” />

</system.web>

Also, your system might be setup to output errors to a log directory (or can be enabled as this is often something that is also kept to a minimal in production) I would expect to see an entry in my systems if it was some missing or broken dependency.

Hello Labrat, thank you for your suggestion!

I am running a container of the microsoft/aspnet image. So it should be running in IIS, however I can’t (find out how to) configure IIS inside the container to show detailed errors. My web.config contains both and but IIS is having none of it when it runs in a container.

I have checked every log I could find and I couldn’t find anything worthwhile. My container logs are also completely empty.

I am however 99.9% sure my web.config is the issue here. I am completely rewriting the web.config because in our legacy application the web.config is far off from a default web.config, it is completely tailored to our needs and our environments. I am very persistent on getting this to work and will update when I finally managed to. Any suggestions however are still highly appreciated.