Joe Einertson
10/02/2025, 5:03 PM│ Error: Error creating project
│
│ with module.employer_portal.descope_project.employer_portal,
│ on modules/employer-portal/main.tf line 186, in resource "descope_project" "employer_portal":
│ 186: resource "descope_project" "employer_portal" {
│
│ [E113009] Failed to write entity data [Status-Code:500]
Even with an empty styles config, which matches the test case in the Terraform repository:
{
"componentsVersion": "2.0.291",
"references": {},
"styles": {
"dark": {},
"light": {}
}
}
Since this is a 500, seems like it may be something on the Descope side? Any way to debug this further?Meir Wahnon
10/02/2025, 5:04 PMJoe Einertson
10/02/2025, 5:06 PMterraform apply and it doesn't show that detailed request/response info that I can seeMeir Wahnon
10/02/2025, 5:09 PMMeir Wahnon
10/02/2025, 5:10 PMRequest is malformed: Duplicate custom hostname found.Meir Wahnon
10/02/2025, 5:11 PMNick Rodriguez
10/02/2025, 5:15 PMexport TF_LOG=DEBUG
export TF_LOG_PATH=terraform.log
terraform apply
Which should log the headers/payloads in a file named terraform.logJoe Einertson
10/02/2025, 5:32 PMJoe Einertson
10/02/2025, 5:33 PMJoe Einertson
10/02/2025, 8:00 PMNick Rodriguez
10/02/2025, 8:06 PMIgor Miltchman
10/07/2025, 2:24 PMNick Rodriguez
10/07/2025, 4:12 PMIgor Miltchman
10/07/2025, 4:32 PMstyles = {
data = jsonencode({
styles = {
custom-sso-dark = {
"name" = "custom-sso-dark",
"type" = "ssoSuite"
globals = {
fonts = {
family = [
...
but got:
[E113009] Failed to write entity data [Status-Code:500]Joe Einertson
10/07/2025, 8:24 PMstyles = {
data = jsonencode({
componentsVersion = "2.1.3"
references = {}
styles = {
light = jsondecode(file("${path.module}/styles/light.json"))
dark = jsondecode(file("${path.module}/styles/dark.json"))
}
})
}
We didn't want to mess with translating all the JSON to Terraform so we just kept it as JSONGil Shapira
10/08/2025, 3:25 PM.tf files is to export the theme from the Descope console and reference it in your .tf file.
• Go to to this page in the Descope console: https://app.descope.com/styles
• Export the themes.json file by clicking on the little up/down arrows (see screenshot).
• Put the downloaded themes.json file somewhere next to your .tf file (or in a subdirectory).
• Use data = file("themes.json") in your .tf file to incorporate it into your Terraform plan (or whatever path you used above).
This should work properly and ensure you've sending the styles in the correct format.
(sidenote: the terraform tool is usually smart enough to recognize that file actually JSON rather than simple text, and it behaves as if you used jsonencode, so you get a decent diff when there are .tfstate changes)
Please let me know if this is still not working well enough for your use case or if you think we should improve something here.