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: redirect.github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"On Windows only, operations fail using ssh with PKI","text":"I am updating code that was previously Linux-only to support Windows, and my tests are failing on Windows with errors like
\nERROR: Cmd('git') failed due to: exit code(128)\n cmdline: git clone -v -- ssh://<redacted> 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<redacted>: 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
\nI can successfully execute the same command that is shown for \"cmdline:\" manually at the Windows command prompt.
\nThe connection uses ssh keys, so no password is used/needed.
\nAny ideas?
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"I 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.
\n…so the problem has nothing to do with GitPython, but others attempting to use GitPython under WinPython will likely encounter the same problem.
\nMy 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 SET HOME=, then execute if not \"%WINPYWORKDIR%\"==\"%WINPYWORKDIR1%\" cd %WINPYWORKDIR1% followed by \"%WINPYDIR%\\python.exe\" %* as scripts/python.bat would do.
","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:74e4950d-faa8-6cc6-97c0-9c8679f6b4b8 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | BA80:1C8E7:35708:4823B:6969504A |
| html-safe-nonce | c47d115824f447e68b05383e2ac8ac7f214b14ea5860669d7ebf7cadb494fa66 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTgwOjFDOEU3OjM1NzA4OjQ4MjNCOjY5Njk1MDRBIiwidmlzaXRvcl9pZCI6IjM4NTA5NjYzMDc3Mjc4MTEzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2f700577e5a04c991dcb32e31fe5bd1419a77549da3f358184a7e9d760a97466 |
| 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 | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| 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 | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width