Comments (2)
FYI this is NOT a regression introduced by #9816, older releases would do this too:
root@k3s-server-1:/# k3s --version
k3s version v1.29.2+k3s1 (86f10213)
go version go1.21.7
root@k3s-server-1:/# k3s etcd-snapshot save & k3s etcd-snapshot save; sleep 5
INFO[0000] Saving etcd snapshot to /var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459
{"level":"info","ts":"2024-06-19T16:44:19.419289Z","caller":"snapshot/v3_snapshot.go:65","msg":"created temporary db file","path":"/var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459.part"}
INFO[0000] Saving etcd snapshot to /var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459
{"level":"info","ts":"2024-06-19T16:44:19.419976Z","caller":"snapshot/v3_snapshot.go:65","msg":"created temporary db file","path":"/var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459.part"}
{"level":"info","ts":"2024-06-19T16:44:19.42158Z","logger":"client","caller":"[email protected]/maintenance.go:212","msg":"opened snapshot stream; downloading"}
{"level":"info","ts":"2024-06-19T16:44:19.421614Z","caller":"snapshot/v3_snapshot.go:73","msg":"fetching snapshot","endpoint":"https://127.0.0.1:2379"}
{"level":"info","ts":"2024-06-19T16:44:19.422379Z","logger":"client","caller":"[email protected]/maintenance.go:212","msg":"opened snapshot stream; downloading"}
{"level":"info","ts":"2024-06-19T16:44:19.422565Z","caller":"snapshot/v3_snapshot.go:73","msg":"fetching snapshot","endpoint":"https://127.0.0.1:2379"}
{"level":"info","ts":"2024-06-19T16:44:19.444205Z","logger":"client","caller":"[email protected]/maintenance.go:220","msg":"completed snapshot read; closing"}
{"level":"info","ts":"2024-06-19T16:44:19.444299Z","logger":"client","caller":"[email protected]/maintenance.go:220","msg":"completed snapshot read; closing"}
{"level":"info","ts":"2024-06-19T16:44:19.453012Z","caller":"snapshot/v3_snapshot.go:88","msg":"fetched snapshot","endpoint":"https://127.0.0.1:2379","size":"3.8 MB","took":"now"}
{"level":"info","ts":"2024-06-19T16:44:19.45302Z","caller":"snapshot/v3_snapshot.go:88","msg":"fetched snapshot","endpoint":"https://127.0.0.1:2379","size":"3.8 MB","took":"now"}
{"level":"info","ts":"2024-06-19T16:44:19.453083Z","caller":"snapshot/v3_snapshot.go:97","msg":"saved","path":"/var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459"}
ERRO[0000] Failed to take etcd snapshot: could not rename /var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459.part to /var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459 (rename /var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459.part /var/lib/rancher/k3s/server/db/snapshots/on-demand-k3s-server-1-1718815459: no such file or directory)
INFO[0000] Reconciling ETCDSnapshotFile resources
INFO[0000] Reconciling ETCDSnapshotFile resources
INFO[0000] Reconciliation of ETCDSnapshotFile resources complete
INFO[0000] Reconciliation of ETCDSnapshotFile resources complete
[1]+ Done k3s etcd-snapshot save
from k3s.
Validated on Version:
-$ k3s version v1.30.2-rc3+k3s1 (aa4794b3)
Environment Details
Infrastructure
Cloud EC2 instance
Node(s) CPU architecture, OS, and Version:
ubuntu
AMD
Cluster Configuration:
-3 node server
-1 node agents
Steps to validate the fix
- Install k3s etcd embedded
- Take etcd snapshot more than once at the same time
- validate error response
Reproduction Issue:
k3s -v
k3s version v1.27.15-rc1+k3s1 (102e42a5)
go version go1.21.11
k3s etcd-snapshot save & k3s etcd-snapshot save; sleep 5
WARN[0000] Unknown flag --write-kubeconfig-mode found in config.yaml, skipping
WARN[0000] Unknown flag --tls-san found in config.yaml, skipping
WARN[0000] Unknown flag --cluster-init found in config.yaml, skipping
WARN[0000] Unknown flag --protect-kernel-defaults found in config.yaml, skipping
WARN[0000] Unknown flag --selinux found in config.yaml, skipping
WARN[0000] Unknown flag --node-external-ip found in config.yaml, skipping
WARN[0000] Unknown flag --node-ip found in config.yaml, skipping
WARN[0000] Unknown flag --secrets-encryption found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-apiserver-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-controller-manager-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kube-controller-manager-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kubelet-arg found in config.yaml, skipping
WARN[0000] Unknown flag --kubelet-arg found in config.yaml, skipping
WARN[0000] Unknown flag --node-label found in config.yaml, skipping
WARN[0000] Unknown flag --node-label found in config.yaml, skipping
WARN[0000] Unknown flag --node-label found in config.yaml, skipping
FATA[0000] see server log for details: Internal error occurred: etcd-snapshot error ID 20267
INFO[0000] Snapshot on-demand-ip- .us-east-2.compute.internal-1719002637 saved.
[1]+ Done k3s etcd-snapshot save
$ journalctl -xeu k3s.service | grep "snapshot"
Jun 21 20:23:09 ip-1 k3s[13884]: time="2024-06-21T20:23:09Z" level=error msg="Failed to take etcd snapshot: could not rename /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip- .us-east-2.compute.internal-1719001390.part to /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip- .us-east-2.compute.internal-1719001390 (rename /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip- .us-east-2.compute.internal-1719001390.part /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip- .us-east-2.compute.internal-1719001390: no such file or directory)"
Jun 21 20:23:09 ip-1 k3s[13884]: I0621 20:23:09.912916 13884 event.go:307] "Event occurred" object="local-on-demand-ip- .us-east-2.compute.internal-1719001390-c93945" fieldPath="" kind="ETCDSnapshotFile" apiVersion="k3s.cattle.io/v1" type="Warning" reason="ETCDSnapshotFailed" message="Failed to save snapshot on-demand-ip-172-31-1-64.us-east-2.compute.internal-1719001390 on ip-1 us-east-2.compute.internal: could not rename /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip-1 .us-east-2.compute.internal-1719001390.part to /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip- .us-east-2.compute.internal-1719001390 (rename /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip-1 us-east-2.compute.internal-1719001390.part /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip- us-east-2.compute.internal-1719001390: no such file or directory)"
Validation Results:
k3s etcd-snapshot save & k3s etcd-snapshot save; sleep 5
FATA[0000] see server log for details: Internal error occurred: etcd-snapshot error ID 14571
INFO[0000] Snapshot on-demand-ip .us-east-2.compute.internal-1719002785 saved.
[1]+ Done k3s etcd-snapshot save
$ journalctl -xeu k3s.service | grep "snapshot"
Jun 21 20:20:01 ip-172-31-7-229 k3s[13083]: time="2024-06-21T20:20:01Z" level=info msg="Starting managed etcd snapshot ConfigMap controller"
Jun 21 20:20:02 ip-172-31-7-229 k3s[13083]: time="2024-06-21T20:20:02Z" level=info msg="Reconciling snapshot ConfigMap data"
Jun 21 20:22:52 ip-172-31-7-229 k3s[13083]: time="2024-06-21T20:22:52Z" level=info msg="Saving etcd snapshot to /var/lib/rancher/k3s/server/db/snapshots/on-demand-ip- us-east-2.compute.internal-1719001372"
Jun 21 20:22:52 ip-172-31-7-229 k3s[13083]: {"level":"info","ts":"2024-06-21T20:22:52.098617Z","logger":"etcd-client","caller":"snapshot/v3_snapshot.go:65","msg":"created temporary db file","path":"/var/lib/rancher/k3s/server/db/snapshots/on-demand-ip-1 -229.us-east-2.compute.internal-1719001372.part"}
Jun 21 20:22:52 ip- k3s[13083]: {"level":"info","ts":"2024-06-21T20:22:52.101602Z","logger":"etcd-client.client","caller":"[email protected]/maintenance.go:212","msg":"opened snapshot stream; downloading"}
Jun 21 20:22:52 ip- k3s[13083]: {"level":"info","ts":"2024-06-21T20:22:52.101781Z","logger":"etcd-client","caller":"snapshot/v3_snapshot.go:73","msg":"fetching snapshot","endpoint":"https://127.0.0.1:2379"}
Jun 21 20:22:52 ip- k3s[13083]: {"level":"info","ts":"2024-06-21T20:22:52.111894Z","caller":"v3rpc/maintenance.go:126","msg":"sending database snapshot to client","total-bytes":5713920,"size":"5.7 MB"}
Jun 21 20:22:52 ip- k3s[13083]: time="2024-06-21T20:22:52Z" level=error msg="etcd-snapshot error ID 11914: snapshot save already in progress"
Jun 21 20:22:52 ip- k3s[13083]: time="2024-06-21T20:22:52Z" level=error msg="Sending HTTP 500 response to 127.0.0.1:50686: etcd-snapshot error ID 11914"
Jun 21 20:22:52 ip- k3s[13083]: {"level":"info","ts":"2024-06-21T20:22:52.160236Z","caller":"v3rpc/maintenance.go:175","msg":"successfully sent database snapshot to client","total-bytes":5713920,"size":"5.7 MB","took":"now"}
from k3s.
Related Issues (20)
- [Release-1.28] - `k3s etcd-snapshot` commands run against server specified in config file, instead of local server HOT 1
- [Release-1.27] - `k3s etcd-snapshot` commands run against server specified in config file, instead of local server HOT 1
- kube-proxy with ipvs and lc does not work as expected (perhaps a conflict with flannel rules) HOT 3
- [Release-1.30] - Agent loadbalancer may deadlock when servers are removed HOT 1
- [Release-1.30] - `k3s etcd-snapshot` commands run against server specified in config file, instead of local server HOT 1
- Update the Traefik chart HOT 3
- Respect XDG base directory HOT 3
- Install script fails without sudo due to missing $SUDO prefix in transactional-update commands
- Logging of kube-scheduler HOT 5
- NVIDIA GPU detection doesn't work with all the drivers & toolkits installed HOT 2
- Containerd not installed by startup script - invalid capacity 0 on image filesystem warning when starting k3s node HOT 3
- SyncLoadBalancerFailed when using a very long (yet valid) service name
- "Section 3 Control Plane Configuration" in CIS Kubernetes Benchmark v1.8.0 is not applicable for K3s hardening ?
- K3s Multus + Whereabouts doesn't work
- v1.30.2+k3s2: 502 bad gateway when trying to get pod logs HOT 2
- Certificate rotation has no affect on client if server directory is present HOT 1
- Allow duplication of keys in containerd config.toml.tmpl HOT 3
- k3s AWS Credential support
- Critical and high CVEs in Docker images HOT 4
- Bump helm and plugins in klipper-helm image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k3s.