buildx icon indicating copy to clipboard operation
buildx copied to clipboard

Error: failed to receive status: rpc error: code = Unavailable desc = closing transport due to: connection error: desc = "error reading from server: io: read/write on closed pipe", received prior goaway: code: NO_ERROR

Open gitfxx opened this issue 3 years ago • 4 comments

buildx-version:0.7.0 buildkit-version:0.9.0 driver: --driver kubenetes

image Error: failed to receive status: rpc error: code = Unavailable desc = closing transport due to: connection error: desc = "error reading from server: io: read/write on closed pipe"

gitfxx avatar Apr 27 '22 11:04 gitfxx

Can you update buildx and BuildKit and let us known if you still have this issue? Thanks.

crazy-max avatar Apr 28 '22 13:04 crazy-max

I am facing a similar error while building

docker-compose build --no-cache --build-arg GIT_BRANCH=VIK-97-add-sign-in-with-google-ui  
  
.....  
=> exporting to image                                                                                                                                                             
 => => exporting layers                                                                                                                                                            
failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF  

g-kartik avatar May 11 '22 12:05 g-kartik

Any updates on why this is happening and how it can be fixed?

g-kartik avatar May 18 '22 12:05 g-kartik

After this error, it requires PC restart to fix the issue and after that only building for a single time, the error repeats and again I restart the PC.

g-kartik avatar May 18 '22 12:05 g-kartik

After this error, it requires PC restart to fix the issue and after that only building for a single time, the error repeats and again I restart the PC.

This is what is happening to me right now. What fixed your issue?

yohnster avatar Oct 31 '22 17:10 yohnster

This is very frustrating and not stable Docker Desktop for Windows. My issue is still not fixed even after restart couple of times. I re-installled few times and then use "docker system prune" command as well.

How to fix this issue ?

st-sukanta avatar Nov 23 '22 22:11 st-sukanta

@st-sukanta @g-kartik @yohnster I have found the cause of the problem, which is caused by a sudden outage of the buildkit server.

gitfxx avatar Nov 24 '22 01:11 gitfxx

I ran into this same error when trying to build a Dockerfile which had a make -j step, which can cause a ton of processes to run in parallel. The docker build process would halt for several minutes, docker ps calls would hang, and then eventually the build process would give this error. I was able to fix it by limiting the number of jobs make would start by changing the command to make -j $(nproc).

Macil avatar Dec 28 '22 10:12 Macil

I have had the same issue but I guess with different reason, as I left no stone unturned and found no clue about the reason, I will publish my answer here. I hope it saves you time.

after windows update KB5022845, based on their documentation you might come across some I/O problems. to solve this, the only thing you need to do is to run your docker desktop via admin permission. this is a simple solution but can waste days of your worktime to find it out.

sadeghesfahani avatar Feb 16 '23 08:02 sadeghesfahani

This also happens with Docker on Mac (desktop)...

AntonOfTheWoods avatar Apr 19 '23 12:04 AntonOfTheWoods

Hi! Editing .devcontainer/devcontainer.json file worker for me:

https://github.com/microsoft/vscode-remote-release/issues/7958

...
"build": {
  "dockerfile": "Dockerfile",
  "args": {
    "USERNAME": "vscode",
    "BUILDKIT_INLINE_CACHE": "0"
  }
},
...

rogeriocassares avatar Apr 21 '23 19:04 rogeriocassares

I solved it for myself by increasing the size of defaultKeepStorage and the virtual disk limit

anthonyalayo avatar Jul 10 '23 01:07 anthonyalayo

If you are using docker desktop, you just have to restart the docker desktop. Otherwise, restarting your computer will fix the error.

Why did the error occur?

This is because your docker desktop crash and exited. So, you need to restart it.

Fasunle avatar Jul 10 '23 18:07 Fasunle

The original error in this thread looks very similar to https://github.com/docker/build-push-action/issues/761, which was fixed in BuildKit v0.11.2: https://github.com/docker/build-push-action/issues/761#issuecomment-1406261692. This error hopefully shouldn't appear anymore, so I'll close this issue (@gitfxx if it's still occurring, I can re-open).

The issue in https://github.com/docker/buildx/issues/1079#issuecomment-1123719603 is not actually the same at all, this is not an error during pushing, the buildkit server has crashed for some reason. This seems to be the case for other errors in this thread. If you are having this issue, please can you share the BuildKit logs from the container/pod/etc that hosts BuildKit (or the docker daemon logs if not using any special drivers) - without this info, we have no information as to what caused BuildKit to crash.

jedevc avatar Jul 12 '23 14:07 jedevc

I solved it for myself by increasing the size of defaultKeepStorage and the virtual disk limit

Coming back to this, it was only a fluke that changing the keep storage fixed it. I'm now hitting it continuously without fail. I opened a ticket here: https://github.com/docker/for-mac/issues/6968

anthonyalayo avatar Sep 07 '23 23:09 anthonyalayo

I ran into this same error when trying to build a Dockerfile which had a make -j step, which can cause a ton of processes to run in parallel. The docker build process would halt for several minutes, docker ps calls would hang, and then eventually the build process would give this error. I was able to fix it by limiting the number of jobs make would start by changing the command to make -j $(nproc).

Thanks a lot! This method works for me!

AnotherYx avatar Nov 26 '23 02:11 AnotherYx

Same problem here. Is this getting a proper fix at some point? I've been having nothing but headaches when trying to run docker on windows. It's slow, produces errors randomly INSIDE dockers that a linux host doesn't, and it's also slow. Did I mention it's slow? It's slow. And now this. It's an unreliable piece of software, iyam.

But nevermind the rant, I'm sure the authors are working hard on it and all that, but reliability needs priority over features.

I am, however, seeing some promising remarks here.

Can you update buildx and BuildKit and let us known if you still have this issue? Thanks.

I thought if Docker Desktop is up to date, then all its components are, too. From your remarks, I assume that isn't the case. So, how to do that please?

@st-sukanta @g-kartik @yohnster I have found the cause of the problem, which is caused by a sudden outage of the buildkit server.

So who do we poke to make buildx more reliable?

I ran into this same error when trying to build a Dockerfile which had a make -j step, which can cause a ton of processes to run in parallel. The docker build process would halt for several minutes, docker ps calls would hang, and then eventually the build process would give this error. I was able to fix it by limiting the number of jobs make would start by changing the command to make -j $(nproc).

This is very specific to make, which is a piece of software many people probably aren't using, including me. I'm using Turbo, to build with Vite, which uses Rollup under the bonnet. Yes, that's Node.js. It doesn't have a process count limiter, afaik. Good find though, albeit for limited usecases.

If you are using docker desktop, you just have to restart the docker desktop. Otherwise, restarting your computer will fix the error.

"just" huh? As if it's obvious.. But how? I can't restart docker in the middle of a build, now can I? But more to the point, why does restarting docker "fix" the problem? Isn't that the strongest indication that something is really awfully wrong in docker desktop?

The original error in this thread looks very similar to docker/build-push-action#761, which was fixed in BuildKit v0.11.2: docker/build-push-action#761 (comment). This error hopefully shouldn't appear anymore, so I'll close this issue (@gitfxx if it's still occurring, I can re-open).

Please do. And I don't know what version of buildkit I have. I just installed docker desktop, assuming that whatever version it comes with is the correct (and latest stable) one. I didn't even know buildkit is a separate.. thing.

The issue in #1079 (comment) is not actually the same at all, this is not an error during pushing, the buildkit server has crashed for some reason. This seems to be the case for other errors in this thread. If you are having this issue, please can you share the BuildKit logs from the container/pod/etc that hosts BuildKit (or the docker daemon logs if not using any special drivers) - without this info, we have no information as to what caused BuildKit to crash.

I don't know how to provide you that information. Instructions? And also, at what point should those logs be collected: before, during, or after a build that ends in this error?

thany avatar Jan 19 '24 17:01 thany