How to format Git settings in appsettings.json

OK we just deployed the latest nightly after removing the .git folder (and setting the log level to Debug).

Below is the log. I don’t see anything in there that says it’s initialising the repo, but I do see (on line 57) that it immediately tried to sync branch “main” (the branch we want) but couldn’t find it (because when I check our app service repository folder, the newly-created repo is “master”).

What else can we try?

Edit: I’ve had to revert back to 2.8.3 because the 2.9.0 nightly broke our dashboard. Apparently New-UDChartJS is not a command anymore in 2.9.0. Dunno if that should be a GH issue or if it’s one of those things that happens in nightly builds.

2022-02-24 22:29:07.024 +00:00 [DBG] Hosting starting
2022-02-24 22:29:07.554 +00:00 [INF] Azure Web Sites environment detected. Using 'D:\home\ASP.NET\DataProtection-Keys' as key repository; keys will not be encrypted at rest.
2022-02-24 22:29:15.609 +00:00 [DBG] Reading data from file 'D:\home\ASP.NET\DataProtection-Keys\key-65bb60ea-7478-41ad-a722-efc6ddee7a16.xml'.
2022-02-24 22:29:15.708 +00:00 [DBG] Reading data from file 'D:\home\ASP.NET\DataProtection-Keys\key-9f878564-7875-4b09-b71c-4ceca1636edf.xml'.
2022-02-24 22:29:15.778 +00:00 [DBG] Found key {65bb60ea-7478-41ad-a722-efc6ddee7a16}.
2022-02-24 22:29:15.953 +00:00 [DBG] Found key {9f878564-7875-4b09-b71c-4ceca1636edf}.
2022-02-24 22:29:15.973 +00:00 [DBG] Considering key {65bb60ea-7478-41ad-a722-efc6ddee7a16} with expiration date 2022-05-07 21:49:59Z as default key.
2022-02-24 22:29:16.003 +00:00 [DBG] Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60
2022-02-24 22:29:16.014 +00:00 [DBG] Opening CNG algorithm 'AES' from provider 'null' with chaining mode CBC.
2022-02-24 22:29:16.022 +00:00 [DBG] Opening CNG algorithm 'SHA256' from provider 'null' with HMAC.
2022-02-24 22:29:16.033 +00:00 [DBG] Using key {65bb60ea-7478-41ad-a722-efc6ddee7a16} as the default key.
2022-02-24 22:29:16.040 +00:00 [DBG] Key ring with default key {65bb60ea-7478-41ad-a722-efc6ddee7a16} was loaded during application startup.
2022-02-24 22:29:24.664 +00:00 [ERR] Error registering vault PSUSecretStore
2022-02-24 22:29:24.667 +00:00 [ERR] Exception:
System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.SecretStore.SecureStoreFile' threw an exception.
 ---> System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
   at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)
   at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
   at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections, Object exceptionContext)
   at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections)
   at System.Security.AccessControl.FileSystemSecurity.Persist(String fullPath)
   at System.IO.FileSystemAclExtensions.SetAccessControl(DirectoryInfo directoryInfo, DirectorySecurity directorySecurity)
   at Microsoft.PowerShell.SecretStore.SecureStoreFile.SetDirectoryACLs(String directoryPath)
   at Microsoft.PowerShell.SecretStore.SecureStoreFile..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.PowerShell.SecretStore.SecureStoreFile.get_ConfigRequiresPassword()
   at Microsoft.PowerShell.SecretStore.LocalSecretStore.get_PasswordRequired()
   at Microsoft.PowerShell.SecretStore.SetSecretStoreConfiguration.EndProcessing()
   at System.Management.Automation.CommandProcessorBase.Complete()
2022-02-24 22:29:26.631 +00:00 [DBG] Reading configuration file licenses.ps1
2022-02-24 22:29:29.564 +00:00 [DBG] Reading configuration file accessControls.ps1
2022-02-24 22:29:29.573 +00:00 [DBG] Reading configuration file tags.ps1
2022-02-24 22:29:29.826 +00:00 [DBG] Reading configuration file settings.ps1
2022-02-24 22:30:57.714 +00:00 [DBG] Hosting starting
2022-02-24 22:30:57.898 +00:00 [INF] Azure Web Sites environment detected. Using 'D:\home\ASP.NET\DataProtection-Keys' as key repository; keys will not be encrypted at rest.
2022-02-24 22:31:03.012 +00:00 [DBG] Reading data from file 'D:\home\ASP.NET\DataProtection-Keys\key-65bb60ea-7478-41ad-a722-efc6ddee7a16.xml'.
2022-02-24 22:31:03.042 +00:00 [DBG] Reading data from file 'D:\home\ASP.NET\DataProtection-Keys\key-9f878564-7875-4b09-b71c-4ceca1636edf.xml'.
2022-02-24 22:31:03.090 +00:00 [DBG] Found key {65bb60ea-7478-41ad-a722-efc6ddee7a16}.
2022-02-24 22:31:03.113 +00:00 [DBG] Found key {9f878564-7875-4b09-b71c-4ceca1636edf}.
2022-02-24 22:31:03.142 +00:00 [DBG] Considering key {65bb60ea-7478-41ad-a722-efc6ddee7a16} with expiration date 2022-05-07 21:49:59Z as default key.
2022-02-24 22:31:03.171 +00:00 [DBG] Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60
2022-02-24 22:31:03.183 +00:00 [DBG] Opening CNG algorithm 'AES' from provider 'null' with chaining mode CBC.
2022-02-24 22:31:03.192 +00:00 [DBG] Opening CNG algorithm 'SHA256' from provider 'null' with HMAC.
2022-02-24 22:31:03.203 +00:00 [DBG] Using key {65bb60ea-7478-41ad-a722-efc6ddee7a16} as the default key.
2022-02-24 22:31:03.210 +00:00 [DBG] Key ring with default key {65bb60ea-7478-41ad-a722-efc6ddee7a16} was loaded during application startup.
2022-02-24 22:31:06.710 +00:00 [DBG] Reading configuration file licenses.ps1
2022-02-24 22:31:08.617 +00:00 [DBG] Reading configuration file accessControls.ps1
2022-02-24 22:31:08.625 +00:00 [DBG] Reading configuration file tags.ps1
2022-02-24 22:31:08.837 +00:00 [DBG] Reading configuration file settings.ps1
2022-02-24 22:32:46.540 +00:00 [ERR] Failed to sync: Unknown branch: main    at UniversalAutomation.Git.GitService.Push() in D:\a\universal\universal\src\Universal.Server\Services\GitService.cs:line 266
   at UniversalAutomation.GitSyncService.TrySync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 172
   at UniversalAutomation.GitSyncService.Sync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 77
2022-02-24 22:32:53.009 +00:00 [WRN] The cookie '.AspNetCore.OpenIdConnect.Nonce.CfDJ8Opgu2V4dK1BpyLvxt3uehZebBjM5Qln9dfMnk6QSuhJ0wyeakSOrtWRRCe53KHXv62dmTV22niMJGZlatySGkP1Y2Eut-KtG5WDEYqYllJWtOJVGzR_TaUvQsuTeqA23NF7k3KCOuSeivGrclZmjCNyHCbWc180-He4ZHW3gYjlh_j6aDyRCwvqDLMhV631NECmOhLI2_ybzOhR73DH6nf9xB1lugBqA2X7Mj321A8OMjWSy0FcKcQIOapkmTxtVfzcEAnWhuRx6VZSjYJqzoQ' has set 'SameSite=None' and must also set 'Secure'.
2022-02-24 22:32:53.028 +00:00 [WRN] The cookie '.AspNetCore.Correlation.pP3wWjbVryXb3EOiqzIa_BJtlmq90GfYBU0w1xZqQBY' has set 'SameSite=None' and must also set 'Secure'.
2022-02-24 22:33:03.453 +00:00 [WRN] The cookie '.AspNetCore.OpenIdConnect.Nonce.CfDJ8Opgu2V4dK1BpyLvxt3ueha7lzZp2kZWG0tOltusAdXDhLc5Qy-gftig2Ljmhfs4lwTdNIEQEeRlXhGRB4_Vdv1RV7BHUXq5yKkC0HOe7pZBtJP4MhPV3zOs756vvYwCQvrM3enywqsE1Rh7PbcwtEAS0SmZIi_316DdrnxVGISlb6liL9q2vFGjSJ_sLzDqXBNscacUsvMCpdMvzs7u_dkCs9wmR6mwJGWgorlf_AGmNOEZMV88yiJdvQjLqhKGc9yC2LhGOwD0xb77B9wZBXo' has set 'SameSite=None' and must also set 'Secure'.
2022-02-24 22:33:03.472 +00:00 [WRN] The cookie '.AspNetCore.Correlation.qeGtX_phelRX6Pe2l0WSDuDSTw9u1CykTE5xXXquqY4' has set 'SameSite=None' and must also set 'Secure'.
2022-02-24 22:33:09.230 +00:00 [ERR] Failed to sync: There is no tracking information for the current branch.    at LibGit2Sharp.Commands.Pull(Repository repository, Signature merger, PullOptions options)
   at UniversalAutomation.Git.GitService.Pull() in D:\a\universal\universal\src\Universal.Server\Services\GitService.cs:line 308
   at UniversalAutomation.GitSyncService.TrySync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 146
   at UniversalAutomation.GitSyncService.Sync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 77
2022-02-24 22:33:13.496 +00:00 [WRN] The cookie '.AspNetCore.OpenIdConnect.Nonce.CfDJ8Opgu2V4dK1BpyLvxt3uehboD-qHTqTOcDp6HWvzrrjnyTOydTWtOjC1cDlezE66VVNfoDSxBkkq_24bydU2W3ktr-f2aUnWqYZnpW6z7SCmvJH5yQElnBPOqTNJ8oMOOCDEPM3eQfubZ8-bg4LCoB4pqJR5-PSi5XQ_g3ntP6bmrh3b40PUZ02PuwdpC-nxtO3DsTcaH9Yt5Fm7UMwP6K51GXmD9QME4xIT6pOUornla0jf0gCs7XvLH6OBgfjSJTh17WxAdWBPeRphDVE6gAo' has set 'SameSite=None' and must also set 'Secure'.
2022-02-24 22:33:13.565 +00:00 [WRN] The cookie '.AspNetCore.Correlation.-ulZSQMR22mUjLODTv9ighF2gHp1-ZfSTHKD-87gjc8' has set 'SameSite=None' and must also set 'Secure'.
2022-02-24 22:34:09.455 +00:00 [ERR] Failed to sync: There is no tracking information for the current branch.    at LibGit2Sharp.Commands.Pull(Repository repository, Signature merger, PullOptions options)
   at UniversalAutomation.Git.GitService.Pull() in D:\a\universal\universal\src\Universal.Server\Services\GitService.cs:line 308
   at UniversalAutomation.GitSyncService.TrySync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 146
   at UniversalAutomation.GitSyncService.Sync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 77

Hi Together,

today i faced the same error messages. Ii figured out that my personal acces token was expired. Maybe this helps someone who is facing this issue again

@Alex1988

Also just got this myself today, I accidently deleted my Azure DevOps PAT Token so generated a new one and then reconfigured my git and I was getting this same error, didnt get chance to check logs like mabster, my repo branch is also ‘main’ witihin ADO so wondering if it was a similar issue.
One thing I did try to do was restart my web app (linux docker) and it didnt make any difference.
Shortly after I went into the PSU admin, git config and hit the reset button, then just re-added the git config, after doing this I hit sync and the last sync status ‘3 hours ago’ didnt update, but when I made a change to one of my roles and then manually saved it, that worked and now it seems without issue again.

TL;DR: try hitting ‘reset’ in the git settings, then reapplying your git configuration, then making a change and adding a commit.