GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
318 stars 59 forks source link

Windows: Docker build ran into an internal error #3068

Closed Ezard closed 2 years ago

Ezard commented 2 years ago

Expected Behavior

I should be able to run my Skaffold project via Run Configurations, without errors

Actual Behavior

Running a Skaffold project via Run Configurations causes a Docker error. If I take the exact same command that the plugin has generated and run it manually in WebStorm's terminal, there is no error

The generated command is:

C:\ProgramData\chocolatey\bin\skaffold.exe dev --filename skaffold.yaml --profile qa --label ide=WebStorm --label ideVersion=2021.3.2.0.0 --label ijPluginVersion=22.2.1-213 --cleanup=false --auto-build=false --auto-deploy=false --auto-sync=false --rpc-port 50051 --port-forward=true --wait-for-deletions-max=2m0s --status-check=true --verbosity warn

The error that is produced is:

exit status 1. Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..

Additional Information

etanshaul commented 2 years ago

hi @Ezard thanks for the report. Is there any more info in the output? Could you try running in verbose mode? (In the Run Configuration, set verbosity to debug, and try running again).

Also, is it consistent that it fails from the Run Configuration? (and consistently works from the command line)

Ezard commented 2 years ago

@etanshaul so it now appears to be working, without any obvious reason why (OS hasn't been restarted, IDE hasn't been restarted, Docker hasn't been restarted)

The error was consistently occurring for me yesterday and earlier today (tested across multiple projects), and running Skaffold from the command line has always worked without any errors

All of my configurations now have the verbosity set to debug, so if it occurs again then I'll post more info here

If it doesn't happen again in the next week or 2 then I'll close the issue and just assume that something weird was going on with my machine for a few days :)

etanshaul commented 2 years ago

Thanks @Ezard for the quick response. Sounds good. We can keep this open for now in case you run into more issues here.

Ezard commented 2 years ago

@etanshaul so I believe I've figured out what this issue is, and it seems like I may have reported the original error incorrectly (sorry!)

So when using a Run Configuration, the logs from Docker that let you know what's going on with the build process (e.g. files being added, commands being run, etc) are not displayed (whereas they are displayed when running the Skaffold command manually); instead, after the logs that say something like

Starting build...
Building [my-image]…
Target platforms: [linux/amd64]

the process appears to hang, and then eventually spits out

exit status 1. Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..

In the case that I came across today, this occurred because there actually was an error in the Dockerfile

For my original issue report, it's entirely likely that I saw everything hang for a while when using a Run Configuration, but appear to work fine when I ran the Skaffold command manually (because I could see Docker doing stuff, so I assumed that everything was fine (gives self a slap on the wrist for assuming)). I can't say for certain whether or not this was the case since it was a while ago now, but it is possible

I wasn't able to find a separate GitHub Issue regarding Docker build logs not appearing when using a Run Configuration; if it already exists then awesome, but if not then I'll create it and we can probably close this issue and put it down to user error :)