agentmesh-node run fails on restart when --bootstrap-token-path is still set

オープン
#956 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

Start with cmd/agentmesh-node/main.go at the token resolution around line 320 and the stored identity branch around line 474. Trace how the control plane URL and stored identity are checked, then run the node enrollment tests. Done means a node can restart with the spent token, stay healthy, and retain the same PeerID; explicit reset and mesh switching should still re-enroll.

索引モデルが issue の本文から書いたものです。

説明

A node enrolled with a single-use token can't restart with the same command line:

agentmesh-node run --control-plane http://127.0.0.1:8090 --bootstrap-token-path tok --data-dir ./n1   # first run: OK
# stop it, then run the identical command again:
agentmesh-node run --control-plane http://127.0.0.1:8090 --bootstrap-token-path tok --data-dir ./n1
# FATAL ... Bootstrap token max usages exceeded

Dropping --bootstrap-token-path brings the same peer back healthy with its stored identity.

Cause: cmd/agentmesh-node/main.go:320 resolves the token file into bootstrapTokenFlag. The stored-identity branch at :474 only runs when jwtStr == "" && bootstrapTokenFlag == "". A token on the command line therefore always forces re-enrollment, even when a valid identity for the same control plane is already stored.

This bites anything that starts nodes from a fixed command line or unit file: systemd, scheduled tasks, Kubernetes args. The token is spent after the first boot, and every restart after that fails.

Proposal:

  • If a stored identity exists for the same control plane URL, use it, and log that the supplied bootstrap token was not used.
  • Keep explicit re-enrollment unchanged: agentmesh-node reset, or --join when switching meshes.
  • Add a regression test: enroll, restart with the spent token, and expect a healthy node with the same PeerID.

Happy to send the PR if this direction works for you.

主要言語
Go
スター
1.2k
フォーク
207
平均マージ
1日 10時間
マージ済み PR(30日)
85

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/agentmesh のほかの issue

google/agentmesh の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。