Error: driver not set when trying to launch a runner for a Github Enterprise Repo
This error is raised when trying to launch a runner on a repo hosted on a private Github server. Is CML compatible with Github Enterprise ? Is this a problem with my configuration ?
Here are the logs of the error :
error: Error: driver not set
at getDriver (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/src/cml.js:64:22)
at CML.runnerToken (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/src/cml.js:257:18)
at CML.repoTokenCheck (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/src/cml.js:381:18)
at run (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/bin/cml/runner.js:357:13)
at Object.exports.handler (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/bin/cml/runner.js:427:11)
at /home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:8891
at j (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:4956)
at M.handleValidationAndGetResult (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:8860)
at M.applyMiddlewareAndGetResult (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:9502)
at M.runCommand (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:7231)
at Xt.[runYargsParserAndExecuteCommands] (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:57762)
at Xt.parse (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:39873)
at Object.
I have the same error when trying with the official docker.
CML should be compatible with GitHub Enterprise, although we don't actively test it. 🙈 Can you please try running cml with --driver=github to disambiguate?
https://github.com/iterative/cml/blob/3f2aadcb10a995b57f37c82c7daa9eaae4160376/src/drivers/github.js#L71-L72
Okay, i have now an error that i understand (certificate problem). Thanks a lot !
You're very welcome! @casperdcl, should we document this somewhere?
@0x2b3bfa0 can we
- detect GH Enterprise (from an env var? or API call?) and auto-add the
/api/v3/? - or at least add a URL to the
error: Error: driver not setmessage (probably linking to https://cml.dev/doc/ref#--driver, where we can add more info)
Yes, we can
It turns out we test for GitHub environment variables since the inception of CML:
https://github.com/iterative/cml/blob/b9226f1b26a37583d82f3f93fb126954f980f35c/src/cml.js#L77
Unless prove otherwise, it should work as intended.
@thomslor, were you running CML from GitHub Actions on GitHub Enterprise?
As per @dacbd, this probably happens due to buggy driver === 'github' checks like https://github.com/iterative/cml/pull/1098#discussion_r950422963.
in that case... #1209
A quick look shows that you can host your GitHub enterprise off any domain /?
if the hostname isn't recognized maybe we need to try and hit some form of /me API to who it should be. For GitLab
GITHUB_REPOSITORY should be set; that's all that we ask
GITHUB_SERVER_URL to be verbose or GITHUB_API_URL?
It's the same, I think: the only thing we need is to determine whether we're running inside GitHub Actions or not. 🤔
See https://github.com/iterative/cml/pull/1209#issuecomment-1271719258 for context; #1209 does not fix this issue
Closed accidentally, not solved 🙈
@iterative/cml, can't reproduce without access to GitHub Enterprise 😅
@thomslor, were you running CML from GitHub Actions on GitHub Enterprise?
Exactly, however i was intern so I don't have access to it anymore.