cml icon indicating copy to clipboard operation
cml copied to clipboard

Error: driver not set when trying to launch a runner for a Github Enterprise Repo

Open thomslor opened this issue 3 years ago • 17 comments

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. (/home/user/.nvm/versions/node/v16.15.1/lib/node_modules/@dvcorg/cml/bin/cml.js:90:4) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) {"status":"terminated"}

I have the same error when trying with the official docker.

thomslor avatar Jun 16 '22 13:06 thomslor

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

0x2b3bfa0 avatar Jun 16 '22 13:06 0x2b3bfa0

Okay, i have now an error that i understand (certificate problem). Thanks a lot !

thomslor avatar Jun 16 '22 13:06 thomslor

You're very welcome! @casperdcl, should we document this somewhere?

0x2b3bfa0 avatar Jun 16 '22 13:06 0x2b3bfa0

@0x2b3bfa0 can we

  1. detect GH Enterprise (from an env var? or API call?) and auto-add the /api/v3/?
  2. or at least add a URL to the error: Error: driver not set message (probably linking to https://cml.dev/doc/ref#--driver, where we can add more info)

casperdcl avatar Sep 22 '22 13:09 casperdcl

Yes, we can

0x2b3bfa0 avatar Sep 22 '22 23:09 0x2b3bfa0

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.

0x2b3bfa0 avatar Sep 30 '22 01:09 0x2b3bfa0

@thomslor, were you running CML from GitHub Actions on GitHub Enterprise?

0x2b3bfa0 avatar Sep 30 '22 01:09 0x2b3bfa0

As per @dacbd, this probably happens due to buggy driver === 'github' checks like https://github.com/iterative/cml/pull/1098#discussion_r950422963.

0x2b3bfa0 avatar Oct 06 '22 00:10 0x2b3bfa0

in that case... #1209

casperdcl avatar Oct 07 '22 08:10 casperdcl

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

dacbd avatar Oct 08 '22 22:10 dacbd

GITHUB_REPOSITORY should be set; that's all that we ask

0x2b3bfa0 avatar Oct 09 '22 01:10 0x2b3bfa0

GITHUB_SERVER_URL to be verbose or GITHUB_API_URL?

dacbd avatar Oct 09 '22 04:10 dacbd

It's the same, I think: the only thing we need is to determine whether we're running inside GitHub Actions or not. 🤔

0x2b3bfa0 avatar Oct 09 '22 05:10 0x2b3bfa0

See https://github.com/iterative/cml/pull/1209#issuecomment-1271719258 for context; #1209 does not fix this issue

0x2b3bfa0 avatar Oct 10 '22 03:10 0x2b3bfa0

Closed accidentally, not solved 🙈

0x2b3bfa0 avatar Oct 10 '22 03:10 0x2b3bfa0

@iterative/cml, can't reproduce without access to GitHub Enterprise 😅

0x2b3bfa0 avatar Oct 14 '22 21:10 0x2b3bfa0

@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.

thomslor avatar Nov 23 '22 20:11 thomslor