mach icon indicating copy to clipboard operation
mach copied to clipboard

wrench: index.json lists files that do not exist in the server

Open heysokam opened this issue 10 months ago • 10 comments

Unsure where this issue belongs.

I come referenced from this link directing me into wrench https://github.com/mlugg/setup-zig/tree/main?tab=readme-ov-file#adding-a-mirror

Tested yesterday and today (23.mar.2025) Almost every link listed at https://github.com/mlugg/setup-zig/blob/main/mirrors.json is missing the files for 0.14.0.

Yet, all of their index.json data contains direct links to non-existing *0.14.0.[zip/tar] files with urls pointing to their domains.

This leads me to think that something in their tooling is populating their index.json correctly, but not uploading the actual tarballs.

The mirror hosted by machengine does work correctly, though. I don't know if those links are using wrench, but I don't know where to start and setup-zig is pointing me in this direction. So I figured you guys might have some insight.

heysokam avatar Mar 23 '25 08:03 heysokam

Got example links?

emidoots avatar Mar 23 '25 16:03 emidoots

Got example links?

@emidoots Yea, here are some json arrays of the hits for the servers at: https://github.com/mlugg/setup-zig/blob/main/mirrors.json

Unable to fetch:

[
{
  shasum: "473ec26806133cf4d1918caf1a410f8403a13d979726a9045b421b685031a982",
  size: "49091960",
  tarball: "https://zigmirror.nesovic.dev/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
  zigTarball: "https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
},
{
  shasum: "473ec26806133cf4d1918caf1a410f8403a13d979726a9045b421b685031a982",
  size: "49091960",
  tarball: "https://zigmirror.hryx.net/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
  zigTarball: "https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
},
{
  shasum: "473ec26806133cf4d1918caf1a410f8403a13d979726a9045b421b685031a982",
  size: "49091960",
  tarball: "https://zig.linus.dev/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
  zigTarball: "https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
},
{
  shasum: "473ec26806133cf4d1918caf1a410f8403a13d979726a9045b421b685031a982",
  size: "49091960",
  tarball: "https://zig.nekos.space/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
  zigTarball: "https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
}
]

Works:

[
{
  tarball: "https://fs.liujiacai.net/zigbuilds/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
  shasum: "473ec26806133cf4d1918caf1a410f8403a13d979726a9045b421b685031a982",
  size: "49091960",
},
{
  shasum: "473ec26806133cf4d1918caf1a410f8403a13d979726a9045b421b685031a982",
  size: "49091960",
  tarball: "https://pkg.machengine.org/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
  zigTarball: "https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz",
}
]

heysokam avatar Mar 23 '25 19:03 heysokam

One of the reasons why I added a status page => https://status.nesovic.dev/history/zig-mirror A few weeks back I experienced a wrench issue. When I get some spare time I'll investigate why the 0.14.0 didn't propagate as expected. @heysokam

kaynetik avatar Mar 24 '25 06:03 kaynetik

It seems that wrench has cached a 404 response as this shows up in the logs: zig: not fetching: https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz (cached error bad response status: 404 Not Found).

I have restarted wrench and now the file (https://zig.nekos.space/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz) should exist and download correctly. Please let me know if this works.

0t4u avatar Mar 24 '25 11:03 0t4u

@0t4u Can confirm your link now works.

ᛝ confy: Zig: Done requesting url:  https://zig.nekos.space/zig/index.json?source=confy
ᛝ confy: Zig: Done downloading:  zig.index.json from:  https://zig.nekos.space/zig/index.json?source=confy
ᛝ confy: Zig: Done requesting url:  https://zig.nekos.space/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz.minisig?source=confy
ᛝ confy: Zig: Done downloading:  zig-linux-x86_64-0.14.0.tar.xz.minisig from:  https://zig.nekos.space/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz.minisig?source=confy
ᛝ confy: Zig: Done requesting url:  https://zig.nekos.space/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz?source=confy
ᛝ confy: Zig: Done downloading:  zig-linux-x86_64-0.14.0.tar.xz from:  https://zig.nekos.space/zig/0.14.0/zig-linux-x86_64-0.14.0.tar.xz?source=confy

heysokam avatar Mar 24 '25 12:03 heysokam

I have restarted wrench and now the file should exist and download correctly. Please let me know if this works.

I've done the same for my mirror, can confirm this solves the issue.

linusg avatar Mar 24 '25 17:03 linusg

Same issues as it seems:

Mar 24 18:29:35 critical-infra-z0sc.europe-west6-c.c.tfstate-3bdaa5ed.internal wrench[664]: 2025-03-24T18:29:35Z zig: not fetching: https://ziglang.org/download/0.14.0/zig-linux-aarch64-0.14.0.tar.xz.minisig (cached error bad response status: 404 Not Found)
Mar 24 18:29:35 critical-infra-z0sc.europe-west6-c.c.tfstate-3bdaa5ed.internal wrench[664]: 2025-03-24T18:29:35Z zig:
Mar 24 18:29:35 critical-infra-z0sc.europe-west6-c.c.tfstate-3bdaa5ed.internal wrench[664]: 2025-03-24T18:29:35Z zig: error downloading file: bad response status: 404 Not Found

Restarting fixes it.

If you know of something a bit more stable than wrench, feel free to recommend. Would like to have it stable and not think about the mirror... 😂

kaynetik avatar Mar 24 '25 18:03 kaynetik

Bugs happen, that statement isn't particularly productive. When I last checked wrench was the only software providing a Zig mirror OOTB.

linusg avatar Mar 24 '25 18:03 linusg

It should be (in theory) relatively simple to add a check to see if the file path with the cached 404 corresponds to an entry in the index file and refetch, I'll see if I can throw together a PR tonight.

0t4u avatar Mar 24 '25 18:03 0t4u