git: use unique temporary SSH key paths#1143
Conversation
I do it the exact same way. That means I now have 27 stacks/compose.yaml files in my repository. |
|
@radoeka you encountered the same issue as me, right? |
|
I did not encounter problems (yet). |
|
Hmm, okay. It's surprising to me that this straightforward use case has such an issue, so maybe it's because I'm using Forgejo or there's another reason. |
|
I think that your PR is a good one, perhaps also more secure(?). I don't update automatically, or just one by one. I want to move to forgejo (already running) and move to 1 stack per repository at the same time, as that seems to be the expected approach. |
|
Thanks for digging into this. The unique SSH key path fix is a good fix — clean, surgical, and clearly addresses the shared- We have concerns about the locking layer though, which isn't mentioned in the PR summary:
Could you confirm whether the unique-path fix alone stopped the Telegram alerts? Your description traces the failure entirely to the shared key being removed mid-fetch, which # 1 fully addresses — so we suspect # 2 may not be needed to fix your reported issue. Could you split this into two PRs? We'd merge the unique-path fix right away; the locking change can have its own discussion where we can work through the queue semantics and how they interact with |
|
Hey hey, For # 2 I'll approach it from a different angle first to ensure I don't have general issues (e.g. I noticed my network connectivity might be flakey) |
28e9e17 to
4378fa6
Compare

Summary
This changes SSH credential handling for Git operations to use a unique temporary key file per operation instead of reusing
/tmp/.ssh-key-<credentialId>.Problem
Concurrent Git operations that use the same SSH credential currently share the same temporary key path. When one operation finishes, it removes that shared key file while another operation may still need it. This can make parallel syncs fail with SSH key lookup errors, especially during blobless clone/lazy fetch paths.
Fix
randomUUID().Verification
git diff --check HEAD~1..HEADNo database, API, or config changes.