You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
➜ TF_LOG=trace opentf login app.terraform.io
2023-09-19T16:01:56.760+0300 [INFO] OpenTF version: 1.6.0 dev
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/hashicorp/go-tfe v1.32.0
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/hashicorp/hcl/v2 v2.17.0
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/zclconf/go-cty v1.13.2
2023-09-19T16:01:56.760+0300 [INFO] Go runtime version: go1.21.1
2023-09-19T16:01:56.760+0300 [INFO] CLI args: []string{"opentf", "login", "app.terraform.io"}
2023-09-19T16:01:56.760+0300 [INFO] This build of OpenTF allows using experimental features
2023-09-19T16:01:56.761+0300 [TRACE] Stdout is a terminal of width 94
2023-09-19T16:01:56.761+0300 [TRACE] Stderr is a terminal of width 94
2023-09-19T16:01:56.761+0300 [TRACE] Stdin is a terminal
2023-09-19T16:01:56.761+0300 [DEBUG] Attempting to open CLI config file: /Users/mermoldy/.opentfrc
2023-09-19T16:01:56.761+0300 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory /Users/mermoldy/.terraform.d/plugins
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory /Users/mermoldy/Library/Application Support/io.terraform/plugins
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2023-09-19T16:01:56.761+0300 [INFO] CLI command args: []string{"login", "app.terraform.io"}
2023-09-19T16:01:56.762+0300 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
OpenTF will request an API token for app.terraform.io using your browser.
If login is successful, OpenTF will store the token in plain text in
the following file for use by subsequent commands:
/Users/mermoldy/.terraform.d/credentials.tfrc.json
2023-09-19T16:01:57.388+0300 [DEBUG] command: asking for input: "Do you want to proceed?"
Do you want to proceed?
Only 'yes' will be accepted to confirm.
Enter a value: yes
OpenTF must now open a web browser to the tokens page for app.terraform.io.
Generate a token using your browser, and copy-paste it into this prompt.
OpenTF will store the token in plain text in the following file
for use by subsequent commands:
/Users/mermoldy/.terraform.d/credentials.tfrc.json
2023-09-19T16:02:02.043+0300 [DEBUG] command: asking for input: "Token for app.terraform.io:"
Token for app.terraform.io:
Enter a value:
Retrieved token for user mermoldy
╷
│ Error: Failed to save API token
│
│ The given host returned an API token, but OpenTF failed to save it: cannot create temporary
│ file to update credentials: open
│ /Users/mermoldy/.terraform.d/credentials.tfrc.json1252058916: no such file or directory.
Expected Behavior
The opentf creating the temporary file without errors.
Actual Behavior
│ Error: Failed to save API token
│
│ The given host returned an API token, but OpenTF failed to save it: cannot create temporary
│ file to update credentials: open
│ /Users/mermoldy/.terraform.d/credentials.tfrc.json1252058916: no such file or directory.
Steps to Reproduce
remove ~/.terraform.d/
run opentf login workflow
Additional Context
The problem arises when the ~/.terraform.d directory is missing.
Previously, ~/.terraform.d was created by the checkpoint service, which has been removed from OpenTF. The same behavior can be reproduced in Terraform by running it with CHECKPOINT_DISABLE=1. However, it's generally expected that a cli tool should create its own configuration directory by itself.
I can open a PR if this issue gets accepted.
References
No response
The text was updated successfully, but these errors were encountered:
mermoldy
added
bug
Something isn't working
pending-decision
This issue has not been accepted for implementation nor rejected. It's still open to discussion.
labels
Sep 19, 2023
Yantrio
added
accepted
This issue has been accepted for implementation.
and removed
pending-decision
This issue has not been accepted for implementation nor rejected. It's still open to discussion.
labels
Sep 19, 2023
OpenTF Version
OpenTF Configuration Files
any configuration
Debug Output
➜ TF_LOG=trace opentf login app.terraform.io
2023-09-19T16:01:56.760+0300 [INFO] OpenTF version: 1.6.0 dev
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/hashicorp/go-tfe v1.32.0
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/hashicorp/hcl/v2 v2.17.0
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2023-09-19T16:01:56.760+0300 [DEBUG] using github.com/zclconf/go-cty v1.13.2
2023-09-19T16:01:56.760+0300 [INFO] Go runtime version: go1.21.1
2023-09-19T16:01:56.760+0300 [INFO] CLI args: []string{"opentf", "login", "app.terraform.io"}
2023-09-19T16:01:56.760+0300 [INFO] This build of OpenTF allows using experimental features
2023-09-19T16:01:56.761+0300 [TRACE] Stdout is a terminal of width 94
2023-09-19T16:01:56.761+0300 [TRACE] Stderr is a terminal of width 94
2023-09-19T16:01:56.761+0300 [TRACE] Stdin is a terminal
2023-09-19T16:01:56.761+0300 [DEBUG] Attempting to open CLI config file: /Users/mermoldy/.opentfrc
2023-09-19T16:01:56.761+0300 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory /Users/mermoldy/.terraform.d/plugins
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory /Users/mermoldy/Library/Application Support/io.terraform/plugins
2023-09-19T16:01:56.761+0300 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2023-09-19T16:01:56.761+0300 [INFO] CLI command args: []string{"login", "app.terraform.io"}
2023-09-19T16:01:56.762+0300 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
OpenTF will request an API token for app.terraform.io using your browser.
If login is successful, OpenTF will store the token in plain text in
the following file for use by subsequent commands:
/Users/mermoldy/.terraform.d/credentials.tfrc.json
2023-09-19T16:01:57.388+0300 [DEBUG] command: asking for input: "Do you want to proceed?"
Do you want to proceed?
Only 'yes' will be accepted to confirm.
Enter a value: yes
OpenTF must now open a web browser to the tokens page for app.terraform.io.
If a browser does not open this automatically, open the following URL to proceed:
https://app.terraform.io/app/settings/tokens?source=terraform-login
Generate a token using your browser, and copy-paste it into this prompt.
OpenTF will store the token in plain text in the following file
for use by subsequent commands:
/Users/mermoldy/.terraform.d/credentials.tfrc.json
2023-09-19T16:02:02.043+0300 [DEBUG] command: asking for input: "Token for app.terraform.io:"
Token for app.terraform.io:
Enter a value:
Retrieved token for user mermoldy
╷
│ Error: Failed to save API token
│
│ The given host returned an API token, but OpenTF failed to save it: cannot create temporary
│ file to update credentials: open
│ /Users/mermoldy/.terraform.d/credentials.tfrc.json1252058916: no such file or directory.
Expected Behavior
The opentf creating the temporary file without errors.
Actual Behavior
│ Error: Failed to save API token
│
│ The given host returned an API token, but OpenTF failed to save it: cannot create temporary
│ file to update credentials: open
│ /Users/mermoldy/.terraform.d/credentials.tfrc.json1252058916: no such file or directory.
Steps to Reproduce
opentf login
workflowAdditional Context
The problem arises when the
~/.terraform.d
directory is missing.Previously,
~/.terraform.d
was created by the checkpoint service, which has been removed from OpenTF. The same behavior can be reproduced in Terraform by running it withCHECKPOINT_DISABLE=1
. However, it's generally expected that a cli tool should create its own configuration directory by itself.I can open a PR if this issue gets accepted.
References
No response
The text was updated successfully, but these errors were encountered: