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
I've just included the relevant Debug output where the error occurs:
2021-03-25T19:38:14.181Z [DEBUG] plugin.terraform-provider-nomad_v1.4.13_x4: 2021/03/25 19:38:14 error parsing old jobspec
2021-03-25T19:38:14.181Z [DEBUG] plugin.terraform-provider-nomad_v1.4.13_x4: 2021/03/25 19:38:14 <nil>
2021-03-25T19:38:14.181Z [DEBUG] plugin.terraform-provider-nomad_v1.4.13_x4: 2021/03/25 19:38:14 'job' stanza not found
2021/03/25 19:38:15 [DEBUG] nomad_job.test: apply errored, but we're indicating that via the Error pointer rather than returning it: error applying jobspec: invalid character '<' looking for beginning of value
2021/03/25 19:38:15 [ERROR] eval: *terraform.EvalApplyPost, err: error applying jobspec: invalid character '<' looking for beginning of value
2021/03/25 19:38:15 [ERROR] eval: *terraform.EvalSequence, err: error applying jobspec: invalid character '<' looking for beginning of value
Expected Behavior
The nomad job should be placed and run on the cluster
Actual Behavior
The nomad job is net new and it appears this is causing the "old jobspec" check to fail because there is no old jobspec. This code used to work but I did see around 2 months ago, https://github.com/hashicorp/terraform-provider-nomad/blob/main/nomad/resource_job.go#L873 was added to check the old jobspec. I think this is causing issues since my nomad_job did not exist before in my TF state. I did try adding the job manually into Nomad and then letting the Nomad provider try to take over but the state seems to need to already be stored in Terraform for nomad_job to work.
Steps to Reproduce
I included a minimal Nomad configuration, with a minimal example job found in the docs. Then, simply run terraform apply and the issue will appear - though you will need TF_LOG=DEBUG to actually see the useful error messages.
The text was updated successfully, but these errors were encountered:
I am going to close this issue for now, as I think the error message I am getting is actually unrelated to the jobspec, but instead an issue with the fact that my server is behind a proxy which requires header authentication, which is currently not possible with the Nomad provider. I would love to see #203 merged to verify, and will re-open the issue after if the issue still exists.
Terraform Version
v0.14.9
Nomad Version
v1.0.3
Provider Configuration
Which values are you setting in the provider configuration?
Environment Variables
Do you have any Nomad specific environment variable set in the machine running Terraform?
NOMAD_TOKEN
NOMAD_ADDR
NOMAD_REGION
Affected Resource(s)
Terraform Configuration Files
Debug Output
I've just included the relevant Debug output where the error occurs:
Expected Behavior
The nomad job should be placed and run on the cluster
Actual Behavior
The nomad job is net new and it appears this is causing the "old jobspec" check to fail because there is no old jobspec. This code used to work but I did see around 2 months ago, https://github.com/hashicorp/terraform-provider-nomad/blob/main/nomad/resource_job.go#L873 was added to check the old jobspec. I think this is causing issues since my nomad_job did not exist before in my TF state. I did try adding the job manually into Nomad and then letting the Nomad provider try to take over but the state seems to need to already be stored in Terraform for
nomad_job
to work.Steps to Reproduce
I included a minimal Nomad configuration, with a minimal example job found in the docs. Then, simply run
terraform apply
and the issue will appear - though you will need TF_LOG=DEBUG to actually see the useful error messages.The text was updated successfully, but these errors were encountered: