Bug description
When running terraform apply with terraform-provider-forgejo v1.5.0, repository update fails with:
Error: Unable to update repository
Unknown error (status 500):
From TRACE logs, provider sends wiki_branch="" while has_wiki=false in Update repository, and Forgejo responds with HTTP 500.
This appears after upgrading Terraform to versions later than 1.4.2 (currently reproduced on 1.14.9).
Versions
- Terraform:
1.14.9 (fails)
- terraform-provider-forgejo:
v1.5.0
- Forgejo:
15.0.3
- OS: Linux
(Older Terraform 1.4.2 did not show this behavior in our setup.)
Reproduction
Minimal resource shape
resource "forgejo_repository" "this" {
owner = "it-devops"
name = "webshop"
default_branch = "main"
has_wiki = false
archived = true
has_issues = true
has_actions = true
has_projects = false
external_tracker = {
external_tracker_url = "https://jira.schmalz.com"
external_tracker_format = "https://jira.schmalz.com/browse/{index}"
external_tracker_style = "alphanumeric"
}
}
Command
TF_LOG=TRACE TF_LOG_PROVIDER=TRACE TF_LOG_PATH=forgejo-webshop.log \
terraform apply -var-file=terraform.tfvars -target='forgejo_repository.this["webshop"]'
Actual behavior
Apply fails with:
Error: Unable to update repository
Unknown error (status 500):
TRACE snippet (same request context):
[INFO] Update repository: ... has_wiki=false ... wiki_branch="" ... status="500 Internal Server Error"
[ERROR] Response contains error diagnostic: "Unknown error (status 500): "
Expected behavior
- Provider should not fail with 500 during update.
- If has_wiki=false, provider should avoid sending invalid/empty wiki-specific values (wiki_branch="") or otherwise normalize request payload so Forgejo accepts it.
- Ideally this should be a no-op update when no meaningful config changes are required.
Additional notes
In plan output, many optional fields are newly appearing and forcing in-place update, including:
- wiki_branch = ""
- default_update_style = "merge"
- allow_rebase_update = true
- allow_fast_forward_only_merge = false
- default_allow_maintainer_edit = false
- default_delete_branch_after_merge = false
The consistent failing signal in logs is has_wiki=false + wiki_branch="" followed by HTTP 500.
Bug description
When running
terraform applywithterraform-provider-forgejo v1.5.0, repository update fails with:Error: Unable to update repositoryUnknown error (status 500):From TRACE logs, provider sends
wiki_branch=""whilehas_wiki=falseinUpdate repository, and Forgejo responds with HTTP 500.This appears after upgrading Terraform to versions later than
1.4.2(currently reproduced on1.14.9).Versions
1.14.9(fails)v1.5.015.0.3(Older Terraform
1.4.2did not show this behavior in our setup.)Reproduction
Minimal resource shape