Search code examples
node.jsnetlify

git ref refs/heads/dashboard-angular does not exist or you do not have permission


I am getting the below error while I am trying to deploy my Angular application to Netlify from bitbucket.

These are the neatlify logs.

11:38:49 PM: Build ready to start
11:38:51 PM: build-image version: 7c49b266ed8abd833dee6036ec0a4b9ee887658a
11:38:51 PM: buildbot version: f58df58ab0bceffdcb8d1e60fec992495a2a6751
11:38:51 PM: Fetching cached dependencies
11:38:51 PM: Starting to download cache of 254.8KB
11:38:51 PM: Finished downloading cache in 129.507361ms
11:38:51 PM: Starting to extract cache
11:38:51 PM: Failed to fetch cache, continuing with build
11:38:51 PM: Starting to prepare the repo for build
11:38:52 PM: git ref refs/heads/dashboard-angular does not exist or you do not have permission
11:38:52 PM: Failing build: Failed to prepare repo
11:38:52 PM: failed during stage 'preparing repo': git ref refs/heads/dashboard-angular does not exist
11:38:52 PM: Finished processing build request in 833.373404ms

Solution

  • This usually happens because there are no permissions for Netlify to pull your source code. Netlify accesses repositories SOLELY via Deploy Key. Netlify cannot automatically install a deploy key on any git service (GitHub, GitLab or BitBucket) unless the installing/logged in user has administrative access privileges.

    After acquiring appropriate permissions and re-linking via Netlify's UI, the deploy key was successfully install and pulls in Netlify's CI worked better.

    Netlify's helpdesk can advise on workflows for cases where administrative access is not available.