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

PATCH status page returned 422: Sorry, these attributes have unsupported values" #76

Open
landsman opened this issue Apr 4, 2024 · 3 comments

Comments

@landsman
Copy link

landsman commented Apr 4, 2024

I successfuly created resources in Uptime but I am not able to do any updates.
Please tell me what am I missing here.

Required fields are filled out. It would help me to actually see what "unsupported values" and attributes are sent in the PATCH request to let me debug it.

Related: #75

Error

│ Error: PATCH https://betteruptime.com/api/v2/status-pages/184479 returned 422: {"errors":"Sorry, these attributes have unsupported values","allowed_values":{"layout":["vertical","horizontal"]}}
│
│   with module.uptime.betteruptime_status_page.this,
│   on ../modules/better-stack-uptime/main.tf line 7, in resource "betteruptime_status_page" "this":7: resource "betteruptime_status_page" "this" {
│

Code

provider "betteruptime" {
  api_token = var.api_token
}

### status page ###

resource "betteruptime_status_page" "this" {
  company_name = "Company"
  company_url  = var.domain
  contact_url  = "mailto:[email protected]"
  timezone     = "Europe/Prague"
  subdomain    = "company-dev"
}

resource "betteruptime_status_page_section" "monitors" {
  status_page_id = betteruptime_status_page.this.id
  name           = "App"
  position       = 0
}

### monitors ###

resource "betteruptime_monitor" "app_onboarding" {
  url          = "${var.domain}/start"
  monitor_type = "status"
}

resource "betteruptime_monitor" "app_profile" {
  url          = "${var.domain}/landsman"
  monitor_type = "status"
}

resource "betteruptime_monitor" "app_profile_wall" {
  url          = "${var.domain}/landsman/wall"
  monitor_type = "status"
}

resource "betteruptime_monitor" "app_profile_stats" {
  url          = "${var.domain}/landsman/stats"
  monitor_type = "status"
}

resource "betteruptime_monitor" "app_profile_bio" {
  url          = "${var.domain}/landsman/bio"
  monitor_type = "status"
}

### link monitors to status page ###

resource "betteruptime_status_page_resource" "app_onboarding" {
  status_page_id = betteruptime_status_page.this.id
  resource_id    = betteruptime_monitor.app_onboarding.id
  resource_type  = "Monitor"
  public_name    = "onboarding"
}

resource "betteruptime_status_page_resource" "app_profile" {
  status_page_id = betteruptime_status_page.this.id
  resource_id    = betteruptime_monitor.app_profile.id
  resource_type  = "Monitor"
  public_name    = "profile index"
}

resource "betteruptime_status_page_resource" "app_profile_wall" {
  status_page_id = betteruptime_status_page.this.id
  resource_id    = betteruptime_monitor.app_profile_wall.id
  resource_type  = "Monitor"
  public_name    = "profile wall"
}

resource "betteruptime_status_page_resource" "app_profile_stats" {
  status_page_id = betteruptime_status_page.this.id
  resource_id    = betteruptime_monitor.app_profile_stats.id
  resource_type  = "Monitor"
  public_name    = "profile stats"
}

resource "betteruptime_status_page_resource" "app_profile_bio" {
  status_page_id = betteruptime_status_page.this.id
  resource_id    = betteruptime_monitor.app_profile_bio.id
  resource_type  = "Monitor"
  public_name    = "profile bio"
}
@MartinBjerknes
Copy link

If you set a value for betteruptime_status_page.layout then the error will go away.
If you look at your tf plan output you'll probably see that it plans to change betteruptime_status_page.layout from vertical -> null.

Same goes for some other properties:

  • design
  • theme
  • announcement_embed_visible

@landsman
Copy link
Author

landsman commented Apr 8, 2024

@MartinBjerknes But these are not flag as required fields in the doc.

@MartinBjerknes
Copy link

@landsman Yeah, but it works as a work around until BetterStack gets around to addressing the issue.

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

No branches or pull requests

2 participants