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

1.16.0 requires $HOME to be set #26199

Closed
baguasquirrel opened this issue Mar 28, 2024 · 4 comments · Fixed by #26243
Closed

1.16.0 requires $HOME to be set #26199

baguasquirrel opened this issue Mar 28, 2024 · 4 comments · Fixed by #26243
Assignees
Labels
bug Used to indicate a potential bug core/cli reproduced This issue has been reproduced by a Vault engineer

Comments

@baguasquirrel
Copy link

baguasquirrel commented Mar 28, 2024

Describe the bug
Prior to 1.16.0, we had scripts that ran without a $HOME directory set. Then in vault 1.16.0, we encountered this issue:

vault login -method=aws
failed to retrieve config path and directory: failed to retrieve user's home directory path: $HOME is not defined

To Reproduce
Steps to reproduce the behavior:

  1. Run vault 1.16.0 with $HOME not set, i.e. HOME='' ./vault login -method=aws

Expected behavior
Previously, this would work:

vault login -method=aws
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.

<further output redacted>

Environment:

  • Vault Server Version (retrieve with vault status): 1.9.9
  • Vault CLI Version (retrieve with vault version): 1.16.0
  • Server Operating System/Architecture: Ubuntu 20.04

Vault server configuration file(s):

Not applicable

Additional context
There is no mention of $HOME in the release notes for 1.16.0 (which are still on rc3). We wonder if 1.16.0 was released prematurely, and/or if there was a dependency in the golang libraries that got updated, that suddenly required $HOME to be set.

@baguasquirrel baguasquirrel changed the title 0.16.0 requires $HOME to be set 1.16.0 requires $HOME to be set Mar 28, 2024
@khrisrichardson
Copy link

khrisrichardson commented Mar 28, 2024

According to git bisect:

docker run --rm -i --entrypoint bash \
  docker.io/golang:1.22.1@sha256:0b55ab82ac2a54a6f8f85ec8b943b9e470c39e32c109b766bbc1b801f3fa8d3b -s <<EOF
mkdir -p github.com/hashicorp
cd github.com/hashicorp/
git clone https://github.com/hashicorp/vault
cd vault/
git bisect start
git bisect good v1.15.6
git bisect bad v1.16.0
git bisect run bash -c "make dev; HOME='' ./bin/vault login -method=aws|& grep 'Error authenticating'"
EOF

e0216cab5b2de7463f28adb22905a895e536e003 is the first bad commit

...which ultimately boils down to an expectation to read/write a config cache with vault-hcp-lib in user home dir

@briantist
Copy link
Contributor

Also seeing this trying to start Vault agent, causing a lot of issues for us

@NelsonJeppesen
Copy link

NelsonJeppesen commented Mar 28, 2024

seeing this issue when running vault login in cloud-init user data

@medains
Copy link

medains commented Apr 2, 2024

This will affect anyone running vault agent as a systemd service

@biazmoreira biazmoreira self-assigned this Apr 2, 2024
@ccapurso ccapurso added bug Used to indicate a potential bug reproduced This issue has been reproduced by a Vault engineer labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug core/cli reproduced This issue has been reproduced by a Vault engineer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants