Home
Support Forums

Github: Permission denied - Make sure you have the correct access rights

Hi, I just tried to run a new build and have started getting the below CI error. As far as I’m aware nothing has changed with regards to the git repo I’m trying to access and I can build locally without issue.

How do I make sure you have the correct access rights in my CI?

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/jfrolich/gatsby-plugin-extract-schema.git
npm ERR! 
npm ERR! Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128
{
  "name": "posh-wash",
  "private": true,
  "description": "A simple starter to get up and developing quickly with Gatsby",
  "version": "0.1.0",
  "dependencies": {
    "@emotion/core": "^10.0.35",
    "@emotion/styled": "^10.0.27",
    "change-case": "^4.1.1",
    "dotenv": "^8.2.0",
    "emotion-theming": "^10.0.27",
    "gatsby": "^2.24.68",
    "gatsby-image": "^2.4.21",
    "gatsby-plugin-advanced-sitemap": "^1.5.6",
    "gatsby-plugin-emotion": "^4.3.13",
    "gatsby-plugin-extract-schema": "github:jfrolich/gatsby-plugin-extract-schema",
    "gatsby-plugin-gtag": "^1.0.13",
    "gatsby-plugin-manifest": "^2.4.34",
    "gatsby-plugin-offline": "^3.2.31",
    "gatsby-plugin-react-helmet": "^3.3.13",
    "gatsby-plugin-react-redux": "^1.1.0",
    "gatsby-plugin-robots-txt": "^1.5.3",
    "gatsby-plugin-sharp": "^2.6.39",
    "gatsby-source-filesystem": "^2.3.33",
    "gatsby-source-google-places": "^0.0.6",
    "gatsby-transformer-json": "^2.4.14",
    "gatsby-transformer-sharp": "^2.5.17",
    "hamburger-react": "^2.2.0",
    "normalize.css": "^8.0.1",
    "prop-types": "^15.7.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-helmet": "^6.1.0",
    "react-inlinesvg": "^2.1.1",
    "react-redux": "^7.2.1",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.8",
    "shevyjs": "^1.2.0",
    "swiper": "^6.3.2",
    "typeface-montserrat": "1.1.13",
    "typeface-orbitron": "^1.1.13",
    "uuid": "^8.3.1"
  },
  "devDependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.0.4",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.5.2",
    "babel-preset-gatsby": "^0.5.13",
    "codecov": "^3.8.0",
    "eslint": "^7.10.0",
    "eslint-config-airbnb": "^18.2.0",
    "eslint-config-prettier": "^6.12.0",
    "eslint-plugin-emotion": "^10.0.27",
    "eslint-plugin-graphql": "^4.0.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.3.1",
    "eslint-plugin-prettier": "^3.1.4",
    "eslint-plugin-react": "^7.21.3",
    "eslint-plugin-react-hooks": "^4.1.2",
    "eslint-plugin-react-redux": "^3.3.0",
    "husky": "^4.3.0",
    "identity-obj-proxy": "^3.0.0",
    "install": "^0.13.0",
    "jest": "^26.5.2",
    "jest-emotion": "^10.0.32",
    "lint-staged": "^10.4.0",
    "npm": "^6.14.8",
    "prettier": "2.1.2",
    "pretty-quick": "^3.0.2"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
    "lint": "eslint \"**/*.{js,jsx}\" --fix",
    "pretty-quick": "pretty-quick --verbose",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "clean": "gatsby clean",
    "test": "jest --collect-coverage --passWithNoTests",
    "codecov": "codecov --token='aaad771a-8d08-49a5-b4c4-92d5ffb0398a'"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.js": [
      "eslint --cache --fix",
      "pretty-quick --staged"
    ]
  },
  "jest": {
    "setupFilesAfterEnv": [
      "<rootDir>/setup-test-env.js"
    ]
  }
}

Removing github: fixed the issue

1 Like