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

Cannot update form after initial creation #1054

Closed
6 tasks done
tcrawford-figure opened this issue Oct 22, 2024 · 10 comments
Closed
6 tasks done

Cannot update form after initial creation #1054

tcrawford-figure opened this issue Oct 22, 2024 · 10 comments
Assignees
Labels
🪲 bug Something isn't working

Comments

@tcrawford-figure
Copy link

tcrawford-figure commented Oct 22, 2024

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this provider and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

When modifying an existing auth0_form configuration and running apply I am receiving the following error, despite making no changes to any node ids:

Error: 400 Bad Request: Some nodes point to unknown node IDs

I also want to take time to point out that documentation in this area feels lackluster. I had to piece together what I can export from the Auth0 Forms UI and pull request bodies off the Auth0 API calls in the browser for form and flow updates in order to guess at what the correct configuration would even be in the first place for forms. After getting something successful after about 10 or so tries, I found a need to modify the form that I got in and find myself here.

Expectation

When I modify an auth0_form resource without modifying the nodes I expect it to update in place. Even if the node values are updated, I expect the form to override the existing node chain.

Reproduction

Given:
I have updated a form configuration, like the coordinates for example.

When:
I apply my plan

Then:
My changes should be applied successfully.

Auth0 Terraform Provider version

1.7.1

Terraform version

1.7.5

@tcrawford-figure tcrawford-figure added the 🪲 bug Something isn't working label Oct 22, 2024
@aescudero-abbott
Copy link

I'm also facing the same issue

@msinstil
Copy link

I'm also facing the same issue, this makes the forms unusable from terraform. Please fix!!

@kushalshit27
Copy link
Contributor

Thanks for opening the issue.
Please use Terraform version 1.9.x for better support of jsonencode. If the issue persists, please share a sample auth0_form to investigate more.

@msinstil
Copy link

Thanks for opening the issue. Please use Terraform version 1.9.x for better support of jsonencode. If the issue persists, please share a sample auth0_form to investigate more.

Thanks @kushalshit27 for looking into this.

I am using Terraform v1.9.5 and Auth0 provider v1.7.1

Issue can be reproduced by taking the example form from Auth0 Provider docs (below), deploying it and then trying to add any new components to the nodes like another FIELD, BLOCK, HTML, RICH_TEXT etc.

# Example:
resource "auth0_form" "my_form" {
  name = "My KYC Form"

  start = jsonencode({
    coordinates = {
      x = 0
      y = 0
    }
    next_node = "step_ggeX"
  })
  nodes = jsonencode([{
    alias = "New step"
    config = {
      components = [{
        category = "FIELD"
        config = {
          max_length = 50
          min_length = 1
          multiline  = false
        }
        id        = "full_name"
        label     = "Your Name"
        required  = true
        sensitive = false
        type      = "TEXT"
        }, {
        category = "BLOCK"
        config = {
          text = "Continue"
        }
        id   = "next_button_3FbA"
        type = "NEXT_BUTTON"
      }]
      next_node = "$ending"
    }
    coordinates = {
      x = 500
      y = 0
    }
    id   = "step_ggeX"
    type = "STEP"
  }])
  ending = jsonencode({
    after_submit = {
      flow_id = "<my_flow_id>" # Altenative ways: (flow_id = auth0_flow.my_flow.id) or using terraform variables
    }
    coordinates = {
      x = 1250
      y = 0
    }
    resume_flow = true
  })

  style = jsonencode({
    css = "h1 {\n  color: white;\n  text-align: center;\n}"
  })

  translations = jsonencode({
    es = {
      components = {
        rich_text_uctu = {
          config = {
            content = "<h2>Help us verify your personal information</h2><p>We want to learn more about you so that we can validate and protect your account...</p>"
          }
        }
      }
      messages = {
        custom = {}
        errors = {
          ERR_ACCEPTANCE_REQUIRED = "Por favor, marca este campo para continuar."
        }
      }
    }
  })

  languages {
    default = "en"
    primary = "en"
  }
}

@GDownes
Copy link

GDownes commented Oct 28, 2024

I'm facing the same issue, having to update the name to get components updates to work

@tcrawford-figure
Copy link
Author

@duedares-rvj I noticed that 1.7.2 was attempted to be released but it looks like the release workflow had an issue during release that kept it from publishing to the terraform registry. I just wanted to make sure someone had visibility to this. Thank you!

@duedares-rvj
Copy link
Contributor

duedares-rvj commented Nov 5, 2024

@tcrawford-figure That's right. We are making some required updates to goreleaser for this, shall revert back once the publish is successful.

@duedares-rvj
Copy link
Contributor

duedares-rvj commented Nov 5, 2024

@tcrawford-figure We released https://github.com/auth0/terraform-provider-auth0/releases/tag/v1.7.3 with the required changes. :) ^_^

@tcrawford-figure
Copy link
Author

@duedares-rvj Perfect! Thank you so much!

@kushalshit27
Copy link
Contributor

The fix for this has been released in 1.7.3. Please update and advise if you have any further issue.

I would appreciate you test this out and if problem still persists, we can re-evaluate.
However I'm going to close in the meantime. Thanks for opening this ticket!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants