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

expected element type <org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl> but have <html>

Open bootswithdefer opened this issue 3 years ago • 3 comments

Getting expected element type <org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl> but have <html> when attempting to apply secret text. Also happens with username but for com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl . Jenkins 2.303.3, Credentials plugin 2.6.1

Code:

resource "jenkins_credential_secret_text" "slack_token" {
  name        = "test"
  description = "test"
  secret      = "super-secret"
}

Version:

Terraform v1.0.11
on linux_amd64
+ provider registry.terraform.io/taiidani/jenkins v0.9.0
$ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following
symbols:
  + create

Terraform will perform the following actions:

  # module.jenkins-test.jenkins_credential_secret_text.slack_token will be created
  + resource "jenkins_credential_secret_text" "slack_token" {
      + description = "test"
      + domain      = "_"
      + id          = (known after apply)
      + name        = "test"
      + scope       = "GLOBAL"
      + secret      = (sensitive value)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions in workspace "sandbox"?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.jenkins-test.jenkins_credential_secret_text.slack_token: Creating...
╷
│ Error: Could not read secret text credentials: expected element type <org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl> but have <html>
│ 
│   with module.jenkins-test.jenkins_credential_secret_text.slack_token,
│   on jenkins-instance-config/main.tf line 10, in resource "jenkins_credential_secret_text" "slack_token":
│   10: resource "jenkins_credential_secret_text" "slack_token" {
│ 
╵

bootswithdefer avatar Nov 16 '21 16:11 bootswithdefer

Stale issue message

github-actions[bot] avatar Jan 16 '22 09:01 github-actions[bot]

I feel like this may be a leaky abstraction from the underlying https://github.com/bndr/gojenkins library. Currently unable to reproduce. Are you able to reproduce it using the Dockerized Jenkins instance in example/?

taiidani avatar Mar 20 '22 19:03 taiidani

Stale issue message

github-actions[bot] avatar Sep 17 '22 09:09 github-actions[bot]