Open borissavelev opened 7 months ago
This is coming from https://github.com/pingcap/tiup/blob/48f15f405450faf7d57136e629285724a0713cde/pkg/repository/v1manifest/types.go#L174
Maybe there is something wrong with the manifest and it is also not validated correctly.
A failed attempt at reproducing this:
dvaneeden@dve-carbon:~$ tiup --version
1.15.0 tiup
Go Version: go1.21.8
Git Ref: v1.15.0
GitHash: 48f15f405450faf7d57136e629285724a0713cde
dvaneeden@dve-carbon:~$ tiup mirror show
https://tiup-mirrors.pingcap.com/
dvaneeden@dve-carbon:~$ tiup mirror clone /tmp/tiup-mirror -o linux -a amd64 --br v8.0.0
Start to clone mirror, targetDir is /tmp/tiup-mirror, source mirror is https://tiup-mirrors.pingcap.com/, selectedVersions are []
If this does not meet expectations, please abort this process, read `tiup mirror clone --help` and run again
Arch [amd64]
OS [linux]
br linux/amd64 selected version is v8.0.0
download https://tiup-mirrors.pingcap.com/br-v8.0.0-linux-amd64.tar.gz 82.32 MiB / 82.32 MiB 100.00% 137.89 MiB/s
download https://tiup-mirrors.pingcap.com/tiup-linux-amd64.tar.gz 4.98 MiB / 4.98 MiB 100.00% ? MiB/s
dvaneeden@dve-carbon:~$ tiup mirror set /tmp/tiup-mirror
Successfully set mirror to /tmp/tiup-mirror
dvaneeden@dve-carbon:~$ tiup list --all
Available components:
Name Owner Description
---- ----- -----------
br pingcap TiDB/TiKV cluster backup restore tool.
dvaneeden@dve-carbon:~$ tiup mirror renew br --days 365
Error: invalid signature
dvaneeden@dve-carbon:~$ find /tmp/tiup-mirror
/tmp/tiup-mirror
/tmp/tiup-mirror/keys
/tmp/tiup-mirror/keys/19b723eb64b0075f-root.json
/tmp/tiup-mirror/keys/cfb7879f8d52e538-root.json
/tmp/tiup-mirror/keys/9ac341b84580326a-root.json
/tmp/tiup-mirror/keys/8ee224880571ef3f-index.json
/tmp/tiup-mirror/keys/e95c8a03d0778fc8-snapshot.json
/tmp/tiup-mirror/keys/17127065cfad4c94-timestamp.json
/tmp/tiup-mirror/keys/4c793e7bbaec350a-pingcap.json
/tmp/tiup-mirror/br-v8.0.0-linux-amd64.tar.gz
/tmp/tiup-mirror/tiup-linux-amd64.tar.gz
/tmp/tiup-mirror/1.index.json
/tmp/tiup-mirror/1.root.json
/tmp/tiup-mirror/root.json
/tmp/tiup-mirror/snapshot.json
/tmp/tiup-mirror/timestamp.json
/tmp/tiup-mirror/8512.br.json
/tmp/tiup-mirror/local_install.sh
Most likely it fails because you don't have a private key to sign the repo.
I have my own private key for signing and custom components singed by this key.
Moreover, it fails with sigsegv only with expired signature
Does the manifest for the component have a key with signed
and subkeys for _type
,spec_version
,expires
and version
?
Like this:
$ jq '.signed._type' /tmp/tiup-mirror/8512.br.json
"component"
If it can't work because of not having the right private key then it should report something like Error: invalid signature
.
Ok, I now get what's happening:
For the component it calls GetComponentManifest()
which returns a component manifest and an error.
Then it checks if the error is caused by expiration via IsExpirationError()
, which in this case is true. This means it just prints the error (which is in the output you shared) and continues.
However the manifest that GetComponentManifest()
returned is then used in the call to RenewManifest()
. However the problem with this is that GetComponentManifest()
returns a nil manifest if it returns an error.
Bug Report
Please answer these questions before submitting your issue. Thanks!
I have my own custom tiup local repository. Apparently, it expired and I wanted to renew a component.
Successful component renew
tiup --version
)?