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

[Feature Request} Improve error messages #47785

Open
SetTrend opened this issue May 1, 2024 · 2 comments
Open

[Feature Request} Improve error messages #47785

SetTrend opened this issue May 1, 2024 · 2 comments
Labels
kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny status/0-triage

Comments

@SetTrend
Copy link

SetTrend commented May 1, 2024

Description

Currently, Docker engine or Docker daemon error messages are utterly poor and taciturn.

They don't provide any sort of context, stack trace or any other kind of helpful information, assisting in trying to remedy the reported issue.

Please, improve Docker error reporting drastically. It will lower the amount of GitHub and StackOverflow issues and lower your burdon to handle these.

Ref:

@SetTrend SetTrend added kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny status/0-triage labels May 1, 2024
@SetTrend SetTrend changed the title Improve error messages [Feature Request} Improve error messages May 1, 2024
@thaJeztah
Copy link
Member

Thanks for reporting. Yes, these errors on Windows are not (erm) ideal. Unfortunately, I'm not sure how much we can do for these. Looking at the examples from microsoft/Windows-Containers#490 ;

docker: Error response from daemon: container 46a5305c0e305a9b5e7ef5fd746478ea9211b61d136fc7a08b8e4468939514a7 encountered an error during hcs::System::CreateProcess: c:\windows\system32\cmd.exe: failure in a Windows system call: The user name or password is incorrect. (0x52e)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000].

And

docker: Error response from daemon: hcs::CreateComputeSystem cf0c577360d731d6e09be5c1eec629751c3891eba85353163c0978cc0c293054: The request is not supported.

Both of these errors originate from the Microsoft hcsshim SDK, and only part of the error comes from the SDK itself; the actual error comes from the Windows kernel (which is proprietary, and effectively a black box).

func CreateComputeSystem(ctx context.Context, id string, hcsDocumentInterface interface{}) (_ *System, err error) {
operation := "hcs::CreateComputeSystem"

if e.Operation != "" {
s += " encountered an error during " + e.Operation
}
switch e.Err.(type) {
case nil:
break
case syscall.Errno:
s += fmt.Sprintf(": failure in a Windows system call: %s (0x%x)", e.Err, hcserror.Win32FromError(e.Err))
default:

Unfortunately this often means that docker engine called the Windows kernel API (through their SDK), and "something went wrong"; the underlying error may not (often is not) known to the Docker Engine, so the only thing we can provide in this case is to print all the error information we received.

@SetTrend
Copy link
Author

SetTrend commented May 2, 2024

Thanks so much for your very informative reply!

So, from your response I understand that the root of this issue isn't based in this repository but in the microsoft/hcsshim repository? Would they be able to put more "flesh to the bones" and return an error structure providing more details about why the error occured?

I couldn't find the definition of context.Context in that repository. Wouldn't it be beneficial if your repository (i.e., this repository here) would output the contents of the context.Context struct provided to the CreateComputeSystem() call along with the error message in case of an error? (Perhaps only if a "debug" option was provided to docker run.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny status/0-triage
Projects
None yet
Development

No branches or pull requests

2 participants