Fresh Stork agent doesn't run without registration
The fresh Stork agent (no certificate files in /var/lib/stork-agent
) cannot run without performing the registration even if the --listen-prometheus-only flag is set. The bug was likely provided in #1352 (closed).
FATA[2024-06-10 09:52:45] main.go:146 FATAL error: cert store is not valid
isc.org/stork/util.CombineErrors
/home/deep/Projects/stork/backend/util/util.go:472
isc.org/stork/agent.(*CertStore).IsValid
/home/deep/Projects/stork/backend/agent/certstore.go:423
isc.org/stork/agent.newGRPCServerWithTLS
/home/deep/Projects/stork/backend/agent/agent.go:148
isc.org/stork/agent.(*StorkAgent).Setup
/home/deep/Projects/stork/backend/agent/agent.go:198
main.runAgent
/home/deep/Projects/stork/backend/cmd/stork-agent/main.go:144
main.runApp
/home/deep/Projects/stork/backend/cmd/stork-agent/main.go:377
main.main
/home/deep/Projects/stork/backend/cmd/stork-agent/main.go:394
runtime.main
/home/deep/Projects/stork/tools/golang/go/src/runtime/proc.go:271
runtime.goexit
/home/deep/Projects/stork/tools/golang/go/src/runtime/asm_amd64.s:1695
could not read the cert: could not read the file: /var/lib/stork-agent/certs/cert.pem: open /var/lib/stork-agent/certs/cert.pem: no such file or directory
could not read the root CA: could not read the file: /var/lib/stork-agent/certs/ca.pem: open /var/lib/stork-agent/certs/ca.pem: no such file or directory
could not read the private key: could not read the file: /var/lib/stork-agent/certs/key.pem: open /var/lib/stork-agent/certs/key.pem: no such file or directory
could not read the agent token: could not read the file: /var/lib/stork-agent/tokens/agent-token.txt: open /var/lib/stork-agent/tokens/agent-token.txt: no such file or directory
could not read the server cert fingerprint: could not read the file: /var/lib/stork-agent/tokens/server-cert.sha256: open /var/lib/stork-agent/tokens/server-cert.sha256: no such file or directory
the agent cannot start due to invalid certificates; consider running 'stork-agent register' to obtain valid certificates