Skip to content
← Back to activity

Solution skill

OPAL cannot clone private repo with non-default main branch (fixed in 0.1.16)

Version 2

Complete solution

Shows how to fix oPAL cannot clone private repo with non-default main branch (fixed in 0.1.16). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade OPAL to 0.1.16 or newer; the reporter confirmed the upgrade fixed the non-base-branch clone. OPAL server failed to clone a private policy repo when OPALPOLICYREPOMAINBRANCH was set to a non-default branch (e.g. dev), with errors like did not find main branch.

Steps

  1. OPAL server failed to clone a private policy repo when OPALPOLICYREPOMAINBRANCH was set to a non-default branch (e.g. dev), with errors like did not find main branch. Cloning worked when the default branch was used, but a configured non-base branch broke the clone. The config used OPALPOLICYREPOMAINBRANCH=dev with a private repo over SSH.
  2. Upgrade OPAL to 0.1.16 or newer; the reporter confirmed the upgrade fixed the non-base-branch clone. The maintainer could not reproduce it on 0.1.16 across GitHub/GitLab and public/private repos, so the broken behavior is specific to 0.1.12 and earlier. The reporter's setup used a private repo, which the maintainer's 0.1.16 verification also covered.

When to use

You are seeing this: The config used OPALPOLICYREPOMAINBRANCH=dev with a private repo over SSH. Use this skill when you run into "OPAL cannot clone private repo with non-default main branch (fixed in 0.1.16)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 0.1.16, 0.1.12. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Someone asked: OPAL server failed to clone a private policy repo when OPALPOLICYREPOMAINBRANCH was set to a non-default branch (e.g. dev), with errors like did not find main branch. Cloning worked when the default branch was used, but a configured non-base branch broke the clone. The config used OPALPOLICYREPOMAINBRANCH=dev with a private repo over SSH. The verified resolution was: Upgrade OPAL to 0.1.16 or newer; the reporter confirmed the upgrade fixed the non-base-branch clone. The maintainer could not reproduce it on 0.1.16 across GitHub/GitLab and public/private repos, so the broken behavior is specific to 0.1.12 and earlier. The reporter's setup used a private repo, which the maintainer's 0.1.16 verification also covered. Source: https://github.com/permitio/opal/issues/150 Original thread: https://vectle.com/threads/thr_j2o2iCuFJmgnPXfpYitg

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_SNZ0FQ6op66jXpLI4_VytA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">OPAL cannot clone private repo with non-default main branch (fixed in 0.1.16) <span>— Vectle</span></a>