Azure DevOps git sync issue

Hi,

I’m facing weird issue. I’m trying to configure Azure DevOps repo and in return I’m receiving:

2022-05-06 13:26:40.062 +01:00 [ERR] Failed to sync: Object reference not set to an instance of an object.    at UniversalAutomation.Git.GitService.Initialize() in D:\a\universal\universal\src\Universal.Server\Services\GitService.cs:line 129
   at UniversalAutomation.GitSyncService.TrySync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 133
   at UniversalAutomation.GitSyncService.Sync() in D:\a\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 77

I’ve changed versions of PSU (latest 2.10.2 and 3.0.0 beta), re-generating PAT with different permissions, including full, even creating empty repo, tested with and without branch name. Same issue, no matter what. Debug level of logging didn’t show any additional info in logs related to GIT sync.

My current config:

  "Data": {
    "RepositoryPath": "%ProgramData%\\UniversalAutomation\\Repository",
    "ConnectionString": "filename=%ProgramData%\\UniversalAutomation\\database.db;upgrade=true",
    "GitRemote": "https://dev.azure.com/ORGNAME/PROJECTNAME/_git/REPONAME",
    "GitUserName": "RANDOM User here",
    "GitPassword": "PAT here,
    "GitBranch": "",
    "GitSyncBehavior": "TwoWay",
    "ConfigurationScript": ""
  },

Wasn’t able to find anything similar in discussions.
Can it be related to recent change in supported versions of TLS?

I think it’s because you’re missing the “GitInitializeBehavior” setting in your config.

  "Data": {
    "RepositoryPath": "%ProgramData%\\UniversalAutomation\\Repository",
    "ConnectionString": "filename=%ProgramData%\\UniversalAutomation\\database.db;upgrade=true",
    "GitRemote": "https://dev.azure.com/ORGNAME/PROJECTNAME/_git/REPONAME",
    "GitUserName": "RANDOM User here",
    "GitPassword": "PAT here,
    "GitBranch": "",
    "GitSyncBehavior": "TwoWay",
    "ConfigurationScript": "",
    "GitInitializeBehavior" : "init" 
  },

The value can be either init or clone. init will initialize the local repo and push it to the remote. The clone option will pull the remote down to an empty local repository.

1 Like

Thanks, Adam.
I was absolutely sure, that I’ve tested this. But no, my fault. You are awesome. Have a great day.

1 Like