-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Docker fails to run containers #244159
Comments
I find it very strange that I'm the first one reporting this issue, as #242949 has been merged on the 12th. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-downgrade-go-version-used-to-compile-docker-tools/30634/1 |
Same issue here, all my containers died on last auto upgrade. |
You can also pin nixpkgs to a working commit.
That is tracking the master -> nixos-unstable path. The commit was backported to 23.05. It went through the staging branches first, that's why it took some time to show up in the stable branches. That's why it took so long to show up in production after the initial commit. |
Quickfix
nix.nixPath = [
"nixpkgs=https://github.com/NixOS/nixpkgs/archive/b6bbc53029a31f788ffed9ea2d459f0bb0f0fbfc.tar.gz"
"nixos-config=/etc/nixos/configuration.nix"
"/nix/var/nix/profiles/per-user/root/channels"
];
Just hope that downgrading all the other software updated since then won't break anything else 🤞 (It didn't on my server) |
+1 here. Thanks for the workaround! |
Fixes NixOS#244159 Issue is caused by a fix in Go 1.20.6, see upstream issue moby/moby#45935
Fixes #244159 Issue is caused by a fix in Go 1.20.6, see upstream issue moby/moby#45935 (cherry picked from commit 4a526a9)
NixOS/nixpkgs#244159 This suggests a fix has been backported to 23.05, but since this morning's auto-update, and with an up-to-date system I'm unable to start docker containers.
Hello, I also have this problem. On one machine, I did a rollback as suggested by the author of the topic - everything works as it should. On another system, I upgraded to the latest version, but unfortunately nothing has changed:
It is worth noting that all my docker-based services work fine on this machine, although I do not run them directly, but through Does anyone reproduce this bug after the "fix" merge, or is it just me who is so "lucky"? To be honest, the breakdown of such an important basic component as docker surprised me very unpleasantly. I would like more stability and predictability of the software on the servers, but I don't really want to go back to debian :( |
Same for me, not working with 23.05.2143.fa793b06f56 (docker 20.10.25) |
I have updated my nixos-23.05 channel that is supposed to have received backported fix by now: https://nixpk.gs/pr-tracker.html?pr=244310 However, I still get the same error. I may be missing something, though. Currently, I am using the (not) so yummy hack to soothe the pain: docker context create localhost --docker "host=ssh://localhost" .., and then: docker --context localhost run -it hello-world |
I prefer replacing just docker client with working value like this: environment.systemPackages =
let
pinnedPkgs = import(pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "b6bbc53029a31f788ffed9ea2d459f0bb0f0fbfc";
sha256 = "sha256-JVFoTY3rs1uDHbh0llRb1BcTNx26fGSLSiPmjojT+KY=";
}) { config = config.nixpkgs.config; };
pinnedDocker = pkgs.runCommand "pinned-docker" {} ''
mkdir -p $out/bin
ln -s ${lib.getBin pinnedPkgs.docker}/bin/docker $out/bin/docker
'';
in
[
(pkgs.hiPrio pinnedDocker)
]; |
You can also use an overlay in your Nix configuration (
|
+1. Still broken for me without the workaround of pinning to an older version. |
The linked PR is not in some channel yet, so the status of this hasn't changed and it doesn't help anyone if more people comment that they still have the problem. Please refrain from commenting that. If the PR has landed and the problem isn't fixed yet, please make you heard. |
You rather want to use the option |
yes, it has landed, and the problem still isn't fixed. that's why people are commenting. #244310 backported the change to 23.05. that change has made it to the release channel. looking at the on a test box running 23.05, which I just upgraded to make sure I've got the latest from the release channel:
|
With my solution, only docker client is replaced, not docker daemon. |
This is still an issue on 23.05 |
It's still broken for me on default channel kido@vivec ~> sudo nix-channel --list
nixos https://nixos.org/channels/nixos-23.05 kido@vivec ~> sudo nixos-rebuild switch --upgrade
unpacking channels...
building Nix...
building the system configuration...
activating the configuration...
setting up /etc...
reloading user units for kido...
setting up tmpfiles kido@vivec ~> sudo docker run hello-world
http: invalid Host header Should I wait some more? |
You can track the fix in https://nixpk.gs/pr-tracker.html?pr=245179 As you can see it has not yet reached the 23.05 channel |
Why are we downgrading go when this issue was already fixed in docker 24.0.5? |
We are not downgrading go, we're just patching docker to work with the newer go. These patches will disappear when the docker package is upgraded later |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/docker-run-and-docker-exec-error/30848/6 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/docker-run-and-docker-exec-error/30848/7 |
Still broken for me on release-23.05, after a
EDIT: Looks like it might be a docker vs docker compose issue, |
That is working for me (not using flake) |
I observed the same. Docker compose exhibits the issue and Docker doesn’t… |
…a local socket See NixOS#244159. Cherry-picked the two patches needed to make it compile and work as expected.
For compose please see and test #245782. Note the issue also likely exist for buildx, the corresponding upstream PR is docker/buildx#1953 |
#245782 works great, thank you! |
Bumped into this issue today and my workaround was to build Docker with Go v.1.18 for reasons outlined in #245365 (comment) and specifying docker.override {
buildGoPackage = pkgs.buildGo118Package;
} |
This was caused by NixOS/nixpkgs#244159 and is fixed in latest nixos-unstable.
My version is still 23.05.2162.6da4bc6cb07 - how can I upgrade? (I'm newbie on NixOS) |
Now that this has been merged into 23.05, I did a rebuild and this fixed my devcontainers, thank you for the patch.
It depends on how you've set up your system, but I'm assuming you're not using flakes. sudo nixos-rebuild switch --upgrade You can also check how to update & manage channels in the NixOS Manual (for the inevitable 23.11 release) |
It appears
|
It worked for me:
|
Confirmed that this is now resolved for me on |
Same here using https://releases.nixos.org/nixos/23.05-small/nixos-23.05.2799.771b86d407c5, released on 2023-08-14 06:44:13 It is not clear to me if the fix should come from docker/buildx ?
|
Describe the bug
docker fails to run containers since go has been updated to go1.20.6.
Issue is known upstream: moby/moby#45935 (concise explanation in docker/cli#4437 (comment))
Steps To Reproduce
Steps to reproduce the behavior:
docker run alpine sh
. Fails withhttp: invalid Host header
Expected behavior
I can run containers on my server 😭
Quickfix
While I'm waiting for a released fix on nixpkgs, how can I circumvent this? Easiest way seems to downgrade go version used to compile various docker binaries, but docker's https://github.com/nixOS/nixpkgs/blob/master/pkgs/applications/virtualization/docker/default.nix can't accept overrides as various packages are built in a
let...in
.Is there an easy way to revert commit e5a213c in nixpkgs?
Or is there any easy way to fix this?
Thanks y'all!
Notify maintainers
docker: @offlinehacker @tailhook @vdemeester @periklis @mikroskeem @maxeaubrey
go: @kalbasit @Mic92 @zowoq @qbit
Metadata
The text was updated successfully, but these errors were encountered: