nix icon indicating copy to clipboard operation
nix copied to clipboard

`nix store ping --store /blah` unexpectedly attempts to create /blah directory

Open kjeremy opened this issue 1 year ago • 2 comments

Describe the bug

I am trying to verify that I can reach a bind mounted store (ie that things are set up correctly) and noticed that nix store ping tries to create a store if one doesn't exist. This is counterintuitive to what I would expect.

If you have a problem with a specific package or NixOS, you probably want to file an issue at https://github.com/NixOS/nixpkgs/issues.

Steps To Reproduce

  1. Run `nix store verify --store=some_path

Expected behavior

It should report that it can ping the path or not. If it can't then it should say so.

A clear and concise description of what you expected to happen.

nix-env (Nix) 2.9.1

Additional context

kjeremy avatar Aug 09 '22 21:08 kjeremy

I've also run into this. Here's a more specific command and output:

nix store verify --store ssh-ng://linux-builder
Big but complete output
warning: Git tree '/Users/logan/dev/proton-nix' is dirty
these 23 derivations will be built:
  /nix/store/kq5dazyr460zd1igadcm0b54yv2b4dbm-nixos-help.drv
  /nix/store/5k2ffzi5b2fcjnjwj33v8s7a9vmkf09z-nixos-help.drv
  /nix/store/9w9hfcfdp2p2kdm3406x6hvcd60m9swi-nixos-generate-config.drv
  /nix/store/p9ki0rgxcll0q17wmcpj0lspr653ddg8-nixos-version.drv
  /nix/store/71f51ymskam8483cc2d99kwq7wwxz2bj-system-path.drv
  /nix/store/3zvplq8gmc3zqr63yg1lvndq68qry8d0-dbus-1.drv
  /nix/store/smv2nc3947zmil90gqlykzgqdndl5a1k-etc-os-release.drv
  /nix/store/491fnn7jgyhk59hh04vldacgffjkm529-shutdown-ramfs-contents.drv
  /nix/store/4wdnczyjc9n9xknibmzgk5xhh60jkd7f-X-Restart-Triggers-dbus.drv
  /nix/store/51iw03an8k9pwmm7kl4vdszs82yk6asc-unit-dbus.service.drv
  /nix/store/6cfbzqyr77kvkfx4dn0il785qiwp59j9-users-groups.json.drv
  /nix/store/8mwmc8kzb0g5rb43wwcjb89j5xjw94bj-unit-dbus.service.drv
  /nix/store/6sdyrlrznd83hn1j4mbnvwjcrx8glm5w-user-units.drv
  /nix/store/w8vqqda7vqlx06az0hn5knmaggwpig2c-unit-generate-shutdown-ramfs.service.drv
  /nix/store/n0v2rama0ll6dp9fc75bh52g6i3ii5sa-system-units.drv
  /nix/store/rsyd21400i6l65335rd1m6f70vqalskb-issue.drv
  /nix/store/chpxpfvmk03g8f556418rdmn40lqqimc-etc.drv
  /nix/store/sqj6gahmzr8688sllyz991alm12f6bqr-initrd-linux-6.1.78.drv
  /nix/store/jj385lsvpm74g126s6z2hm0m40v70wsm-boot.json.drv
  /nix/store/jljbwgnd1b65ydl154rw9slc6vwzqmgj-nixos-system-nixos-24.05.20240218.b98a4e1.drv
  /nix/store/cgbfqbmqjvkf4wi3w9v5vg6v4akzbr9x-closure-info.drv
  /nix/store/gbh670ycnhmmr13liccri0977989pv1j-run-nixos-vm.drv
  /nix/store/alxg2rlza31bcbd2rgysz5xxlmjgbrw7-nixos-vm.drv
these 158 paths will be fetched (198.33 MiB download, 1393.90 MiB unpacked):
  /nix/store/rw256br310liym6pwaa2698v7k1hpfdx-adv_cmds-119-locale
  /nix/store/ns3i9j479s5fngbfakl546bb2bykwdza-apple-framework-CoreFoundation-11.0.0
  /nix/store/0j90xxj4in0yk2dp7mpvsm8jqd9mrbs3-bash-5.2p26
  /nix/store/2h0xjb6lsscfd375cjpflzqj1a4dz0jx-bash-5.2p26
  /nix/store/8ib8cc987lb33js4271aiikbl80fph6r-bind-9.18.24-man
  /nix/store/pljdd5amldxii4zs1k7wwbbc71hdgnfg-binutils-2.40
  /nix/store/4hsrq12vij01agj5iqhfgslhcgkw54d2-binutils-2.40-lib
  /nix/store/mzpgfymb0b4flxmgaaslml5fy4j0c1d1-brotli-1.1.0-lib
  /nix/store/q2nb4wsvbhh3w80yrm868qdfs8sxbcvd-bzip2-1.0.8
  /nix/store/ya1yz6k0nlw7c1mbxl6xczpgzzhqk7y3-bzip2-1.0.8
  /nix/store/d6ki959pnsa3w8iydkfjcjrggyplk66i-bzip2-1.0.8-bin
  /nix/store/5kay9h4lqsq2b2gwk8xfzydsg0rmbygl-cairo-1.18.0
  /nix/store/zg0icbwnf1h8sqn56n2wcp9znkw35yxm-capstone-4.0.2
  /nix/store/79fqcmdsj5prcn7xcmfaj6i0qcrz9s13-cctools-binutils-darwin-16.0.6-973.0.1
  /nix/store/cwkgbzhwdkjp4sff8m3hbqisd7z333cn-cctools-binutils-darwin-wrapper-16.0.6-973.0.1
  /nix/store/vd2z321ppvjphylsf11aib9wsad5vzwc-cctools-llvm-16.0.6-973.0.1
  /nix/store/nmqirfz6x3xkdb5s2m0g5jmrxd9l936i-cctools-port-973.0.1
  /nix/store/3ijvz3w7ka2wfl3yk77r9c79c0fzb9j9-clang-16.0.6
  /nix/store/panp8x4v0cn4zs406jfqcgv1g5sjga1r-clang-16.0.6-lib
  /nix/store/k687y4hiraslz65qz8pli1wb5wmcabvn-clang-wrapper-16.0.6
  /nix/store/gj34q9f5lmpwb5f97x43qgbn3h96m1xm-compiler-rt-libc-16.0.6
  /nix/store/jp3f1d5scfknawlp5d7f6wy92mhq0p49-compiler-rt-libc-16.0.6-dev
  /nix/store/qpd69yfix5psmsbv251ky18mc1lxnx70-coreutils-9.4
  /nix/store/6lrp8y5zd8d7jfdd45zsr4cmzdb69m6l-curl-8.6.0
  /nix/store/kgc6sw2hgx1v9v9m74va6a4jqg1xmx0m-cyrus-sasl-2.1.28
  /nix/store/1xgaf3244vhy0cimn3l4cw116g51dnk2-db-5.3.28
  /nix/store/m5wa645y16rikvk4iszh2nx2wrr10w43-dejavu-fonts-minimal-2.37
  /nix/store/ri18k5b34qlapg1908afz4z51z1b3fbl-diffutils-3.10
  /nix/store/gnb0fsxbaa729izznna0s8dgy56m8n6g-dns-root-data-2023-11-27
  /nix/store/4c4m8qw7j1cz7mwzyml2q9shkhbpkiwm-dtc-1.7.0
  /nix/store/j4dmkgw6xybzv08zx70yhn0pw8ck1b9y-e2fsprogs-1.47.0
  /nix/store/5yn27id4zjqa52p3y9rs3rg912vynydq-e2fsprogs-1.47.0-bin
  /nix/store/yb9nhslcgxmvaip6gvfg5hpr9pyplhln-ed-1.20
  /nix/store/iiavd4k2brxbscwjrl3ywrvc20s8c2n4-expand-response-params
  /nix/store/5qjpv58a4i1rbkaxjgl3pab1asbmlm61-expat-2.5.0
  /nix/store/nm5ps8rhjgrz800jad4s8p3sh205g60a-expat-2.5.0
  /nix/store/lb9k8p8c8bf8b5v4gayzyx656a8n9cbp-findutils-4.9.0
  /nix/store/wybmqsgd6by3jdlzmk2jvwxxr32sjpb9-fontconfig-2.15.0
  /nix/store/08vc3l41i0gs5klaphnxvh8yrqrv381l-fontconfig-2.15.0-lib
  /nix/store/afpg8pjl18hgg76p8lpvzadcn9fhwga7-freetype-2.13.2
  /nix/store/73a5wz9ncic02mc9bp3gdxxl1yb13lcf-fribidi-1.0.13
  /nix/store/spskfl77py9hyvh3f9sjsqcrbsaiprh0-gawk-5.2.2
  /nix/store/4cr8wq9dn6mrzkqbfwdg92c3knkp2dw1-gdbm-1.23
  /nix/store/5li6h00ggm45a58sbqhc4p5h0m8h5rf7-gettext-0.21.1
  /nix/store/xd22d3mi2f2382ixx71lh9hijh6y5i9x-glib-2.78.4
  /nix/store/5lij8hj3wxkfvs7z3sshmfhf2xfw7nbc-gmp-with-cxx-6.3.0
  /nix/store/m18qr049pa6z12m01kj7a6j0gk3kikw1-gnu-config-2023-09-19
  /nix/store/av92p4b35n68p837dqq6jq6gjdk6s19q-gnugrep-3.11
  /nix/store/mfygsgqn2jnm14918y96rb7c9avvnpk0-gnumake-4.4.1
  /nix/store/g44k88l2xg41bgsdhsw609smypmiz6j7-gnused-4.9
  /nix/store/ivklia9w69144iys517bvbc0d8paj2ai-gnutar-1.35
  /nix/store/k0hlys2c3v7al9n3cazhf8rimyd1br7n-gnutls-3.8.3
  /nix/store/8d5dkzkgf0dz5f5gxybwgcq70wm44svj-graphene-1.10.8
  /nix/store/qmq92nhvjniw8551mv3k1w60nv01y6x0-graphite2-1.3.14
  /nix/store/si1fbw54kw5s1aygxydhj0nlxzsa8rff-gst-plugins-base-1.22.8
  /nix/store/lb91cmyx2rp3kqwd3d9zr5ylzrnqapg6-gstreamer-1.22.8
  /nix/store/m7bk558n8sli5z52splzgvrih5gasbvc-gzip-1.13
  /nix/store/g90yka8rw7lc4dvssl4bfsdp4vl51wn1-harfbuzz-7.3.0
  /nix/store/m2jczd0swzzphsd8b7lsrnm7z6l3j5qz-iso-codes-4.16.0
  /nix/store/va3b5pn939snp7swypnrmff0ha09q64i-jq-1.7.1
  /nix/store/k2rjgwfkp5hjbbvxdgsnbgpxf7jv6sgi-jq-1.7.1-bin
  /nix/store/h5jkagp2zfimj0sl7j7jv5pm162xzhnn-jq-1.7.1-dev
  /nix/store/k0fgrqr69bwwas3lbf07y4v7sc6v52m1-jq-1.7.1-doc
  /nix/store/mhgjf5bnx4pyrmmzbzbi08g6x437n04l-jq-1.7.1-lib
  /nix/store/vh34qnavrwl6sg0wjmsl2ik82gksr9sn-jq-1.7.1-man
  /nix/store/jy1rsx8kz6wd11kcj5pc8wvh344x1qfr-libSystem-11.0.0
  /nix/store/d945d936sg54h1bzb9srs9c1mg3nc2dr-libX11-1.8.7
  /nix/store/m90y40rg7ypgrpkhpz6kfvs9w6idnbix-libXau-1.0.11
  /nix/store/0wqg2dwykzw1g9830f0aikihs2105wn4-libXdmcp-1.1.4
  /nix/store/d6dv0ksaric66kbcf419h6shfnfclz70-libXext-1.3.5
  /nix/store/3y2kn6r9bisvfp1c5vkj4s39bagkf6sz-libXrender-0.9.11
  /nix/store/m7dzyw0yg1ysrv04l8vs17cd0d63jibl-libcacard-2.8.1
  /nix/store/hi4fialjfb9wd2f5al4vpzlyh8dz38fz-libcxx-16.0.6
  /nix/store/ydfb1m5h1lcghpvs2hmv9686z008paij-libcxx-16.0.6-dev
  /nix/store/y95amj87xavs2a7x24ir390hxk3ii922-libcxxabi-16.0.6
  /nix/store/3g6shmh8g2chzywmyx6ls9i1rhz415ki-libcxxabi-16.0.6-dev
  /nix/store/yyi2v9x61ca5cwnvn1m6nz14lr87rsv1-libdatrie-2019-12-20-lib
  /nix/store/cxnr40v7fva1m6zydvnz0b7zdsmdfv4s-libevent-2.1.12
  /nix/store/m0xglhw9hx07ismjsk9r34ffbdf3m1wr-libffi-3.4.4
  /nix/store/yzsvhffh3f9fj9bbi4chs75wiyd03kpf-libffi-3.4.4
  /nix/store/hx90cddimxf9j93mynvkynjzxdiwqs5z-libiconv-50
  /nix/store/a9zbl27k89nxz1q59qd0qglw5wiszmri-libidn2-2.3.7
  /nix/store/98k5cqdsjmx0rdm7paxgn6b0nw3yhl4j-libiscsi-1.19.0
  /nix/store/jplv6h5glfsnr98xmv6l471krs2bd1qp-libjpeg-turbo-3.0.2
  /nix/store/2jrfdv9xlx73c7bgxv7ikgw2dg9yvy9x-libkrb5-1.21.2
  /nix/store/jf5v1nx9hyv0m8fy67iid5afbazlbl2f-libkrb5-1.21.2
  /nix/store/aacafvhpd3zpr38fnijl652q1qyhgi3p-libobjc-11.0.0
  /nix/store/4a3n70pvv0kdmr4kk7lqa1vald9lr0ww-libogg-1.3.5
  /nix/store/sdgfnb1j8dz3p9235g4r63ih6cyrv4dl-libopus-1.4
  /nix/store/qdvsl54x2lmjz96g70ililvl3mq08q8w-libpcap-1.10.4
  /nix/store/3k7ykzjd7slaisszkb0b0wd46g83xq25-libpng-apng-1.6.40
  /nix/store/gp5wbg0lv8gz758mnlw6s8rc0gr55gqh-libpsl-0.21.5
  /nix/store/491nn0zvw1ql80wiv4lb4nwdibpv3x27-libslirp-4.7.0
  /nix/store/5advv1v46b8s8y6vdjasj5k9j4xapil8-libssh2-1.11.0
  /nix/store/c8aavvw1q070zsdf4xqv8rpzvjcj4hwb-libtapi-1100.0.11
  /nix/store/rkv5qf2ywjszzr083xdxc6pl0yfg406a-libtasn1-4.19.0
  /nix/store/crap5z31fn9242c6rg9w9gplsn16nfnf-libthai-0.1.29
  /nix/store/fsq2jlgpb28plgwh8wpw53rz6zgwrvgb-libtheora-1.1.1
  /nix/store/hqsqvzsjkjbgkldiznbb19rb6219c6b2-libunistring-1.1
  /nix/store/wq0s7c13a0q4qzjfxkjdf3ph0ql3wdbg-libusb-1.0.27
  /nix/store/hbzlaqq4846cgwfyh985x4g0bzvf5kc2-libvorbis-1.3.7
  /nix/store/wkw8fj82yl6w81nnz8b7ppn5561935fn-libxcb-1.16
  /nix/store/rcwyw1nyxqm0246a7grh40w66rc26gi6-libxcrypt-4.4.36
  /nix/store/l42hlw1k4szqrj3r9dyfwqc6mszb2is8-libxml2-2.12.4
  /nix/store/mswnrk10ka44sl4p8dwrzf2cxrk5vrxg-libyaml-0.2.5
  /nix/store/kpss2kr8m0mc8n5vg0784jdjh8bj8dry-linux-6.1.78-modules-shrunk
  /nix/store/527sx1v52cp3284ii838rfd1d3x727r6-lld-16.0.6
  /nix/store/3457s6rr2hj0b3ji3s8c0yfbbanc6l6y-llvm-16.0.6
  /nix/store/jppg1x9c9qzjf3in8gmqb6wv33jlkr5n-llvm-16.0.6-lib
  /nix/store/swah8nd7j3b0b9zk7c4har4lby8cm2lp-llvm-binutils-16.0.6
  /nix/store/qwmbxv3fvsvbk2yv5pryjvdilsnjglc3-lz4-1.9.4
  /nix/store/fff8yx889900vza8gdsja0g7mfq7xxil-lzo-2.10
  /nix/store/c4565v98kjj78bndgs69r3pb2szwkf90-mailcap-2.1.53
  /nix/store/1bmdhpcyl3v0csp9qaxcgba6msn9ikhz-ncurses-6.4
  /nix/store/486hyrx22ivplish064g06bzwxb62v9i-ncurses-6.4
  /nix/store/07nf3231vmxbfn5x7cqm40dyhppxn74w-nettle-3.9.1
  /nix/store/czzsifxsgw15rghxjn826cxkayx40mkg-nghttp2-1.59.0-lib
  /nix/store/kv29whrm3wjn646vfkdp42lgwxx3572j-nixos-configuration-reference-manpage
  /nix/store/rhknkgjb75iwc8pwdiqn65fk5s5fqkbm-nixos-manual-html
  /nix/store/089wibx83w28bylm1q0nyw736ac2vahv-nspr-4.35
  /nix/store/35c0xibqz3my9my7yjxq806safwr665d-nss-3.90.1
  /nix/store/nqm0fdw37c4svp78zz1x8wnb53s0fbc8-oniguruma-6.9.9-lib
  /nix/store/kikf33jphm0l3i2w82cx2a2wnrff67i5-openssl-3.0.13
  /nix/store/xz5mqc76y815g71y6fh68f9wld9ddw22-openssl-3.0.13
  /nix/store/qmk76w9w3av54k6j1glgbc42i2grl1g7-openssl-3.0.13-bin
  /nix/store/97gixfjyghg4njrylhpzs64m5bhslnd6-openssl-3.0.13-dev
  /nix/store/rlg4iw92imyi3vf298b8p51srv28n9vi-orc-0.4.34
  /nix/store/qpf1zw0j9vwbjvbfnp2affcv27vvgnd2-p11-kit-0.25.3
  /nix/store/gpq14wh9r1y5a4yhxilk2z0mr3x106pk-pango-1.51.0
  /nix/store/1s37mqrr4szz2r3fk4hm9rzzgk36jyk6-patch-2.7.6
  /nix/store/4iyqvmkmzhkbny99yl8nvjl9k83r3q64-pcre2-10.42
  /nix/store/zkvxxz1178bagsi7kw4c66hisnm4xwr3-pcre2-10.42
  /nix/store/ai63q5y927zjq2yyy7adbpl2zm8mkzg9-pixman-0.43.2
  /nix/store/1zgsqswia2fl9hjv90n19507pz5k8xr6-post-link-sign-hook
  /nix/store/s3i9c653rhigq2abwiqz206jamwb9gli-publicsuffix-list-0-unstable-2024-01-07
  /nix/store/jbqjsnn0w0ky5bf07kc0fnffsra8na11-python3-3.11.7
  /nix/store/zhb1pv64ccmdc6v0wqzhdkdr22warvzj-qemu-host-cpu-only-8.2.1
  /nix/store/8xrkzyasjjxmwhyhbqwv6i17h53yvmzz-readline-8.2p10
  /nix/store/xjlsjvzzskycnrckyly6bpz250hcka33-signing-utils
  /nix/store/5i0xvg6qscx9dlc8w8wfy2wsakm16870-sigtool-0.1.3
  /nix/store/g2x7pxv16gld2jcaipw02kh64fqgzbla-snappy-1.1.10
  /nix/store/ffd7km988rv2fwzkf26as1p47njq08bj-spice-0.15.2
  /nix/store/fig3g44fcnkvsqmq054n56dpqv328p1z-sqlite-3.45.1
  /nix/store/l0s2k2p4xqqmjsdr5r74dpsbgx5ahznr-sqlite-3.45.1
  /nix/store/nxrrg3b3mcrh8a7sm6lmslwymd1sjwi5-stdenv-darwin
  /nix/store/zf8hff9bnlfix7l7gjsnv3jc22lxzzxx-stdenv-darwin
  /nix/store/zscr9mbb5am1w0w5af2lzyw6lci0kxl6-tremor-unstable-2018-03-16
  /nix/store/8fgdcam9phgwfjzxibsi0a90xw4cf9vs-tzdata-2024a
  /nix/store/wb2ckkvyqrig2dbmywsjib85a9w6s826-unbound-1.19.0-lib
  /nix/store/6q4flvzz2ws1iwpqy6b4pxdr6ls980y3-update-autotools-gnu-config-scripts-hook
  /nix/store/c51f4df3hvq1xf6d5g92m4bcw5yzzmp3-usbredir-0.13.0
  /nix/store/04j79yhvqf654i5154bs6mg9p3d6jb74-vde2-2.3.3
  /nix/store/3ybkqd20p1222syq7b6sc2fkzd3k6hg9-wolfssl-all-5.6.6-lib
  /nix/store/ii4vrk5rvjf980p2jzyr62iwaqc460dq-xz-5.4.6
  /nix/store/nf62p0q6fhprchyb21lp3dl7diw305xy-xz-5.4.6
  /nix/store/v4l2p3sm90qyfsfs7kyw1xb629f93z53-xz-5.4.6-bin
  /nix/store/dgcgy4xqirkqbphrc44vxm0xbj4kr8ng-zlib-1.3.1
  /nix/store/qk6r6k5wldmpcv7hyr2mbg2zmfxfahmr-zstd-1.5.5
error: path '/nix/store/3a21b1avmj0w7wc3bg4l5cxfdwc9b0lw-nixos-vm' is not valid

In my case I'm running on aarch64-darwin so this prevents me from completing the command.

My ping works just fine (well, I have a problem with Trusted but that's probably due to some misconfiguration on my end):

$ nix store ping --store ssh-ng://linux-builder       
Store URL: ssh-ng://linux-builder
Version: 2.18.1
Trusted: 0

@kjeremy did you mean to state in the title nix store verify ... instead of nix store ping ...?

Edit: Fixed my bad markup on the collapse.

LoganBarnett avatar Feb 21 '24 01:02 LoganBarnett

The command is called nix store info

Here's what's going on.

  1. In general, when opening stores, Nix tries to be "helpful" and do all initialization for you. (Fun fact this wasn't always the case, there used to be a a nix-store --init that did this; now it is a no-op.)

  2. While this is useful for many tasks where we want things to succeed, this can also be confusing, as it is in this this. Maybe "ping" certainly implies it won't try to hard working magicking on the "other end". Perhaps "info" doesn't have that same connotation, but it could still be better.

$ nix store info --store /foo
error: creating directory '/foo': Permission denied

I think the error should be at given some sort of "while initialization store ..." context.

Ericson2314 avatar Feb 21 '24 05:02 Ericson2314

@Ericson2314 that's very helpful context, thank you! I actually don't have info available to me, apparently:

$ nix store info --store ssh://linux-builder
error: 'info' is not a recognised command
Try 'nix --help' for more information.

But I'm in the middle of transitioning my home-manager + nix-darwin configuration to nix-darwin with home-manager under it. I suspect there's some gremlins or out-of-date-ness going on there.

LoganBarnett avatar Feb 26 '24 02:02 LoganBarnett