Skip to content

nixos/kubernetes: Patch kube-proxy for iptables 1.6.2 compatibility#36739

Closed
srhb wants to merge 7 commits intoNixOS:masterfrom
srhb:fix-kubeproxy-iptables
Closed

nixos/kubernetes: Patch kube-proxy for iptables 1.6.2 compatibility#36739
srhb wants to merge 7 commits intoNixOS:masterfrom
srhb:fix-kubeproxy-iptables

Conversation

@srhb
Copy link
Copy Markdown
Contributor

@srhb srhb commented Mar 10, 2018

Motivation for this change

Fixes #35544

Things done

Upstream patch to insert the missing space in the "-w 5" argument to iptables-restore included. This fixes kube-proxy.

This should be backported to 18.03

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 10, 2018
@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Mar 10, 2018

@GrahamcOfBorg build kubernetes

@GrahamcOfBorg
Copy link
Copy Markdown

Failure on x86_64-darwin (full log)

Partial log (click to expand)

building '/nix/store/qgn5d1iazgrarz0zwxkp9i9apkv1l27c-34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch.drv'...
copying path '/nix/store/y9njha162f4gp4vb26ldjb8m5a4ywmap-go-bindata-20151023-a0ff256' from 'https://cache.nixos.org'...

trying https://github.com/kubernetes/kubernetes/commit/34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5232    0  5232    0     0  29897      0 --:--:-- --:--:-- --:--:-- 29897
output path '/nix/store/51ji2x0akig7dc2v6llqmjk36xrfv99m-34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch' has sha256 hash '1sd9qgc28zr6fkk0441f89bw8kq2kadys0qs7bgivy9cmcpw5x5p' when '189jajilys5zd0x4asbp6by8y3jl5hfaifqqjiq1h2bv00v1qdym' was expected
cannot build derivation '/nix/store/hxkagg62rahf6a40grhac6d314k2cjy6-kubernetes-1.9.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/hxkagg62rahf6a40grhac6d314k2cjy6-kubernetes-1.9.1.drv' failed

@GrahamcOfBorg
Copy link
Copy Markdown

Failure on aarch64-linux (full log)

Partial log (click to expand)

copying path '/nix/store/737xw9r4d5g70j06b2ybjcchk6i09n28-subversion-1.9.7' from 'https://cache.nixos.org'...

trying https://github.com/kubernetes/kubernetes/commit/34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5232    0  5232    0     0  45103      0 --:--:-- --:--:-- --:--:-- 45103
fixed-output derivation produced path '/nix/store/wr4s7428ab2ghqknrm738y0d9gmbxvf8-34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch' with sha256 hash '1sd9qgc28zr6fkk0441f89bw8kq2kadys0qs7bgivy9cmcpw5x5p' instead of the expected hash '189jajilys5zd0x4asbp6by8y3jl5hfaifqqjiq1h2bv00v1qdym'
copying path '/nix/store/sja9gpkj05paj4j9gvxzx5vrnghfdaja-go-1.10' from 'https://cache.nixos.org'...
cannot build derivation '/nix/store/6x71xgbq3kwg4z41swx1q80dddfl7f4k-kubernetes-1.9.1.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/6x71xgbq3kwg4z41swx1q80dddfl7f4k-kubernetes-1.9.1.drv' failed

@GrahamcOfBorg
Copy link
Copy Markdown

Failure on x86_64-linux (full log)

Partial log (click to expand)

building '/nix/store/xh140jjkqmh0im93zy3w3l4qdvzzmdlj-34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch.drv'...
copying path '/nix/store/yszkd9kc56q5bxwj8x8cn4brnirbgrj5-go-bindata-20151023-a0ff256' from 'https://cache.nixos.org'...

trying https://github.com/kubernetes/kubernetes/commit/34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5232    0  5232    0     0   9600      0 --:--:-- --:--:-- --:--:--  9582
fixed-output derivation produced path '/nix/store/wr4s7428ab2ghqknrm738y0d9gmbxvf8-34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch' with sha256 hash '1sd9qgc28zr6fkk0441f89bw8kq2kadys0qs7bgivy9cmcpw5x5p' instead of the expected hash '189jajilys5zd0x4asbp6by8y3jl5hfaifqqjiq1h2bv00v1qdym'
cannot build derivation '/nix/store/flpb66cagjcqhxmpg0p6xykc6dh5ljfj-kubernetes-1.9.1.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/flpb66cagjcqhxmpg0p6xykc6dh5ljfj-kubernetes-1.9.1.drv' failed

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 10, 2018

@Mic92 Any idea how to make grahamcofborg run the tests as well? I can't seem to figure out the right command, something appears to be different for the kubernetes test set (and it's not running on Hydra either, as far as I can see.)

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 10, 2018

Hm, I'll look into those failures. Didn't see those locally.

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 10, 2018

Weird.

❯ nix-prefetch-url https://github.com/kubernetes/kubernetes/commit/34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch
path is '/nix/store/51ji2x0akig7dc2v6llqmjk36xrfv99m-34ce573e9992ecdbc06dff1b4e3d0e9baa8353dd.patch'
189jajilys5zd0x4asbp6by8y3jl5hfaifqqjiq1h2bv00v1qdym

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 10, 2018

@GrahamcOfBorg build kubernetes

@GrahamcOfBorg
Copy link
Copy Markdown

Failure on x86_64-darwin (full log)

Partial log (click to expand)

!!! [0310 10:21:42]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [Makefile:92: all] Error 1
make: Leaving directory '/private/tmp/nix-build-kubernetes-1.9.1.drv-0/source'
!!! Error in ./hack/generate-docs.sh:36
  Error in ./hack/generate-docs.sh:36. 'make SHELL=/nix/store/pkjmwq7sqrvjg7cjiph6hq0khsmfl6p8-bash-4.4-p12/bin/bash -C "${KUBE_ROOT}" WHAT="${BINS[*]}"' exited with status 2
Call stack:
  1: ./hack/generate-docs.sh:36 main(...)
Exiting with status 1
builder for '/nix/store/rsklwiv4ghwsdckyma1mj6937c8fa7vw-kubernetes-1.9.1.drv' failed with exit code 1
error: build of '/nix/store/rsklwiv4ghwsdckyma1mj6937c8fa7vw-kubernetes-1.9.1.drv' failed

@GrahamcOfBorg
Copy link
Copy Markdown

Success on aarch64-linux (full log)

Partial log (click to expand)

strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/51dkzn81v1vrq9gskhmnrb492lmyf8ik-kubernetes-1.9.1-man
checking for references to /build in /nix/store/51dkzn81v1vrq9gskhmnrb492lmyf8ik-kubernetes-1.9.1-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/2da4q1rj48fb4mijbz2nhsc1qdzgi4sh-kubernetes-1.9.1-pause
shrinking /nix/store/2da4q1rj48fb4mijbz2nhsc1qdzgi4sh-kubernetes-1.9.1-pause/bin/pause
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/2da4q1rj48fb4mijbz2nhsc1qdzgi4sh-kubernetes-1.9.1-pause/bin
patching script interpreter paths in /nix/store/2da4q1rj48fb4mijbz2nhsc1qdzgi4sh-kubernetes-1.9.1-pause
checking for references to /build in /nix/store/2da4q1rj48fb4mijbz2nhsc1qdzgi4sh-kubernetes-1.9.1-pause...
/nix/store/6brs1vngnmwlf3ybkj48q37r3rmm4npa-kubernetes-1.9.1

@GrahamcOfBorg
Copy link
Copy Markdown

Success on x86_64-linux (full log)

Partial log (click to expand)

strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/i1lrdlbs1rxz0yj17mz89dk9p8g3xs1p-kubernetes-1.9.1-man
checking for references to /tmp/nix-build-kubernetes-1.9.1.drv-0 in /nix/store/i1lrdlbs1rxz0yj17mz89dk9p8g3xs1p-kubernetes-1.9.1-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/15ppabqh38ans9q5m7w98h8ph4i02sjc-kubernetes-1.9.1-pause
shrinking /nix/store/15ppabqh38ans9q5m7w98h8ph4i02sjc-kubernetes-1.9.1-pause/bin/pause
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/15ppabqh38ans9q5m7w98h8ph4i02sjc-kubernetes-1.9.1-pause/bin 
patching script interpreter paths in /nix/store/15ppabqh38ans9q5m7w98h8ph4i02sjc-kubernetes-1.9.1-pause
checking for references to /tmp/nix-build-kubernetes-1.9.1.drv-0 in /nix/store/15ppabqh38ans9q5m7w98h8ph4i02sjc-kubernetes-1.9.1-pause...
/nix/store/sd8p0qzddcj199cb1nvqh6dsx7cjzysb-kubernetes-1.9.1

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Mar 10, 2018

@GrahamcOfBorg test tests.kubernetes.dns.singlenode

@GrahamcOfBorg
Copy link
Copy Markdown

Failure on x86_64-linux (full log)

Partial log (click to expand)

Merge failed

@GrahamcOfBorg
Copy link
Copy Markdown

Failure on aarch64-linux (full log)

Partial log (click to expand)

Merge failed

@GrahamcOfBorg GrahamcOfBorg added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Mar 10, 2018
tests.kubernetes.dns = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/dns.nix {};
## kubernetes.e2e should eventually replace kubernetes.rbac when it works
#tests.kubernetes.e2e = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/e2e.nix {};
tests.kubernetes.rbac = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/rbac.nix {};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove some abstractions for our own sanity.

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Mar 10, 2018

@GrahamcOfBorg eval

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, wrong merge commit.

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 11, 2018

@Mic92 Great, thanks! Good to merge?

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Mar 12, 2018

I only fixed running tests from release.nix. I have not actually run all tests. If it works for you merging should be fine
@GrahamcOfBorg test kubernetes.dns kubernetes.rbac

@GrahamcOfBorg
Copy link
Copy Markdown

Success on aarch64-linux (full log)

Attempted: tests.kubernetes.dns, tests.kubernetes.rbac

No log is available.

@GrahamcOfBorg
Copy link
Copy Markdown

Success on x86_64-linux (full log)

Attempted: tests.kubernetes.dns, tests.kubernetes.rbac

No log is available.

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Mar 12, 2018

Also without tests it should be fine. Please also backport it to 18.03.

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Mar 12, 2018

@grahamc is the log output of tests above legit? Maybe it points to wrong key?

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Mar 15, 2018

This is so weird. Let's try again :o

@GrahamcOfBorg test kubernetes.dns kubernetes.rbac

@GrahamcOfBorg
Copy link
Copy Markdown

Success on aarch64-linux (full log)

Attempted: tests.kubernetes.dns, tests.kubernetes.rbac

No log is available.

@GrahamcOfBorg
Copy link
Copy Markdown

Success on x86_64-linux (full log)

Attempted: tests.kubernetes.dns, tests.kubernetes.rbac

No log is available.

tests.kubernetes.dns = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/dns.nix {};
## kubernetes.e2e should eventually replace kubernetes.rbac when it works
#tests.kubernetes.e2e = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/e2e.nix {};
tests.kubernetes.rbac = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/rbac.nix {};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the problem, callSubTestsOnTheseSystems is expecting an attributeset of tests inside the file, but there is none. Thus this should probably be using callTestOnTheseSystems, but when I made the simple patch:

diff --git a/nixos/release.nix b/nixos/release.nix
index cc4c3e7c705..a26d4cee746 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -296,10 +296,10 @@ in rec {
   tests.kernel-copperhead = callTest tests/kernel-copperhead.nix {};
   tests.kernel-latest = callTest tests/kernel-latest.nix {};
   tests.kernel-lts = callTest tests/kernel-lts.nix {};
-  tests.kubernetes.dns = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/dns.nix {};
+  tests.kubernetes.dns = callTestOnTheseSystems ["x86_64-linux"] tests/kubernetes/dns.nix {};
   ## kubernetes.e2e should eventually replace kubernetes.rbac when it works
   #tests.kubernetes.e2e = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/e2e.nix {};
-  tests.kubernetes.rbac = callSubTestsOnTheseSystems ["x86_64-linux"] tests/kubernetes/rbac.nix {};
+  tests.kubernetes.rbac = callTestOnTheseSystems ["x86_64-linux"] tests/kubernetes/rbac.nix {};
   tests.latestKernel.login = callTest tests/login.nix { latestKernel = true; };
   tests.ldap = callTest tests/ldap.nix {};
   #tests.lightdm = callTest tests/lightdm.nix {};

I got:

grahamc@Morbo> HOME=/homeless-shelter NIX_PATH=nixpkgs=$(pwd) nix-instantiate ./nixos/release.nix -A tests.kubernetes.rbac --option restrict-eval true --option build-timeout 1800 --arg supportedSystems  '["x86_64-linux"]' --show-trace
error: while evaluating anonymous function at /home/grahamc/projects/nixpkgs/nixos/release.nix:23:8, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:282:43:
while evaluating ‘hydraJob’ at /home/grahamc/projects/nixpkgs/lib/customisation.nix:162:14, called from /home/grahamc/projects/nixpkgs/nixos/release.nix:23:16:
while evaluating the attribute ‘system’ at /home/grahamc/projects/nixpkgs/lib/customisation.nix:167:24:
attribute ‘system’ missing, at /home/grahamc/projects/nixpkgs/lib/customisation.nix:167:10

and I don't have the time at this moment to debug it. Maybe you can take a look?

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 15, 2018

@GrahamcOfBorg test kubernetes.dns.singlenode kubernetes.dns.multinode kubernetes.rbac.singlenode kubernetes.rbac.multinode

@GrahamcOfBorg
Copy link
Copy Markdown

No attempt on aarch64-linux

The following builds were skipped because they don't evaluate on aarch64-linux: tests.kubernetes.dns.singlenode, tests.kubernetes.dns.multinode, tests.kubernetes.rbac.singlenode, tests.kubernetes.rbac.multinode

No log is available.

@GrahamcOfBorg
Copy link
Copy Markdown

No attempt on x86_64-linux

The following builds were skipped because they don't evaluate on x86_64-linux: tests.kubernetes.dns.singlenode, tests.kubernetes.dns.multinode, tests.kubernetes.rbac.singlenode, tests.kubernetes.rbac.multinode

No log is available.

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 15, 2018

❯ nix-build nixos/release.nix -A tests.kubernetes.dns.singlenode -A tests.kubernetes.dns.multinode -A tests.kubernetes.rbac.singlenode -A tests.kubernetes.rbac.multinode
/nix/store/jnc32k3xixs12bchmpdwahcsn9hvb4k3-vm-test-run-kubernetes-dns-singlenode
/nix/store/rf5sw70z1g2hxq3zxh5k6jh4z7kagahd-vm-test-run-kubernetes-dns-multinode
/nix/store/yak4mp3j61mn74g89bj9blwkl8pcp2xb-vm-test-run-kubernetes-rbac-singlenode
/nix/store/jypgf9zbwhiwcpcqwlxlcpgd42c7dw35-vm-test-run-kubernetes-rbac-multinode

Looks good to me. @Mic92 Should I keep in the changes you made to release.nix or not? It seems they do nothing for ofborg, not sure about Hydra.

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Mar 15, 2018

These tests won't run on Hydra, just like they don't run on OfBorg.

I need to publish logs as to why they don't evaluate obviously, but if you try them like I showed you'll see why:

[nix-shell:~/projects/nixpkgs]$ HOME=/homeless-shelter NIX_PATH=nixpkgs=$(pwd) nix-instantiate ./nixos/release.nix -A tests.kubernetes.dns.singlenode --option restrict-eval true --option build-timeout 1800 --arg supportedSystems  '["x86_64-linux"]' --show-trace
error: while evaluating the attribute 'singlenode' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/nixos/release.nix:30:25, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:52:
while evaluating 'hydraJob' at /home/grahamc/projects/nixpkgs/lib/customisation.nix:162:14, called from /home/grahamc/projects/nixpkgs/nixos/release.nix:30:28:
while evaluating the attribute 'outPath' at /home/grahamc/projects/nixpkgs/lib/customisation.nix:178:13:
while evaluating the attribute 'outPath' at /home/grahamc/projects/nixpkgs/lib/customisation.nix:147:13:
while evaluating the attribute 'buildCommand' of the derivation 'vm-test-run-kubernetes-dns-singlenode' at /home/grahamc/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'buildCommand' of the derivation 'nixos-test-driver-kubernetes-dns-singlenode' at /home/grahamc/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'buildCommand' of the derivation 'nixos-vm' at /home/grahamc/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'system.build.toplevel' at /home/grahamc/projects/nixpkgs/nixos/modules/system/activation/top-level.nix:263:5:
while evaluating 'foldr' at /home/grahamc/projects/nixpkgs/lib/lists.nix:34:20, called from /home/grahamc/projects/nixpkgs/nixos/modules/system/activation/top-level.nix:134:12:
while evaluating 'fold'' at /home/grahamc/projects/nixpkgs/lib/lists.nix:37:15, called from /home/grahamc/projects/nixpkgs/lib/lists.nix:41:8:
while evaluating 'showWarnings' at /home/grahamc/projects/nixpkgs/nixos/modules/system/activation/top-level.nix:100:18, called from /home/grahamc/projects/nixpkgs/nixos/modules/system/activation/top-level.nix:107:16:
while evaluating 'foldr' at /home/grahamc/projects/nixpkgs/lib/lists.nix:34:20, called from /home/grahamc/projects/nixpkgs/nixos/modules/system/activation/top-level.nix:100:23:
while evaluating 'fold'' at /home/grahamc/projects/nixpkgs/lib/lists.nix:37:15, called from /home/grahamc/projects/nixpkgs/lib/lists.nix:41:8:
while evaluating the attribute 'warnings' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:75:45, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute 'value' at /home/grahamc/projects/nixpkgs/lib/modules.nix:312:9:
while evaluating the option `warnings':
while evaluating the attribute 'isDefined' at /home/grahamc/projects/nixpkgs/lib/modules.nix:344:5:
while evaluating 'filterOverrides' at /home/grahamc/projects/nixpkgs/lib/modules.nix:419:21, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:328:18:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:425:8:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:323:17:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:323:28, called from undefined position:
while evaluating 'dischargeProperties' at /home/grahamc/projects/nixpkgs/lib/modules.nix:386:25, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:324:62:
while evaluating the attribute 'value' at /home/grahamc/projects/nixpkgs/lib/modules.nix:216:48:
while evaluating the attribute 'config.warnings' at /home/grahamc/projects/nixpkgs/nixos/modules/system/boot/systemd.nix:702:5:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:224:10, called from undefined position:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/nixos/modules/system/boot/systemd.nix:702:51, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:224:16:
while evaluating 'optional' at /home/grahamc/projects/nixpkgs/lib/lists.nix:198:20, called from /home/grahamc/projects/nixpkgs/nixos/modules/system/boot/systemd.nix:703:7:
while evaluating the attribute 'serviceConfig.Type' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:75:45, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute 'value' at /home/grahamc/projects/nixpkgs/lib/modules.nix:312:9:
while evaluating the option `systemd.services.kube-apiserver.serviceConfig':
while evaluating the attribute 'mergedValue' at /home/grahamc/projects/nixpkgs/lib/modules.nix:339:5:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:339:32, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:339:19:
while evaluating 'merge' at /home/grahamc/projects/nixpkgs/lib/types.nix:267:20, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:342:8:
while evaluating 'mapAttrs' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:198:17, called from /home/grahamc/projects/nixpkgs/lib/types.nix:268:9:
while evaluating 'filterAttrs' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:115:23, called from /home/grahamc/projects/nixpkgs/lib/types.nix:268:35:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:116:18:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:116:29, called from undefined position:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/types.nix:268:51, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:116:62:
while evaluating the attribute 'ExecStart' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:334:7:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/types.nix:268:86, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:334:15:
while evaluating the attribute 'optionalValue' at /home/grahamc/projects/nixpkgs/lib/modules.nix:346:5:
while evaluating 'filterOverrides' at /home/grahamc/projects/nixpkgs/lib/modules.nix:419:21, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:328:18:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:425:8:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:323:17:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:323:28, called from undefined position:
while evaluating 'dischargeProperties' at /home/grahamc/projects/nixpkgs/lib/modules.nix:386:25, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:324:62:
while evaluating the attribute 'value' at /home/grahamc/projects/nixpkgs/lib/types.nix:273:55:
while evaluating the attribute 'ExecStart' at /home/grahamc/projects/nixpkgs/nixos/modules/services/cluster/kubernetes/default.nix:861:11:
while evaluating 'optionalString' at /home/grahamc/projects/nixpkgs/lib/strings.nix:138:26, called from /home/grahamc/projects/nixpkgs/nixos/modules/services/cluster/kubernetes/default.nix:863:15:
while evaluating the attribute 'etcd.caFile' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:75:45, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute 'value' at /home/grahamc/projects/nixpkgs/lib/modules.nix:312:9:
while evaluating the option `services.kubernetes.etcd.caFile':
while evaluating the attribute 'isDefined' at /home/grahamc/projects/nixpkgs/lib/modules.nix:344:5:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:333:19, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:333:14:
while evaluating the attribute 'value._type' at /home/grahamc/projects/nixpkgs/lib/modules.nix:424:73:
while evaluating the attribute 'value.content' at /home/grahamc/projects/nixpkgs/lib/modules.nix:482:14:
while evaluating the attribute 'default' at /home/grahamc/projects/nixpkgs/nixos/modules/services/cluster/kubernetes/default.nix:178:9:
while evaluating the attribute 'caFile' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:75:45, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute 'value' at /home/grahamc/projects/nixpkgs/lib/modules.nix:312:9:
while evaluating the option `services.kubernetes.caFile':
while evaluating the attribute 'isDefined' at /home/grahamc/projects/nixpkgs/lib/modules.nix:344:5:
while evaluating 'filterOverrides' at /home/grahamc/projects/nixpkgs/lib/modules.nix:419:21, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:328:18:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:425:8:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:323:17:
while evaluating anonymous function at /home/grahamc/projects/nixpkgs/lib/modules.nix:323:28, called from undefined position:
while evaluating 'dischargeProperties' at /home/grahamc/projects/nixpkgs/lib/modules.nix:386:25, called from /home/grahamc/projects/nixpkgs/lib/modules.nix:324:62:
while evaluating the attribute 'value' at /home/grahamc/projects/nixpkgs/lib/modules.nix:216:48:
while evaluating the attribute 'config.caFile' at /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/kubernetes-common.nix:11:5:
while evaluating the attribute 'passAsFile' of the derivation 'master-keys' at /home/grahamc/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the derivation attribute 'name' at /home/grahamc/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating 'noKey' at /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:26:11, called from /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:165:20:
while evaluating 'filterAttrs' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:115:23, called from /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:26:20:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:116:18:
while evaluating 'createSigningCertKey' at /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:52:26, called from /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:90:8:
while evaluating 'noCSR' at /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:25:11, called from /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:53:6:
while evaluating 'filterAttrs' at /home/grahamc/projects/nixpkgs/lib/attrsets.nix:115:23, called from /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:25:20:
while evaluating 'concatMap' at /home/grahamc/projects/nixpkgs/lib/lists.nix:102:18, called from /home/grahamc/projects/nixpkgs/lib/attrsets.nix:116:18:
while evaluating 'runWithCFSSL' at /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:9:24, called from /home/grahamc/projects/nixpkgs/nixos/tests/kubernetes/certs.nix:53:13:
access to path '/nix/store/xyi4nppbpshcfrgx4vlc827l3bz5qgfk-ca-cfss.json' is forbidden in restricted mode

In other words, the test seems to be using IFD which is not permitted.

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Mar 15, 2018

Specifically this is the problem, in certs.nix:

  runWithCFSSL = name: cmd:
    builtins.fromJSON (builtins.readFile (
      pkgs.runCommand "${name}-cfss.json" {
        buildInputs = [ pkgs.cfssl ];
      } "cfssl ${cmd} > $out"
    ));

the readFile is not permitted.

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Mar 15, 2018

I'm almost done fixing the test to be able to run on Hydra and OfBorg.

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Mar 16, 2018

The following patch seems to cause the tests to break, but is the right way to go to have this no longer violate IFD issues:

diff --git a/nixos/tests/kubernetes/certs.nix b/nixos/tests/kubernetes/certs.nix
index d3eff910c46..097488c46e0 100644
--- a/nixos/tests/kubernetes/certs.nix
+++ b/nixos/tests/kubernetes/certs.nix
@@ -7,11 +7,26 @@
 }:
 let
   runWithCFSSL = name: cmd:
-    builtins.fromJSON (builtins.readFile (
-      pkgs.runCommand "${name}-cfss.json" {
-        buildInputs = [ pkgs.cfssl ];
-      } "cfssl ${cmd} > $out"
-    ));
+    let secrets = pkgs.runCommand "${name}-cfss.json" {
+        buildInputs = [ pkgs.cfssl pkgs.jq ];
+        outputs = [ "out" "cert" "key" "csr" ];
+      }
+      ''
+        (
+          echo "${cmd}"
+          cfssl ${cmd} > tmp
+          cat tmp | jq -r .key > $key
+          cat tmp | jq -r .cert > $cert
+          cat tmp | jq -r .csr > $csr
+
+          touch $out
+        ) 2>&1 | fold -w 80 -s
+      '';
+    in {
+      key = secrets.key;
+      cert = secrets.cert;
+      csr = secrets.csr;
+    };
 
   writeCFSSL = content:
     pkgs.runCommand content.name {
@@ -25,10 +40,10 @@ let
   noCSR = content: pkgs.lib.filterAttrs (n: v: n != "csr") content;
   noKey = content: pkgs.lib.filterAttrs (n: v: n != "key") content;
 
-  writeFile = content: pkgs.writeText "content" (
-    if pkgs.lib.isAttrs content then builtins.toJSON content
-    else toString content
-  );
+  writeFile = content:
+    if pkgs.lib.isDerivation content
+    then content
+    else pkgs.writeText "content" (builtins.toJSON content);
 
   createServingCertKey = { ca, cn, hosts? [], size ? 2048, name ? cn }:
     noCSR (

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Mar 16, 2018

@srhb can you add this?

@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 16, 2018

Honestly, this PR is a complete mess now. I'd much rather focus on getting the patch that unbreaks kube-proxy merged and have a separate PR or issue regarding tests being broken on Hydra and ofborg. Thanks for all your input.

srhb added a commit to srhb/nixpkgs that referenced this pull request Mar 17, 2018
@srhb
Copy link
Copy Markdown
Contributor Author

srhb commented Mar 17, 2018

OK, all the test changes are now in #37199 and removed from this PR.

This PR should be good to merge in order to fix kubernetes networking.

I doubt I'll be able to finish making the test non-IFD-compatible. I've spent a few hours trying to track down the (last?) stray issue(s) without luck.

@cstrahan
Copy link
Copy Markdown
Contributor

Applied in e8cbd44 -- thanks!

@itorres
Copy link
Copy Markdown
Contributor

itorres commented Apr 18, 2018

Thanks a lot for the patch.

Is there an ETA for this patch to get backported to 18.03? I am hitting this issue in a new install.

@azazel75
Copy link
Copy Markdown
Contributor

Hey @itorres,
I had the same problem and I resolved using this trick from the wiki https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
just yesterday
I hope it helps

globin pushed a commit to mayflower/nixpkgs that referenced this pull request May 24, 2018
globin pushed a commit to mayflower/nixpkgs that referenced this pull request May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kube-proxy is broken by iptables 1.6.1 -> 1.6.2

7 participants