coder / coder/coder

init script fails to curl coder server

Open
#15,825 1 comment 0 reactions 0 assignees View on GitHub
bug risk s2
Dominant language
Go
Stars
14.5k
Forks
1.5k
Avg merge
1d 20h
Merged PRs (30d)
601

Description

### Discussed in https://github.com/coder/coder/discussions/14934

Originally posted by **MaxTNielsen** October 2, 2024
From the container logs it shows that the curl command fails:
```
2024-10-02T14:00:31.713217679Z Trying again in 30 seconds...
curl: (35) Insufficient randomness
error: failed to download coder agent
```
Entropy:
```
cat /proc/sys/kernel/random/entropy_avail
3669
```
After an extensive search on google I've tried the following to fix the error with curl:

- Increase the entropy (hail mary since the entropy is high)
- Update openssl to the newest version

wget works.

I would like to petition if it is possible to modify the init_sript with error handling so it instead tries with wget if the exit code from the curl command is = 0:

```
status=""
if command -v curl >/dev/null 2>&1; then
curl -fsSL --compressed "${BINARY_URL}" -o "${BINARY_NAME}" && break
status=$?
# Check if curl was successful
if [ "$status" -eq 0 ]; then
break
fi
```

Or if you have any other suggestions that would be appriciated!

I'm running rootless and without privilege escalation.

Kind regards
Max

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.