terraform-provider-rundeck icon indicating copy to clipboard operation
terraform-provider-rundeck copied to clipboard

Unhandled API call when creating jobs on Rundeck v5.x.x

Open bzuelke opened this issue 1 year ago • 9 comments

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Terraform v1.5.7

Affected Resource(s)

Please list the resources as a list, for example: rundeck_job

Terraform Configuration Files

https://github.com/rundeck/rundeck/issues/8779

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist. https://github.com/rundeck/rundeck/issues/8779

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

Created the job without error.

Actual Behavior

What actually happened? Since upgrading to latest rundeck, rundeck provider, and api version terraform is consistently showing EOF error and not detailing anything further. It appears to create the object to some degree in the rundeck UI but consistently fails on applies only.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Rundeck version 5.0.1 rundeck api version 46

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: https://github.com/rundeck/rundeck/issues/8779 Mentioned this initially last month to the rundeck project. Opening here to get provider assistance on this.

bzuelke avatar Feb 05 '24 19:02 bzuelke

Ran the apply with a test job with trace logging and this is what shows for the resource when attempting to apply if it helps https://gist.github.com/bzuelke/cefd404bbc79b8448932b540589a3e77

bzuelke avatar Feb 06 '24 20:02 bzuelke

Hi. Same issue.

Terraform v1.7.3
on linux_amd64
...
+ provider registry.terraform.io/rundeck/rundeck v0.4.7

artyomovs avatar Feb 08 '24 11:02 artyomovs

Same issue. Is the provider still maintained? @fdevans

luis-guimaraes-exoawk avatar Feb 15 '24 11:02 luis-guimaraes-exoawk

It should still be maintained given the recent releases, yet it be slow. This is a pretty big deal being unable to natively create jobs from the provider which i hope has eyes on it at some point.

bzuelke avatar Feb 21 '24 14:02 bzuelke

As a workaround, enabling the Legacy XML API behavior seems to allow job creation by the terraform provider to succeed, in Rundeck 5.1.0-20240214.

We just set the following:

rundeck.feature.legacyXml.enabled=true

Looks like the code in this repo uses the XML API format heavily, so that will need some work to migrate to JSON.

rich-boyce avatar Feb 27 '24 12:02 rich-boyce

This is great thanks for this. I tested using Rundeck v5.0.2 and works well too. Tested and working as expected.

bzuelke avatar Feb 28 '24 15:02 bzuelke

Hello, I got the same issue too. Adding the legacyXml help for the creation of resource however I do have now an issue with the destroy part. Did you encounter it too ?

Thanks,

Zwordi avatar Apr 29 '24 11:04 Zwordi

Hello, I got the same issue too. Adding the legacyXml help for the creation of resource however I do have now an issue with the destroy part. Did you encounter it too ?

Thanks,

I've not tried to destroy anything yet. I have noticed certain parts still don't work right. a base job can build out the job and even update existing ok, some reason when i add the ansible plugin for example it will fail with the same api call error. We've halted all work on rundeck atm using terraform and started uploading jobs via the api

bzuelke avatar May 22 '24 15:05 bzuelke

Hi @bzuelke,

In my case I was able to found the issue which was at the DB level where constraints was not applied on some jobs. I manually cleaned them without issue on the impacted tables then I was able to delete them with Terraform.

Zwordi avatar May 23 '24 05:05 Zwordi

@rich-boyce's workaround of enabling the legacy XML worked for me as well, but it's scary that it is required!

smaddock avatar Sep 01 '24 01:09 smaddock

Please try on more recent versions of the 5.x series. There were some bugs in the 5.0.0 thru 5.4.0 versions.

fdevans avatar Sep 21 '24 01:09 fdevans

If this is still an issue please re-open.

fdevans avatar Sep 21 '24 01:09 fdevans

Hi, The issue still seems to be present, reproduced with: terraform v1.9.6
rundeck 5.6.0
terraform rundeck provider 0.4.9

resource "rundeck_job" "test" {
  name = "test"
  project_name = "test"
  description = ""
  command {
    shell_command = "echo 'test'"
  }
}

Error :

rundeck_job.test: Creating...
╷
│ Error: EOF
│ 
│   with rundeck_job.test,
│   on configure-jobs.tf line 1, in resource "rundeck_job" "test":
│  1: resource "rundeck_job" "test" {
│ 
╵

Adding rundeck.feature.legacyXml.enabled=true to the rundeck-config.properties file resolves the issue.

NikitaCOEUR avatar Sep 30 '24 22:09 NikitaCOEUR