Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: token creation in all flows #4

Merged
merged 1 commit into from
Apr 6, 2023
Merged

Conversation

csmartins
Copy link
Collaborator

Problem statement

When testing this

token: f62a4d061f03ebe8b0ba8db8d010c988

command generated:

{"level":"info","ts":"2023-04-04T18:51:26.251Z","caller":"etcdmain/etcd.go:73","msg":"Running: ","args":["/usr/local/bin/etcd","--data-dir=/var/etcd/data","--name=etcd-cluster-c9nqcdk5vp","--initial-advertise-peer-urls=http://etcd-cluster-c9nqcdk5vp.etcd-cluster.etcd.svc:2380","--listen-peer-urls=http://0.0.0.0:2380","--listen-client-urls=http://0.0.0.0:2379","--advertise-client-urls=http://etcd-cluster-c9nqcdk5vp.etcd-cluster.etcd.svc:2379","--discovery=https://discovery.etcd.io/68898fb7-f5b3-4a58-ac13-52c5fe462544"]}

Which lead to a failed cluster

{"level":"warn","ts":"2023-04-04T18:51:26.391Z","caller":"etcdmain/etcd.go:146","msg":"failed to start etcd","error":"failed to join discovery cluster (discovery: bad discovery endpoint)"}
{"level":"warn","ts":"2023-04-04T18:51:26.391Z","caller":"etcdmain/etcd.go:181","msg":"failed to bootstrap; discovery token was already used","discovery-token":"https://discovery.etcd.io/68898fb7-f5b3-4a58-ac13-52c5fe462544","error":"failed to join discovery cluster (discovery: bad discovery endpoint)"}
{"level":"warn","ts":"2023-04-04T18:51:26.391Z","caller":"etcdmain/etcd.go:186","msg":"do not reuse discovery token; generate a new one to bootstrap a cluster"}

@csmartins
Copy link
Collaborator Author

Logs when testing with the PR image

[
    {
        "level": "info",
        "ts": "2023-04-05T19:58:22.848Z",
        "caller": "embed/etcd.go:306",
        "msg": "starting an etcd server",
        "etcd-version": "3.5.7",
        "git-sha": "215b53cf3",
        "go-version": "go1.17.13",
        "go-os": "linux",
        "go-arch": "amd64",
        "max-cpu-set": 4,
        "max-cpu-available": 4,
        "member-initialized": false,
        "name": "etcd-cluster-qgjnddndsh",
        "data-dir": "/var/etcd/data",
        "wal-dir": "",
        "wal-dir-dedicated": "",
        "member-dir": "/var/etcd/data/member",
        "force-new-cluster": false,
        "heartbeat-interval": "100ms",
        "election-timeout": "1s",
        "initial-election-tick-advance": true,
        "snapshot-count": 100000,
        "max-wals": 5,
        "max-snapshots": 5,
        "snapshot-catchup-entries": 5000,
        "initial-advertise-peer-urls": [
            "http://etcd-cluster-qgjnddndsh.etcd-cluster.etcd.svc:2380"
        ],
        "listen-peer-urls": [
            "http://0.0.0.0:2380"
        ],
        "advertise-client-urls": [
            "http://etcd-cluster-qgjnddndsh.etcd-cluster.etcd.svc:2379"
        ],
        "listen-client-urls": [
            "http://0.0.0.0:2379"
        ],
        "listen-metrics-urls": [],
        "cors": [
            "*"
        ],
        "host-whitelist": [
            "*"
        ],
        "initial-cluster": "etcd-cluster-qgjnddndsh=http://etcd-cluster-qgjnddndsh.etcd-cluster.etcd.svc:2380",
        "initial-cluster-state": "new",
        "initial-cluster-token": "https://discovery.etcd.io/d2cd6ed8b6f248ae29dd0be06520a623",
        "quota-backend-bytes": 2147483648,
        "max-request-bytes": 1572864,
        "max-concurrent-streams": 4294967295,
        "pre-vote": true,
        "initial-corrupt-check": false,
        "corrupt-check-time-interval": "0s",
        "compact-check-time-enabled": false,
        "compact-check-time-interval": "1m0s",
        "auto-compaction-mode": "periodic",
        "auto-compaction-retention": "5m0s",
        "auto-compaction-interval": "5m0s",
        "discovery-url": "https://discovery.etcd.io/d2cd6ed8b6f248ae29dd0be06520a623",
        "discovery-proxy": "",
        "downgrade-check-interval": "5s"
    },
    {
        "level": "info",
        "ts": "2023-04-05T19:58:22.855Z",
        "caller": "etcdserver/backend.go:81",
        "msg": "opened backend db",
        "path": "/var/etcd/data/member/snap/db",
        "took": "5.846786ms"
    },
    {
        "level": "info",
        "ts": "2023-04-05T19:58:23.225Z",
        "caller": "v2discovery/discovery.go:336",
        "msg": "found self from discovery server",
        "discovery-url": "https://discovery.etcd.io",
        "self": "10b80af31e8c0799"
    },
    {
        "level": "info",
        "ts": "2023-04-05T19:58:23.225Z",
        "caller": "v2discovery/discovery.go:352",
        "msg": "found peers from discovery server; waiting for more",
        "discovery-url": "https://discovery.etcd.io",
        "found-peers": 1,
        "needed-peers": 2
    }
]

@csmartins csmartins merged commit 2755f3f into master Apr 6, 2023
@csmartins csmartins deleted the fix/token-creation branch April 6, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants