unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70588: hash mismatch error and stop fallback
@ 2024-04-25 13:28 Simon Tournier
  2024-05-01 10:36 ` Ludovic Courtès
  2024-05-03 17:53 ` Simon Tournier
  0 siblings, 2 replies; 3+ messages in thread
From: Simon Tournier @ 2024-04-25 13:28 UTC (permalink / raw)
  To: 70588; +Cc: ludo

Hi,

Considering something from the past – well to my knowledge it is still
an issue with the current implementation and such it will be a issue for
the future. ;-)

For instance, the R package MASS from 2019 (Guix revision 711cec):
because the CRAN project did some in-place replacements, we have a hash
mismatch and all the process stops.

--8<---------------cut here---------------start------------->8---
$ guix build /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
The following derivation will be built:
  /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv
building /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv...

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.r-project.org/src/contrib/MASS_7.3-51.4.tar.gz...
download failed "http://cran.r-project.org/src/contrib/MASS_7.3-51.4.tar.gz" 404 "Not Found"

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.rstudio.com/src/contrib/MASS_7.3-51.4.tar.gz...
download failed "http://cran.rstudio.com/src/contrib/MASS_7.3-51.4.tar.gz" 404 "Not Found"

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.univ-lyon1.fr/src/contrib/MASS_7.3-51.4.tar.gz...
following redirection to `https://pbil.univ-lyon1.fr/CRAN/src/contrib/MASS_7.3-51.4.tar.gz'...
download failed "https://pbil.univ-lyon1.fr/CRAN/src/contrib/MASS_7.3-51.4.tar.gz" 404 "Not Found"

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.ism.ac.jp/src/contrib/MASS_7.3-51.4.tar.gz...
download failed "http://cran.ism.ac.jp/src/contrib/MASS_7.3-51.4.tar.gz" 404 "Not Found"

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.stat.auckland.ac.nz/src/contrib/MASS_7.3-51.4.tar.gz...
download failed "http://cran.stat.auckland.ac.nz/src/contrib/MASS_7.3-51.4.tar.gz" 404 "Not Found"

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.mirror.ac.za/src/contrib/MASS_7.3-51.4.tar.gz...
download failed "http://cran.mirror.ac.za/src/contrib/MASS_7.3-51.4.tar.gz" 404 "Not Found"

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.csie.ntu.edu.tw/src/contrib/MASS_7.3-51.4.tar.gz...
download failed "http://cran.csie.ntu.edu.tw/src/contrib/MASS_7.3-51.4.tar.gz" 404 "Not Found"

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From http://cran.r-project.org/src/contrib/Archive/MASS/MASS_7.3-51.4.tar.gz...
downloading from http://cran.r-project.org/src/contrib/Archive/MASS/MASS_7.3-51.4.tar.gz ...
 MASS_7.3-51.4.tar.gz  476KiB         2.1MiB/s 00:00 ▕██████████████████▏ 100.0%
sha256 hash mismatch for /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz:
  expected hash: 0x1ckf51y851g0kvbhsgdxb26vfpmbw3xdbcnh3ck7fjm13da4cr
  actual hash:   1swfd4jnqhsb2imznib629bywrxah7b63yqxhwhd9bhyaji70hl4
hash mismatch for store item '/gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz'
build of /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv failed
View build log at '/var/log/guix/drvs/wf/q2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv.gz'.
guix build: error: build of `/gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv' failed
--8<---------------cut here---------------end--------------->8---


When the source is correctly available in SWH:

--8<---------------cut here---------------start------------->8---
$ guix build /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv
The following derivation will be built:
  /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv
building /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv...

[...]

Starting download of /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
From https://archive.softwareheritage.org/api/1/content/sha256:9911d546a8d29dc906b46cb53ef8aad76d23566f4fc3b52778a1201f8a9b2c74/raw/...
downloading from https://archive.softwareheritage.org/api/1/content/sha256:9911d546a8d29dc906b46cb53ef8aad76d23566f4fc3b52778a1201f8a9b2c74/raw/ ...
 raw/  476KiB                         9.9MiB/s 00:00 ▕██████████████████▏ 100.0%
successfully built /gnu/store/wfq2ji5x9awgyk680i1vv95hq75nx3vv-MASS_7.3-51.4.tar.gz.drv
/gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz

$ guix hash /gnu/store/gxbam95zqjaxdd6303j97z4djr907yzn-MASS_7.3-51.4.tar.gz
0x1ckf51y851g0kvbhsgdxb26vfpmbw3xdbcnh3ck7fjm13da4cr
--8<---------------cut here---------------end--------------->8---

Therefore, the bug is to not consider a hash mismatch as a fullstop and
error out but consider it as a failure of one strategy and thus try the
next strategy.

Other said, hash mismatch should be raised and obviously the content
must be discarded; then the hash mismatch should be considered as “not
found” so let try the next strategy for downloading the content.

Cheers,
simon




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#70588: hash mismatch error and stop fallback
  2024-04-25 13:28 bug#70588: hash mismatch error and stop fallback Simon Tournier
@ 2024-05-01 10:36 ` Ludovic Courtès
  2024-05-03 17:53 ` Simon Tournier
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2024-05-01 10:36 UTC (permalink / raw)
  To: Simon Tournier; +Cc: 70588

Hi,

Simon Tournier <zimon.toutoune@gmail.com> skribis:

> Other said, hash mismatch should be raised and obviously the content
> must be discarded; then the hash mismatch should be considered as “not
> found” so let try the next strategy for downloading the content.

Agreed.  I merged it with <https://issues.guix.gnu.org/28659>.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#70588: hash mismatch error and stop fallback
  2024-04-25 13:28 bug#70588: hash mismatch error and stop fallback Simon Tournier
  2024-05-01 10:36 ` Ludovic Courtès
@ 2024-05-03 17:53 ` Simon Tournier
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Tournier @ 2024-05-03 17:53 UTC (permalink / raw)
  To: 70588; +Cc: ludo

Hi,

On lun., 02 oct. 2017 at 17:09, ludo@gnu.org (Ludovic Courtès) wrote:

> The problem is that the hash check is performed by guix-daemon itself,
> not by “guix perform-download”.  So when guix-daemon diagnoses a hash
> mismatch, it’s too late and we cannot try again and use the
> content-addressed mirror.

This quote from [1].  Well, why not run a sequence of “guix download”
then “guix build”?  Ah the store item would be hashed twice.  Let try to
avoid this sub-optimized behaviour.

The only way to avoid hashing twice is to extend the protocol of
guix-daemon.  Because currently it reads,

            /* Check the hash. */
            Hash h2 = recursive ? hashPath(ht, actualPath).first : hashFile(ht, actualPath);
            if (h != h2) {
		if (settings.printBuildTrace)
		    printMsg(lvlError, format("@ hash-mismatch %1% %2% %3% %4%")
			     % path % i->second.hashAlgo
			     % printHash16or32(h) % printHash16or32(h2));
                throw BuildError(format("hash mismatch for store item '%1%'") % path);
	    }

with the call under error catch:

        /* Compute the FS closure of the outputs and register them as
           being valid. */
        registerOutputs();

[...]

    } catch (BuildError & e) {


Thus the number of solutions is very limited. :-)

Well, from my understanding, moving elsewhere in guix-daemon the check
of the hash appears to me too cumbersome.  Therefore, the only way is to
replace this ’BuildError’ by something that is not an error and do not
register the item.

Easier to say than to implement.  Again from my understanding, each
strategy for downloading is seen by the daemon as an element of a list
of independent builds and these elements are tried in sequence.
Therefore, we need to special case in order to be able to distinguish
different kind of failures.

All in all, this bug (missing feature):

        Other said, hash mismatch should be raised and obviously the content
        must be discarded; then the hash mismatch should be considered as “not
        found” so let try the next strategy for downloading the content.

is not straightforward to fix. :-)  Need for more thought…


Cheers,
simon


1: bug#28659: v0.13: guix pull fails; libgit2-0.26.0 and 0.25.1 content hashes fail
ludo@gnu.org (Ludovic Courtès)
Mon, 02 Oct 2017 17:09:39 +0200
id:87o9ppoabw.fsf@gnu.org
https://issues.guix.gnu.org/28659
https://issues.guix.gnu.org/msgid/87o9ppoabw.fsf@gnu.org
https://yhetil.org/guix/87o9ppoabw.fsf@gnu.org




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-03 18:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 13:28 bug#70588: hash mismatch error and stop fallback Simon Tournier
2024-05-01 10:36 ` Ludovic Courtès
2024-05-03 17:53 ` Simon Tournier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).