Product: PowerShell Universal
Version: 5.5.2
Hi there,
we just set up a custom encryption key as documented in Variables | PowerShell Universal.
After restart the previously configured Git sync is not working and the secret can’t be set anymore.
2025-05-15 08:25:00.607 +02:00 [ERR][UniversalAutomation.GitSyncService] Failed to sync: Specified key is not a valid size for this algorithm. at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154
at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 172
at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteHandle remote, IEnumerable`1 refSpecs, GitFetchOptions fetchOptions, String logMessage) in /_/LibGit2Sharp/Core/Proxy.cs:line 2289
at LibGit2Sharp.Commands.Fetch(Repository repository, String remote, IEnumerable`1 refspecs, FetchOptions options, String logMessage) in /_/LibGit2Sharp/Commands/Fetch.cs:line 79
at LibGit2Sharp.Commands.Pull(Repository repository, Signature merger, PullOptions options) in /_/LibGit2Sharp/Commands/Pull.cs:line 36
at PowerShellUniversal.Git.GitService.Pull() in D:\a\universal\universal\src\PowerShellUniversal.Git\GitService.cs:line 875
at UniversalAutomation.GitSyncService.TrySync(GitStatus status, Boolean force, GitSettings settings) in D:\a\universal\universal\src\PowerShellUniversal.Git\GitSyncService.cs:line 188
at UniversalAutomation.GitSyncService.Sync(Boolean force, Boolean throwOnFailure) in D:\a\universal\universal\src\PowerShellUniversal.Git\GitSyncService.cs:line 88
I think the issue is that due to security and compliance we do not use a username / password, but a x-auth-token as username and the token as value, which is quite long.
Without custom encryption key it works like a charm
Best,
Matthias