Why is Codemagic returning a 404 error when accessing my GitLab repository branches?

Last updated: September 1, 2026

Context

When connecting a GitLab repository to Codemagic, you may encounter a situation where Codemagic returns a 404 error when attempting to access your GitLab repository branches — even after successfully selecting and saving the repository in the repository picker. This can appear to be a credential or OAuth binding issue within Codemagic.

Answer

Before assuming the issue is related to Codemagic's GitLab OAuth integration or app-level credentials, check your network and IP access settings on the GitLab side. A 404 error from the GitLab branches endpoint can be caused by IP restrictions or network-level access controls that block Codemagic's servers from reaching your GitLab project — even if your personal account has valid access and the repository exists.

To troubleshoot this issue, consider the following steps:

  1. Verify that the GitLab project is accessible and that your account has the appropriate permissions (e.g., Owner or Maintainer access).

  2. Check if your GitLab instance or group has IP allowlist restrictions configured. If so, ensure that Codemagic's IP addresses are included in the allowlist.

  3. Review any network-level firewall or VPN settings that may be restricting external access to your GitLab project.

  4. Once network/IP access is confirmed to be open, re-attempt to connect the repository in Codemagic and verify that branch fetching works correctly.

If after checking network and IP settings the issue persists, please reach out to Codemagic support for further assistance.