Development troubleshooting¶
This guide covers common issues encountered during provider development and their solutions.
Acceptance tests¶
Sandbox permission errors¶
When running acceptance tests in a sandboxed environment (e.g., Cursor IDE), you may see errors like:
or
Cause: The sandbox restricts access to system paths like ~/Library/Caches/go-build.
Solutions:
- Run tests without sandboxing (request "all" permissions).
- Set Go cache paths inside the workspace:
Proxy configuration issues¶
If you use an HTTP proxy and see errors like:
or provider reattach failures, the issue is that Terraform tries to route localhost traffic through the proxy.
Solution: Ensure NO_PROXY includes localhost addresses:
The ./testacc script automatically adds these when proxy environment variables are set (unless you pass --no-proxy).
Stuck test VMs¶
Test VMs can get stuck if:
- They lack a boot disk (stuck in boot loop).
- They have
onboot = 1and auto-restart after being stopped. - A lock file prevents destruction.
Cleanup procedure:
SSH to the Proxmox node and run:
# List test VMs
qm list | grep test
# Disable auto-start
qm set <vmid> --onboot 0 --skiplock
# Kill the QEMU process
kill -9 $(cat /var/run/qemu-server/<vmid>.pid)
# Remove lock file
rm -f /var/lock/qemu-server/lock-<vmid>.conf
# Destroy the VM
qm destroy <vmid> --purge --skiplock
Test timeout issues¶
If tests hang or timeout, you can pass additional flags to the test runner:
Build issues¶
Linter errors¶
make lint automatically fixes formatting errors detected by gofmt, gofumpt, and goimports.
If it reports errors, most likely they require a non-trivial code change / manual fix.
Inspect the errors and fix them accordingly.
Documentation generation¶
If make docs fails or produces unexpected output, ensure you have the correct version of tfplugindocs:
Provider development¶
Changes not reflected in Terraform¶
If your code changes aren't showing up when running terraform plan:
- Rebuild and reinstall the provider:
-
Verify your
~/.terraformrc(or%APPDATA%/terraform.rcon Windows) points to the correct$GOPATH/bin. -
Check that no cached provider binary exists in
.terraform/providers/.
API debugging with mitmproxy¶
To inspect Proxmox API calls:
- Start mitmproxy:
- Configure the provider to use the proxy:
- Run your Terraform commands and inspect traffic in mitmproxy.
Warning
Never commit proxy configurations, captured traffic, or credentials to the repository.