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

404 in auth0_branding resource after upgrade to 0.38.0 #358

Closed
6 tasks done
markusbaumg opened this issue Oct 11, 2022 · 4 comments
Closed
6 tasks done

404 in auth0_branding resource after upgrade to 0.38.0 #358

markusbaumg opened this issue Oct 11, 2022 · 4 comments
Assignees
Labels

Comments

@markusbaumg
Copy link

markusbaumg commented Oct 11, 2022

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

After upgrading to 0.38.0, the state of the auth0_branding resource cannot be refreshed

Defined Resource

resource "auth0_branding" "xxx" {
  logo_url = "https://xxx.com/logo.png"
  colors {
    primary         = "#6546e8"
    page_background = "#fff"
  }
}

Issue that apears when upgrading to 0.38.0. This does not happen with 0.37.1

module.auth0.auth0_branding.xxx: Refreshing state... [id=terraform-20220908101302395600000001]
│ Error: 404 Not Found: Template does not exist.
│ 
│   with module.auth0.auth0_branding.xxx,
│   on ../modules/auth0/branding.tf line 1, in resource "auth0_branding" "xxx":
│    1: resource "auth0_branding" "xxx" {

Expectation

Terraform state can be refreshed

Reproduction

  • Define and apply resource in an older version
  • Upgrade terraform provider to 0.38.0
  • Run terraform refresh

Auth0 Terraform Provider version

v0.38.0

Terraform version

Terraform v1.3.2

@markusbaumg markusbaumg added the 🪲 bug Something isn't working label Oct 11, 2022
@sergiught
Copy link
Contributor

sergiught commented Oct 11, 2022

Hey @markusbaumg 👋🏻 ,

I tried to reproduce the issue you're experiencing however I am unable to. In the latest release we also haven't modified the schema of the branding resource.

$ terraform refresh
$ echo $?                                                                        ✔  14:18:41
0

I tried as well to downgrade from 0.38.0 to 0.37.1 and I'm still not experiencing any issues. The state structure stays the same.

What happens if you try to reimport the resource? (https://registry.terraform.io/providers/auth0/auth0/latest/docs/resources/branding#import)

Edit:

I was able to take a deeper look at this inspecting the code changes between 0.37.1 and 0.38.0 and there's a 404 ignore that got removed when reading the https://auth0.com/docs/api/management/v2#!/Branding/get_universal_login. I'll prepare a fix for this!

Apologies for the inconvenience! @markusbaumg 😞

As a quick workaround you could set the https://auth0.com/docs/api/management/v2#!/Branding/put_universal_login temporarily e.g.

resource "auth0_branding" "my_brand" {
	logo_url = "https://mycompany.org/v2/logo.png"
	favicon_url = "https://mycompany.org/favicon.ico"

	colors {
		primary = "#0059d6"
		page_background = "#000000"
	}

	font {
		url = "https://mycompany.org/font/myfont.ttf"
	}

	universal_login {
		body = "<!DOCTYPE html><html><head>{%- auth0:head -%}</head><body>{%- auth0:widget -%}</body></html>"
	}
}

Thanks for reporting this!

@markusbaumg
Copy link
Author

Hey @sergiught

Thank you for investigating this and for the workaround! I'll stick to 0.37.1 for now.

@mswezey23
Copy link

I hit this error today as well. Looking forward to the fix being released :)

@sergiught
Copy link
Contributor

Hey folks, we just released https://registry.terraform.io/providers/auth0/auth0/0.39.0 with a fix for this. We'll close the issue down now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants