Title: On Windows only, operations fail using ssh with PKI · gitpython-developers/GitPython · Discussion #1966 · GitHub
Open Graph Title: On Windows only, operations fail using ssh with PKI · gitpython-developers/GitPython · Discussion #1966
X Title: On Windows only, operations fail using ssh with PKI · gitpython-developers/GitPython · Discussion #1966
Description: On Windows only, operations fail using ssh with PKI
Open Graph Description: I am updating code that was previously Linux-only to support Windows, and my tests are failing on Windows with errors like ERROR: Cmd('git') failed due to: exit code(128) cmdline: git clone -v -- s...
X Description: I am updating code that was previously Linux-only to support Windows, and my tests are failing on Windows with errors like ERROR: Cmd('git') failed due to: exit code(128) cmdline: git clone...
Opengraph URL: https://github.com/gitpython-developers/GitPython/discussions/1966
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"On Windows only, operations fail using ssh with PKI","text":"\u003cp dir=\"auto\"\u003eI am updating code that was previously Linux-only to support Windows, and my tests are failing on Windows with errors like\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"ERROR: Cmd('git') failed due to: exit code(128)\n cmdline: git clone -v -- ssh://\u0026lt;redacted\u0026gt; C:\\Users\\stevjorg\\AppData\\Local\\Temp\\clitest-qevu7qrx\n stderr: 'Cloning into 'C:\\Users\\stevjorg\\AppData\\Local\\Temp\\clitest-qevu7qrx'...\nPermission denied, please try again.\nPermission denied, please try again.\n\u0026lt;redacted\u0026gt;: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode class=\"notranslate\"\u003eERROR: Cmd('git') failed due to: exit code(128)\n cmdline: git clone -v -- ssh://\u0026lt;redacted\u0026gt; C:\\Users\\stevjorg\\AppData\\Local\\Temp\\clitest-qevu7qrx\n stderr: 'Cloning into 'C:\\Users\\stevjorg\\AppData\\Local\\Temp\\clitest-qevu7qrx'...\nPermission denied, please try again.\nPermission denied, please try again.\n\u0026lt;redacted\u0026gt;: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eI can successfully execute the same command that is shown for \"cmdline:\" manually at the Windows command prompt.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe connection uses ssh keys, so no password is used/needed.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAny ideas?\u003c/p\u003e","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eI finally figured out the problem. I was running this through WinPython, and its batch files that set the environment prior to running python.exe assign a value to HOME (that is not the current user's home directory). Apparently, that confuses ssh because when I tweaked my process for starting python.exe in WinPython to clear the HOME variable, that fixed the problem.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e…so the problem has nothing to do with GitPython, but others attempting to use GitPython under WinPython will likely encounter the same problem.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMy specific fix was to stop using WinPython's scripts/python.bat to run Python and to instead call its scripts/env.bat to set up the environment, then \u003ccode class=\"notranslate\"\u003eSET HOME=\u003c/code\u003e, then execute \u003ccode class=\"notranslate\"\u003eif not \"%WINPYWORKDIR%\"==\"%WINPYWORKDIR1%\" cd %WINPYWORKDIR1%\u003c/code\u003e followed by \u003ccode class=\"notranslate\"\u003e\"%WINPYDIR%\\python.exe\" %*\u003c/code\u003e as scripts/python.bat would do.\u003c/p\u003e","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1966#discussioncomment-10847016"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:b88bbd47-4ed0-7161-d7e3-11e29cd305f6 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | 902A:76071:38FCE:4DC8C:6A6286ED |
| html-safe-nonce | eec9236f54cee820cc50725c076b3b92e729ac114dbe7cd6b38413bbf9696d10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDJBOjc2MDcxOjM4RkNFOjREQzhDOjZBNjI4NkVEIiwidmlzaXRvcl9pZCI6Ijc3NDg3ODAzNjI4NTMxNTY1ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ebe3841ef5f07cddbb662c36fa73767d65888490da80c685915ad167bdc30589 |
| hovercard-subject-tag | discussion:7274989 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/gitpython-developers/GitPython/1966/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/4e715fe560a41397e83d8f2ffb43f85f768adef45986fb05e4301c70469a7c43/gitpython-developers/GitPython/discussions/1966 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4e715fe560a41397e83d8f2ffb43f85f768adef45986fb05e4301c70469a7c43/gitpython-developers/GitPython/discussions/1966 |
| og:image:alt | I am updating code that was previously Linux-only to support Windows, and my tests are failing on Windows with errors like ERROR: Cmd('git') failed due to: exit code(128) cmdline: git clone -v -- s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7a4ef49a11a2c05de16a801b29c54a151d2e3262d6fd17381ca13b5ae25dda8f |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 97b18c8f1d2683a31995fd6e802daf9bf0d4d3f0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width