Why am I getting a GitHub app uninstalled error when creating a stack?
Last updated: September 9, 2025
Context
When creating a stack to manage other stacks, you may encounter an error during the run phase stating "Error: could not create stack: stack has 1 error: source: could not get branch head commit: the Spacelift GitHub app has been uninstalled from your account". This can occur even when the GitHub app appears to be properly installed and other projects are working correctly.
Answer
This error typically occurs when the GitHub Enterprise namespace is not properly configured in your stack settings. To resolve this issue:
Add the github_enterprise configuration block to your stack configuration:
github_enterprise { namespace = "YourOrganizationName" }Replace "YourOrganizationName" with your actual GitHub organization name
Save and rerun the stack
While the error message suggests that the GitHub app is uninstalled, it's actually indicating a namespace configuration issue. The error can be misleading as it doesn't specifically point to the missing namespace configuration as the root cause.
If you continue to experience issues after adding the namespace configuration, verify that you have the appropriate permissions in your GitHub organization and that the GitHub app is properly installed.