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

Operation failed: failed generating plan JSON: failed running command (exit -1) #30548

Closed
huguesalary opened this issue Feb 18, 2022 · 6 comments · Fixed by #30561
Closed

Operation failed: failed generating plan JSON: failed running command (exit -1) #30548

huguesalary opened this issue Feb 18, 2022 · 6 comments · Fixed by #30561
Assignees
Labels
bug confirmed a Terraform Core team member has reproduced this issue v1.1 Issues (primarily bugs) reported against v1.1 releases

Comments

@huguesalary
Copy link

huguesalary commented Feb 18, 2022

Summary

Terraform plan fails with obscur message Operation failed: failed generating plan JSON: failed running command (exit -1)

Terraform Version

Terraform v1.1.6
on darwin_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.9.1
+ provider registry.terraform.io/gavinbunney/kubectl v1.13.1
+ provider registry.terraform.io/hashicorp/aws v4.1.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/github v4.20.0
+ provider registry.terraform.io/hashicorp/helm v2.1.2
+ provider registry.terraform.io/hashicorp/kubernetes v2.8.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/tls v3.1.0
+ provider registry.terraform.io/hashicorp/vault v2.20.0
+ provider registry.terraform.io/terraform-aws-modules/http v2.4.1

Terraform Configuration Files

https://github.com/huguesalary/terraform-issue/blob/main/main.tf

Debug Output

N/A

Expected Behavior

The plan should be output

Actual Behavior


[...output truncated on purpose...]

Plan: 6 to add, 0 to change, 0 to destroy.
╷
│ Warning: Resource targeting is in effect
│ 
│ You are creating a plan with the -target option, which means that the
│ result of this plan may not represent all of the changes requested by the
│ current configuration.
│ 
│ The -target option is not for routine use, and is provided only for
│ exceptional situations such as recovering from errors or mistakes, or when
│ Terraform specifically suggests to use it as part of an error message.
╵
╵
Operation failed: failed generating plan JSON: failed running command (exit -1)

image

Steps to Reproduce

  1. terraform init
  2. terraform apply -target=kubernetes_manifest.cert_manager_crds

Additional Context

I am running inside a Terraform cloud agent hosted on a Kubernetes cluster

@huguesalary huguesalary added bug new new issue not yet triaged labels Feb 18, 2022
@kmoe
Copy link
Member

kmoe commented Feb 18, 2022

Thanks for raising this. This behaviour should never happen, and this looks like a bug that we want to investigate.
The link to your config files (https://github.com/huguesalary/terraform-issue/blob/main/main.tf) does not work - please fix this so we can take a look.

@kmoe kmoe added waiting for reproduction unable to reproduce issue without further information waiting-response An issue/pull request is waiting for a response from the community and removed new new issue not yet triaged labels Feb 18, 2022
@huguesalary
Copy link
Author

huguesalary commented Feb 18, 2022

Hi @kmoe, thank you; my mistake on the repository; I just fixed it, it now public.

@alisdair
Copy link
Member

Thanks for the minimal reproduction case! I've been able to generate a plan, and confirm that terraform show -json is extremely slow. It has not yet finished executing after over an hour. This is almost definitely the cause of the issue you're seeing on Terraform Cloud, which I imagine is a timeout due to slow execution of this command.

I'm continuing to investigate this, hoping that we'll find something obvious causing this performance problem.

@alisdair alisdair added confirmed a Terraform Core team member has reproduced this issue v1.1 Issues (primarily bugs) reported against v1.1 releases and removed waiting-response An issue/pull request is waiting for a response from the community waiting for reproduction unable to reproduce issue without further information labels Feb 18, 2022
@alisdair alisdair self-assigned this Feb 18, 2022
@alisdair
Copy link
Member

The PR pending review in #30561 should fix this issue. Thanks again for reporting it!

@huguesalary
Copy link
Author

huguesalary commented Feb 22, 2022

Awesome, thanks for the quick turnaround!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug confirmed a Terraform Core team member has reproduced this issue v1.1 Issues (primarily bugs) reported against v1.1 releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants