Reputation: 10583
I have a Python project using Poetry, and I need to access another private repo called another_pgk
on Github when running the Github Actions. So I use https://github.com/webfactory/ssh-agent to setup my ssh key, this key is a deploy key for another_pgk
that enables me to only have read access to this another_pgk
repo. In my pyproject.toml
, I have the private repo added as:
another_pgk= {git = "[email protected]:username/another_pgk.git", branch = "main"}
It seems that the ssh key is added successfully because after the step of setting up the ssh key, the action script is able to clone the code by git clone [email protected]:username/another_pgk.git
. But if I run Poetry install
, it fails, with the following message:
HangupException
The remote server unexpectedly closed the connection.
at C:\Program Files (x86)\pipx\venvs\poetry\lib\site-packages\dulwich\protocol.py:220 in read_pkt_line
216|
217| try:
218| sizestr = read(4)
219| if not sizestr:
> 220| raise HangupException()
221| size = int(sizestr, 16)
222| if size == 0:
223| if self.report_activity:
224| self.report_activity(4, "read")
The following error occurred when trying to handle this error:
HangupException
Warning: Permanently added the ECDSA host key for IP address '192.30.255.112' to the list of known hosts.
Load key "C:\\Users\\runneradmin/.ssh/key-52016bfd3f72432689e062517edb001705ef0a8d1af12eb63b188417c75ca43e": invalid format
[email protected]: Permission denied (publickey).
at C:\Program Files (x86)\pipx\venvs\poetry\lib\site-packages\dulwich\client.py:1151 in fetch_pack
1147| with proto:
1148| try:
1149| refs, server_capabilities = read_pkt_refs(proto.read_pkt_seq())
1150| except HangupException as exc:
> 1151| raise _remote_error_from_stderr(stderr) from exc
1152| (
1153| negotiated_capabilities,
1154| symrefs,
1155| agent,
so, why is that, and how do I fix it? or does poetry supports deploy key or not?
Upvotes: 1
Views: 1097
Reputation: 10583
okay, i think the root cause is the path cannot take "/" as path seperator for windows for ssh-agent, reported at https://github.com/webfactory/ssh-agent/issues/162
Upvotes: 0