Search code examples
node.jsgithubgithub-apirenovate

Renovate Dependency bot cannot find repos


I'm trying to get renovate bot setup using the CLI so that I can play around with the config file before setting up it up to run in a docker container.

I've created a private test repository in GitHub containing a simple "hello world" project that has a few outdated dependencies. When I run npx renovate I get the error "Repository is not found". A detailed error log is given below.

My config.js file looks like this

const dotenv = require('dotenv').config()

module.exports = {
  token: process.env.GITHUB_ACCESS_TOKEN,
  hostRules: [{'domainName': 'github.com', 'token': process.env.GITHUB_ACCESS_TOKEN}],
  endpoint: 'https://api.github.com',
  gitAuthor: 'jacob-jameson <[email protected]>',
  platform: 'github',
  autodiscover: 'false',
  repositories: ['jacob-jameson/Renovate_SelfHosted']
};

My package.json looks like this

{
  "name": "renovate_selfhosted",
  "version": "1.0.0",
  "description": "Simple Node.js project to test self-hosted Renovate dependency bot",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Jacob Jameson",
  "license": "ISC",
  "dependencies": {
    "dotenv": "^16.0.0",
    "express": "^4.0.0",
    "renovate": "^34.154.6"
  }
}

And the debug level console log given is:

DEBUG: Using RE2 as regex engine
DEBUG: Parsing configs
DEBUG: Checking for config file in C:\Dev\Renovate_SelfHosted/config.js
 WARN: Config needs migrating
       "originalConfig": {
         "token": "***********",
         "hostRules": [{"domainName": "github.com", "token": "***********"}],
         "endpoint": "https://api.github.com",
         "gitAuthor": "Jacob Jameson <[email protected]>",
         "platform": "github",
         "autodiscover": "false",
         "repositories": ["jacob-jameson/Renovate_SelfHosted"]
       },
       "migratedConfig": {
         "token": "***********",
         "hostRules": [{"matchHost": "github.com", "token": "***********"}],
         "endpoint": "https://api.github.com",
         "gitAuthor": "Jacob Jameson <[email protected]>",
         "platform": "github",
         "autodiscover": false,
         "repositories": ["jacob-jameson/Renovate_SelfHosted"]
       }
DEBUG: File config
       "config": {
         "token": "***********",
         "hostRules": [{"matchHost": "github.com", "token": "***********"}],
         "endpoint": "https://api.github.com",
         "gitAuthor": "Jacob Jameson <[email protected]>",
         "platform": "github",
         "autodiscover": false,
         "repositories": ["jacob-jameson/Renovate_SelfHosted"]
       }
DEBUG: CLI config
       "config": {}
DEBUG: Env config
       "config": {"hostRules": []}
DEBUG: Combined config
       "config": {
         "token": "***********",
         "hostRules": [{"matchHost": "github.com", "token": "***********"}],
         "endpoint": "https://api.github.com",
         "gitAuthor": "Jacob Jameson <[email protected]>",
         "platform": "github",
         "autodiscover": false,
         "repositories": ["jacob-jameson/Renovate_SelfHosted"]
       }
DEBUG: Adding trailing slash to endpoint
DEBUG: Found valid git version: 2.37.1
DEBUG: Platform config
       "platformConfig": {
         "hostType": "github",
         "endpoint": "https://api.github.com/",
         "isGHApp": false,
         "isGhe": false,
         "userDetails": {"username": "jacob-jameson", "name": null}
       },
       "renovateUsername": "jacob-jameson"
DEBUG: Using configured gitAuthor (Jacob Jameson <[email protected]>)
DEBUG: Adding token authentication for api.github.com to hostRules
DEBUG: Using baseDir: C:/Users/JACOBJ~1/AppData/Local/Temp/renovate
DEBUG: Using cacheDir: C:/Users/JACOBJ~1/AppData/Local/Temp/renovate/cache
DEBUG: Using containerbaseDir: C:/Users/JACOBJ~1/AppData/Local/Temp/renovate/cache/containerbase
DEBUG: Initializing Renovate internal cache into C:/Users/JACOBJ~1/AppData/Local/Temp/renovate/cache/renovate/renovate-cache-v1
DEBUG: Commits limit = null
DEBUG: Setting global hostRules
DEBUG: Adding token authentication for github.com to hostRules
DEBUG: Adding token authentication for api.github.com to hostRules
DEBUG: validatePresets()
DEBUG: Reinitializing hostRules for repo
DEBUG: Clearing hostRules
DEBUG: Adding token authentication for github.com to hostRules
DEBUG: Adding token authentication for api.github.com to hostRules
 INFO: Repository started (repository=jacob-jameson/Renovate_SelfHosted)
       "renovateVersion": "34.154.6"
DEBUG: Using localDir: C:/Users/JACOBJ~1/AppData/Local/Temp/renovate/repos/github/jacob-jameson/Renovate_SelfHosted (repository=jacob-jameson/Renovate_SelfHosted)   
DEBUG: PackageFiles.clear() - Package files deleted (repository=jacob-jameson/Renovate_SelfHosted)
DEBUG: initRepo("jacob-jameson/Renovate_SelfHosted") (repository=jacob-jameson/Renovate_SelfHosted)
DEBUG: Caught initRepo error (repository=jacob-jameson/Renovate_SelfHosted)
       "err": {
         "message": "not-found",
         "stack": "Error: not-found\n    at Proxy.initRepo (C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\modules\\platform\\github\\index.ts:392:13)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at getPlatformConfig (C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\workers\\repository\\init\\apis.ts:52:26)\n    at initApis (C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\workers\\repository\\init\\apis.ts:64:12)\n    at initRepo (C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\workers\\repository\\init\\index.ts:37:12)\n    at Object.renovateRepository (C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\workers\\repository\\index.ts:49:14)\n    at attributes.repository (C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\workers\\global\\index.ts:181:11)\n    at start (C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\workers\\global\\index.ts:166:7)\n    at C:\\Dev\\Renovate_SelfHosted\\node_modules\\renovate\\lib\\renovate.ts:18:22"
       }
ERROR: Repository is not found (repository=jacob-jameson/Renovate_SelfHosted)
DEBUG: Repository result: not-found, status: disabled, enabled: false, onboarded: undefined (repository=jacob-jameson/Renovate_SelfHosted)
DEBUG: Repository timing splits (milliseconds) (repository=jacob-jameson/Renovate_SelfHosted)
       "splits": {},
       "total": 530
DEBUG: Package cache statistics (repository=jacob-jameson/Renovate_SelfHosted)
       "get": {"count": 0},
       "set": {"count": 0}
DEBUG: dns cache (repository=jacob-jameson/Renovate_SelfHosted)
       "hosts": []
 INFO: Repository finished (repository=jacob-jameson/Renovate_SelfHosted)
       "cloned": undefined,
       "durationMs": 530
DEBUG: Renovate exiting
 INFO: Renovate is exiting with a non-zero code due to the following logged errors
       "loggerErrors": [
         {
           "name": "renovate",
           "level": 50,
           "logContext": "zM13viiLgx6NWxBuYFC1r",
           "repository": "jacob-jameson/Renovate_SelfHosted",
           "msg": "Repository is not found"
         }
       ]

I tried changing deleting the repo and rewriting the code, thinking I may have changed a setting in the repo or maybe there is a typo a can't see. But the repos still cannot be found.

I tried changing autoDiscover to true, but this didn't work either.

I made sure that my local git user.name and user.email match my GitHub details, still doesn't work.

I tried generating a new access token, still doesn't work.

Thanks in advance for the help!


Solution

  • If the repo can't be found, there's an issue with the token - make sure it has full "repo" access.