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

sshkeys: do not fail if no keys are deployed #317

Closed
zyclonite opened this issue Nov 28, 2019 · 2 comments · Fixed by #318
Closed

sshkeys: do not fail if no keys are deployed #317

zyclonite opened this issue Nov 28, 2019 · 2 comments · Fixed by #318

Comments

@zyclonite
Copy link

Bug

Operating System Version

30.20191014.1 (CoreOS preview)
(happened in previous versions as well)

Afterburn Version

4.1.3

Environment

aws

Expected Behavior

no failing systemd unit after boot

Actual Behavior

● afterburn-sshkeys@core.service - Afterburn (SSH Keys)
   Loaded: loaded (/usr/lib/systemd/system/afterburn-sshkeys@.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-11-28 10:25:13 UTC; 8min ago
  Process: 934 ExecStart=/usr/bin/afterburn ${AFTERBURN_OPT_PROVIDER} --ssh-keys=core (code=exited, status=1/FAILURE)
 Main PID: 934 (code=exited, status=1/FAILURE)

Nov 28 10:25:12 ip-10-100-20-105.eu-west-1.compute.internal systemd[1]: Starting Afterburn (SSH Keys)...
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal afterburn[934]: Nov 28 10:25:13.314 INFO Fetching http://169.254.169.254/2009-04-04/meta-data/public-keys: Attempt #1
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal afterburn[934]: Nov 28 10:25:13.327 INFO Fetch failed with 404: resource not found
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal afterburn[934]: Error: writing ssh keys
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal afterburn[934]: Caused by: failed to open "/var/home/core/.ssh/authorized_keys.d" for syncing
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal afterburn[934]: Caused by: No such file or directory (os error 2)
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal systemd[1]: afterburn-sshkeys@core.service: Main process exited, code=exited, status=1/FAILURE
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal systemd[1]: afterburn-sshkeys@core.service: Failed with result 'exit-code'.
Nov 28 10:25:13 ip-10-100-20-105.eu-west-1.compute.internal systemd[1]: Failed to start Afterburn (SSH Keys).

Reproduction Steps

  1. start new ec2 instance without providing ssh keys
  2. ssh into instance and check for failed systemd units

Other Information

@lucab
Copy link
Contributor

lucab commented Nov 28, 2019

Thanks for the report.
This is indeed a buggy interaction between the file writing logic and the set of SSH keys being empty.

@lucab
Copy link
Contributor

lucab commented Nov 28, 2019

PR at #318.

@lucab lucab changed the title aws: do not fail if no sshkeys are deployed sshkesy: do not fail if no keys are deployed Nov 28, 2019
@lucab lucab changed the title sshkesy: do not fail if no keys are deployed sshkeys: do not fail if no keys are deployed Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants