Git sync error (was: PSU will no longer start in Azure)

Halp!

I don’t know what’s happened, but my app service running PSU no longer starts.

Before I tear the whole thing down and spin it up anew, can you tell me, @adam, if this exception means anything to you? I’ve even tried dropping the Azure SQL database and letting it re-populate it. The tables are there now, so PSU has definitely gotten far enough into the startup process to run the EF migrations.

Thanks!

Application: w3wp.exe
CoreCLR Version: 6.0.722.32202
.NET Version: 6.0.7
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AggregateException: One or more errors occurred. (The handle is invalid.)
 ---> System.IO.IOException: The handle is invalid.
   at System.ConsolePal.WindowsConsoleStream.Write(ReadOnlySpan`1 buffer)
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   at System.IO.StreamWriter.WriteLine(String value)
   at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
   at Hangfire.Logging.LogProviders.ColouredConsoleLogProvider.ColouredConsoleLogger.Write(LogLevel logLevel, String message, Exception e)
   at Hangfire.Logging.LogProviders.ColouredConsoleLogProvider.ColouredConsoleLogger.Log(LogLevel logLevel, Func`1 messageFunc, Exception exception)
   at Hangfire.Logging.LoggerExecutionWrapper.Log(LogLevel logLevel, Func`1 messageFunc, Exception exception)
   at Hangfire.Logging.LogExtensions.Info(ILog logger, String message)
   at Hangfire.Server.BackgroundServerProcess.<>c__DisplayClass6_0.<Execute>g__HandleStoppingSignal|1()
   at System.Threading.CancellationToken.<>c.<Register>b__12_0(Object obj)
   at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
   at System.Threading.CancellationTokenSource.CallbackNode.<>c.<ExecuteCallback>b__9_0(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
Product: PowerShell Universal
Version: 3.1.4

I have found this in the PSU log file:

[11:28:42 DBG] Reading configuration file tags.ps1
[11:28:42 DBG] Reading configuration for Settings
[11:28:42 DBG] Reading configuration file settings.ps1
Target branch: refs/heads/main, Tracked Branch: refs/remotes/origin/main[11:29:21 ERR] Failed to sync: Value cannot be null. (Parameter 'objectish')    at LibGit2Sharp.Core.Ensure.ArgumentNotNull(Object argumentValue, String argumentName) in /_/LibGit2Sharp/Core/Ensure.cs:line 24
   at LibGit2Sharp.Core.Ensure.ArgumentNotNullOrEmptyString(String argumentValue, String argumentName) in /_/LibGit2Sharp/Core/Ensure.cs:line 50
   at LibGit2Sharp.Repository.Lookup(String objectish, GitObjectType type, LookUpOptions lookUpOptions) in /_/LibGit2Sharp/Repository.cs:line 605
   at LibGit2Sharp.Repository.Lookup(String objectish, ObjectType type) in /_/LibGit2Sharp/Repository.cs:line 569
   at LibGit2Sharp.RepositoryExtensions.Lookup[T](IRepository repository, String objectish) in /_/LibGit2Sharp/RepositoryExtensions.cs:line 32
   at UniversalAutomation.Git.GitService.GetChangesSinceCommit(String sha)+MoveNext() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitService.cs:line 360
   at UniversalAutomation.GitSyncService.TrySync() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 199
   at UniversalAutomation.GitSyncService.Sync() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 67

My GitHub PAT is still valid until January next year so it’s not that. Any thoughts?

OK this is just getting weirder and weirder.

PSU is up and running now, but getting that GitHub sync error every few minutes. It manifests in the UI like this:

image

I made a small change to a script and I can confirm that it is still syncing to GitHub! Just throwing this error for some reason every time it does so.

Closing this off because this discussion already exists:

Git Sync Error Null Value - PowerShell Universal - Ironman Software Forums