tiup mirrot publish component到本地镜像仓库失败

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【TiDB 版本】
tiup: latest
server: v1.3.2

【问题描述】
需求: 安装自己写的tiup component
方法: tiup server拉起一个本地镜像仓库,通过tiup mirror publish发布镜像,然后安装

tiup install server
mkdir mirror-test
tiup mirror clone mirror-test v4.0.10  --arch=amd64
tiup server $(pwd)/mirror-test --addr 0.0.0.0:8899 
cp *pingcap.json ~/.tiup/keys/private.json
tiup mirror set http://0.0.0.0:8899 
tiup mirror publish hello v0.0.1 hello.tar.gz hello.sh --os=any --arch=any --desc="hello world example"

遇到的问题: tiup mirror publish一直报错

Fetch local manifest: read manifest from mirror(http://0.0.0.0:8989) failed: not enough signatures (0) for threshold 3 in root.json
Failed to load component manifest, create a new one
Error: Unknow error from server, response code: 500 response body: {"status":"INTERNAL ERROR","message":"an internal error happened"}

若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

rm -rf ~/.tiup/manifests/
rm -rf ~/.tiup/bin
$(pwd)/mirror-test
sh -x local_install.sh
source /home/tidb//.bash_profile
tiup mirror publish hello v0.0.1 hello.tar.gz hello.sh --os=any --arch=any --desc="hello world example"

报错:

Fetch local manifest: unknown component
Failed to load component manifest, create a new one
Error: owner not found

Hi~ 抱歉,文档上少了个参数,启动 server 的时候请加上参数:--upstream=""

tiup mirror set https://tiup-mirrors.pingcap.com
tiup server $(pwd)/mirror-test --addr 0.0.0.0:8899 --upstream=""

rm -rf ~/.tiup/bin/*.root.json
tiup mirror set http://127.0.0.1:8899
tiup mirror publish...
Fetch local manifest: unknown component
Failed to load component manifest, create a new one
Error: Unknow error from server, response code: 500 response body: {"status":"INTERNAL ERROR","message":"an internal error happened"}

服务器的启动参数是什么样的?

 tiup server /data1/deploy/tiup-console/mirror --addr 0.0.0.0:8899 --upstream=""

经测试,可尝试以下两个脚本:

serve.sh:

# !/bin/sh

tiup mirror set https://tiup-mirrors.pingcap.com
rm -rf /tmp/tiup-mirror-test
tiup mirror clone /tmp/tiup-mirror-test
tiup server:v1.3.2 /tmp/tiup-mirror-test --upstream="" --addr="0.0.0.0:8899"

play.sh

# !/bin/sh

cd /tmp

cat > hello.sh << EOF
#! /bin/sh

echo "hello world"
EOF

chmod 755 hello.sh
rm -f hello.tar.gz
tar czf hello.tar.gz hello.sh 

rm -f ~/.tiup/bin/*.root.json
tiup mirror set http://127.0.0.1:8899
tiup mirror publish hello v0.0.1 hello.tar.gz hello.sh --key /tmp/tiup-mirror-test/keys/*pingcap.json
tiup list
tiup list hello
tiup hello

启动两个窗口,在其中一个执行 serve.sh,待服务器启动后,在另一个窗口执行 play.sh

1 个赞

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。