k0sproject / k0sproject/k0sctl

tee: /usr/local/bin/k0s: Text file busy

Open
#357 8 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
582
Forks
113
Avg merge
2d 13h
Merged PRs (30d)
34

Description

Upgrading a cluster from one node to three nodes failed with the following log line:

> level=fatal msg="upload failed: Process exited with status 1 (tee: /usr/local/bin/k0s: Text file busy\n)"

Target OS: Alpine 3.15
k0sctl version: 0.13.0-rc.1-1-gaf2f60b (af2f60b896c1b4ba4f1e6016fe445d9cfa7fe247)
[k0sctl.log](https://github.com/k0sproject/k0sctl/files/8349044/k0sctl.log)

A second run of k0sctl also fails because it tries to join new controllers by requesting a token from the wrong node (the newly created one which hasn't been joined):

> time="25 Mar 22 10:29 CET" level=debug msg="[ssh] 10.83.134.16:22: executing `sudo -s /usr/local/bin/k0s token create --role controller --expiry 10m0s`"

Logs from the second run: [k0sctl_2.log](https://github.com/k0sproject/k0sctl/files/8349249/k0sctl_2.log)

Config used:

```yaml
"apiVersion": "k0sctl.k0sproject.io/v1beta1"
"kind": "Cluster"
"metadata":
"name": "k0s-cluster"
"spec":
"hosts":
- "files":
- "dstDir": "/var/lib/k0s/images/"
"name": "bundle-file"
"perm": "0755"
"src": "airgap-images.tar"
"role": "controller+worker"
"ssh":
"address": "10.83.134.28"
"keyPath": "id_rsa"
"port": 22
"user": "k0s"
"uploadBinary": true
- "files":
- "dstDir": "/var/lib/k0s/images/"
"name": "bundle-file"
"perm": "0755"
"src": "airgap-images.tar"
"role": "controller+worker"
"ssh":
"address": "10.83.134.16"
"keyPath": "id_rsa"
"port": 22
"user": "k0s"
"uploadBinary": true
- "files":
- "dstDir": "/var/lib/k0s/images/"
"name": "bundle-file"
"perm": "0755"
"src": "airgap-images.tar"
"role": "controller+worker"
"ssh":
"address": "10.83.134.66"
"keyPath": "id_rsa"
"port": 22
"user": "k0s"
"uploadBinary": true
"k0s":
"config":
"spec":
"telemetry":
"enabled": false
"version": "v1.23.3+k0s.1"
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attached k0sctl logs and the provided three-host YAML configuration; trace the upload during an upgrade on Alpine 3.15 and the controller-token request on the second run. Done means the upgrade succeeds without the “Text file busy” failure and new controllers request their token from the correct existing node.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.