Abe Clark
08/16/2025, 7:11 AMCannot activate repository due to invalid status.
I'm unsure what to change to make it valid. Tried on the main repo for the project as well as a new blank repo with a single commit.
It mentioned somewhere about not having 2fa enabled. I do have that enabled on my account, but I don't think it applies to the deploy hooksAsk Inkeep
08/16/2025, 7:11 AMAsk Inkeep
08/16/2025, 7:11 AMpermit/generated/<env_id> .
2FA and Deploy Keys
Regarding your 2FA concern - the documentation specifically states that deploy keys should be set up *without Two-Factor Authentication (2FA) * to allow the Permit server unrestricted read and write access to your repository . While 2FA on your account doesn't directly affect deploy keys, this requirement suggests ensuring the deploy key has unimpeded access.
Activation Steps
The activation process requires two separate API calls :
1. First, the POST request to configure the repository:
curl -X POST "<https://api.permit.io/v2/projects/<your-project-id-or-key>/repos>" -H "Content-Type: application/json" -H "Authorization: Bearer {API_KEY from step 4}" --data-binary @"path/to/your/json"
2. Then, after validating the policy branches exist, the PUT request to activate:
curl -X PUT "<https://api.permit.io/v2/projects/<your-project-id-or-key>/repos/<your-repo-id-or-key>/activate>" -H "Authorization: Bearer <your-permit-api-key>"
Common Issues to Check
1. *Branch Creation*: Verify that the permit/generated/<env_id> branches were created in your repository after the initial POST request
2. *SSH Key Format*: Ensure your private key uses proper newline replacement with \n using: awk -v ORS='\\n' '1' <private-key-file>
3. *Deploy Key Permissions*: Confirm the deploy key has "Allow write access" toggled on in GitHub
4. *Repository State*: The repository needs a default branch with at least one commit on the remote
Try checking your repository for the generated branches first. If they don't exist, the initial configuration may have failed, preventing activation.Ask Inkeep
08/16/2025, 7:12 AMAbe Clark
08/16/2025, 7:12 AMAsk Inkeep
08/16/2025, 7:12 AMAsk Inkeep
08/16/2025, 7:13 AMawk -v ORS='\\n' '1' <private-key-file>
2. *JSON Configuration Structure*: Verify your JSON file has the correct structure :
{
"url": "<your-ssh-url>",
"main_branch_name": "<your-default-branch>",
"credentials": {
"auth_type": "ssh",
"username": "git",
"private_key": "<your-private-key>"
},
"key": "<your-custom-id-string-without-spaces>"
}
3. *Repository Requirements*:
• The repository needs at least one file committed when using GitOps with a brand-new Git repository that has no commits on the main branch (2)
• The repository main branch must be present in the remote (1)
*API Response Debugging*
Check the response from your initial POST request - it should return a PolicyRepoRead object if successful (3) (4) . Any 422 error would indicate validation issues with your configuration (3) .
*Related Known Issues*
There's a documented case where OPAL failed to checkout a repository due to configuration issues with wrong URL, key, or protocol (5) . The error "policy repo was not found" can occur when OPAL tries checking out your repository and fails .
Try running the POST request again and capture the full response to see if there are specific error details about why the repository configuration isn't being accepted.Ask Inkeep
08/16/2025, 7:13 AMAbe Clark
08/16/2025, 7:16 AM"status":"pending" from the intial call, but the second one fails:
{
"id": "5d25e34283d6447590171ce6ef1e9527",
"title": "The request was invalid",
"error_code": "INVALID_POLICY_REPO_STATUS",
"message": "Your policy repo haven't changed, you have tried to activate policy repo with status 'invalid' which is illegal. Please verify that the Policy Repo status is valid.\nIf the Policy Repo is valid, contact our support on Slack for further guidance."
}Abe Clark
08/16/2025, 7:16 AMAsk Inkeep
08/16/2025, 7:16 AMAsk Inkeep
08/16/2025, 7:16 AMinvalid rather than valid. According to the SDK documentation, a PolicyRepoStatus can have three states (1) :
"invalid",
"pending",
"valid",
Your repository went from pending to invalid, which means the validation failed. The repository is created with status 'pending' and will only change to 'valid' after successful validation (2) (3) .
Since you're experiencing issues with repository validation and the branches weren't created, here's what our engineers need to investigate:
1. *Which Workspace / Project / Env are you using?* (Please provide the specific IDs or keys)
2. *What exact API calls are you making?* (Share the full CURL commands with parameters, excluding sensitive tokens)
3. *Which PDP version are you running?* (If you have a PDP deployed)
4. *Can you share relevant logs?* Particularly any error messages from when the repository validation fails
The invalid status indicates the system couldn't successfully connect to or validate your repository. Common causes include SSH key issues, repository access problems, or branch creation failures.Ask Inkeep
08/16/2025, 7:16 AMOr Weis
08/16/2025, 10:58 AMOr Weis
08/16/2025, 10:58 AMAsk Inkeep
08/16/2025, 10:59 AMAsk Inkeep
08/16/2025, 10:59 AMAbe Clark
08/18/2025, 3:53 AMpermit gitops create github
GitOps Configuration Wizard - GitHub
Your GitOps is configured successfully and
will be activated once validated
never returned. No new branches pushed.Permit Support Automation
08/18/2025, 3:53 AMOr Weis
08/18/2025, 5:08 AM