Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to troubleshoot why nanoserver is failing #564

Open
bendu opened this issue Jan 23, 2025 · 8 comments
Open

How to troubleshoot why nanoserver is failing #564

bendu opened this issue Jan 23, 2025 · 8 comments
Labels
question Further information is requested

Comments

@bendu
Copy link

bendu commented Jan 23, 2025

I'm trying to migrate my application from server core base image to nano server base image to reduce the image size. However, the container just exists with exit code -1073741515 which seems to suggest some dependency is missing. Are there tools or error logs I can check to help troubleshoot?

The application based on dotnet core, but I think some of the package dependencies are written in C++, which is where I suspect needs additional dependencies.

@bendu bendu added question Further information is requested triage New and needs attention labels Jan 23, 2025
Copy link

Thank you for creating an Issue. Please note that GitHub is not an official channel for Microsoft support requests. To create an official support request, please open a ticket here. Microsoft and the GitHub Community strive to provide a best effort in answering questions and supporting Issues on GitHub.

@jsturtevant
Copy link

You can use something like https://learn.microsoft.com/en-us/sysinternals/downloads/procmon to identify the missing dll loads. You can run it on the host and will get the events from the container.

@bendu
Copy link
Author

bendu commented Jan 24, 2025

@jsturtevant Thanks for the help. I was able to track CreateFile and LoadImage calls to identify what dlls were getting loaded.

However, I'm now getting an error message like " ---> System.DllNotFoundException: Unable to load DLL 'somedll.dll' or one of its dependencies: The specified procedure could not be found. (0x8007007F)"

From what I can tell in procmon, it tried to load ole32.dll a second time from the application folder and then loaded faultrep.dll (which I'm guessing means the application gave up)

Are there other tools I can use to determine if there is a specific OS API function that's missing?

@ntrappe-msft ntrappe-msft removed the triage New and needs attention label Jan 27, 2025
@ntrappe-msft
Copy link
Contributor

@bendu Can you help us understand your use case more? Do you want a static analyzer to figure out which dlls are missing from the get-go? Or a dynamic one that can report errors as you're trying to run your app?

@bendu
Copy link
Author

bendu commented Feb 13, 2025

@ntrappe-msft Looking through procmon, I don't think its a specific dll that is missing but rather a function within a dll. (At least that's why I think it loads ole32.dll a second time). The error messages from the application are vague and hard to take action on.

I am looking at migrating other applications as well to nanoserver, so both static and dynamic analyzers to figure out missing dlls would be helpful in those cases.

@jsturtevant
Copy link

I am not aware but that is possible. One unsupported way to test if this is missing function, would be to copy the dll from the windows server container and see if things work. I have to stress that is a diagnostic tool not a supported way to run containers.

If it is missing a function then there isn't a ton you can do to resolve on your own. You would need the Windows team to fix it but there are reasons for the binaries being trimmed down, mainly size and start up time. You can see there have been instances of this in the past: #72

@bendu
Copy link
Author

bendu commented Feb 13, 2025

Its been a couple weeks since I've been investigating this, but I did try to copy in ole32.dll from server core container and the application just exited without any message when I attempted that. I'll try to play around with this some more in the coming days to see if I find anything interesting.

@bendu
Copy link
Author

bendu commented Feb 21, 2025

@jsturtevant Been playing around with using ole32.dll from server core. Seems things just crash without any message.

It is really hard to tell what exactly the container is failing on. If I know what function things are failing on, then I can look into workarounds to avoid that function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants