Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto sync feature is not working for azure git repo. #39347

Closed
girishgouda opened this issue Sep 23, 2019 — with docs.microsoft.com · 17 comments
Closed

Auto sync feature is not working for azure git repo. #39347

girishgouda opened this issue Sep 23, 2019 — with docs.microsoft.com · 17 comments

Comments

Copy link

Is this by design?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@KrishnaG-MSFT
Copy link
Contributor

@girishgouda Thanks for the comment. We are actively investigating on the issue and will get back to you shortly with an update.

@SwathiDhanwada-MSFT
Copy link
Contributor

@girishgouda Normally, auto sync feature works. Seems, there is an issue related to it.
@bobbytreed Can you please provide your inputs?

Copy link

Even I am facing the same issue. Auto-Sync feature is not working for the repo which is under Azure Devops.

@Ba4bes
Copy link

Ba4bes commented Oct 1, 2019

I have the same issue.
Things I have found:

  • The problem is autosync through Azure DevOps GIT
  • manual sync is working without issues
  • I have set up source control through PowerShell with a PAT key with full access. Azure DevOps and Azure tenant are not connected through AzureAD
  • Friend of mine says his sync is working. He has a manual set up sync, Azure DevOps and Azure Ad are the same tenant

Errors in the autosync job:

The property 'refUpdates' cannot be found on this object. Verify that the property exists. At line:911 char:5 + $actualBranch = $WebhookDataObject.resource.refUpdates.name + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException + FullyQualifiedErrorId : PropertyNotFoundStrict

Compare-Branch : Cannot validate argument on parameter 'ActualBranch'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:912 char:62 + ... (Compare-Branch -ExpectedBranch $Branch -ActualBranch $actualBranch) + ~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Compare-Branch], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Compare-Branch

@ghvanderweg
Copy link
Contributor

Our organization is having the same issue, is there any status update?

@Ankita-Chaudhari
Copy link

Ankita-Chaudhari commented Oct 9, 2019 via email

Copy link

It doesn't work for me as well, we have AzureDevops git and Auto-Sync enabled.

@stuartin
Copy link

Microsoft support have advised that they know about this bug and a fix is planned for deployment on the 12th December.
The workaround is to update the service hook in Azure DevOps to use a specific API version:

  1. Go to Project Settings
  2. Click on Service hooks.
  3. Double click on Webhook for this repository.
  4. Click Next and scroll down to Resource version.
  5. Select 1.0 as the value from the dropdown.

@ghost
Copy link

ghost commented Dec 4, 2019

Microsoft support have advised that they know about this bug and a fix is planned for deployment on the 12th December.
The workaround is to update the service hook in Azure DevOps to use a specific API version:

  1. Go to Project Settings
  2. Click on Service hooks.
  3. Double click on Webhook for this repository.
  4. Click Next and scroll down to Resource version.
  5. Select 1.0 as the value from the dropdown.

This seemed to work untill (I think) yesterday. Now when I try this the Process-SourceControlWebhook runbook starts but I get an output like this:

`Getting Azure Connection information

Getting the source control information

SourceControl Properties : [RepoUrl = https://XXXX.visualstudio.com/XXXX/_git/Azure-Control] ,[Branch = Control-TEST] , [FolderPath = /Automation_Runbooks/]

UrlConnectionInformation: [AccountName = XXXX] [RepoName = Azure-Control] [ProjectName = XXXX]

Start a sync job for commit id : 8c8551cf20ab0820f8a1f67ad0f7bb7cb0b9075c

Name Value


ProvisioningState Running
SourceControlSyncJobId 9bc460a5-c192-4874-b19b-f067ea6880a6
EndTime
CreationTime 2019-12-04T03:49:06.3520648+00:00
StartTime
SyncType PartialSync `

For some reason the job outputs the still running state and can't seem to finish (or even start). because of this the sync job also fails.
Anyone else also experiencing this?
When settings the webhook version back to the latest I get the earlier mentioned error still.
I tried updating the azureRM modules and setting the connection up again but both to no avail.

Edit:
Some more info. The runbook itself seems to be completing but in the sync job I get this output:
`Getting AzureRunAsConnection.

Logging in to Azure...

GET https://management.azure.com//subscriptions/XXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test?api-version=2017-05-15-preview with 0-byte payload

received 586-byte response of content type application/json; charset=utf-8

POST https://management.azure.com//subscriptions/XXXXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test/listKeys?api-version=2017-05-15-preview with 0-byte payload

received 899-byte response of content type application/json; charset=utf-8

Source control information for syncing:

[RepoUrl = https://XXXX.visualstudio.com/XXXX/_git/Azure-Control] [Branch = Control-TEST] [FolderPath = /Automation_Runbooks/]

Verifying url: https://XXXX.visualstudio.com/XXXX/_git/Azure-Control

Connecting to VSTS...

Syncing to commit id: 'e685517a1c722475509551714a56910c39dd247e'.

GET https://dev.azure.com/XXXX/XXXX/_apis/git/repositories/Azure-Control?api-version=1.0 with 0-byte payload

received 1981-byte response of content type application/json; charset=utf-8; api-version=1.0

GET https://dev.azure.com/XXXX/XXXX/_apis/git/repositories/Azure-Control/commits/e685517a1c722475509551714a56910c39dd247e/changes?api-version=1.0 with 0-byte payload

received 1012-byte response of content type application/json; charset=utf-8; api-version=1.0

POST https://management.azure.com//subscriptions/XXXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test/listKeys?api-version=2017-05-15-preview with 0-byte payload

received 899-byte response of content type application/json; charset=utf-8

GET https://dev.azure.com/XXXX/XXXX/_apis/git/repositories/Azure-Control/commits/e685517a1c722475509551714a56910c39dd247e/changes?api-version=1.0 with 0-byte payload

received 1012-byte response of content type application/json; charset=utf-8; api-version=1.0

POST https://management.azure.com//subscriptions/XXXXXXXXXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test/listKeys?api-version=2017-05-15-preview with 0-byte payload

received 899-byte response of content type application/json; charset=utf-8`

After this I shows failed. I tried it with another repository and for some reason it does seem to work there. In one of my pipelines I'm checking if the sync job is complete already. Could this be the cause of the "fail" ?

Edit2: I ran it again without the check if it's completed and it still doesn't work. I will check some more to see if I can find a difference between the two repositories and see if I can narrow down why it's failing.

@ghost
Copy link

ghost commented Dec 4, 2019

Okay I did some more testing, and from what I see the problem only seems to be when there is folder is defined. When you are syncing the root directory everything seems to work okay. but when using a folder in the directory the script seems to break...

Copy link

irriss commented Dec 11, 2019

I did not specify the folder and it does not work. Having the same erros in logs as Ba4bes commented 3 months ago

@ghost
Copy link

ghost commented Dec 11, 2019

I did not specify the folder and it does not work. Having the same erros in logs as Ba4bes commented 3 months ago

Did you set the webhook version to V1.0 as stuartin sugested?

@irriss
Copy link

irriss commented Dec 11, 2019

Did you set the webhook version to V1.0 as stuartin sugested?

No, stuartin mention that tomorrow (12 Dec) it will be fixed. Fingers crossed

@ghost
Copy link

ghost commented Dec 11, 2019

Did you set the webhook version to V1.0 as stuartin sugested?

No, stuartin mention that tomorrow (12 Dec) it will be fixed. Fingers crossed

For me when not having a subfolder settings the webhook to v1.0 worked

@irriss
Copy link

irriss commented Jan 13, 2020

No, stuartin mention that tomorrow (12 Dec) it will be fixed. Fingers crossed

It still fails but now with different errors:

The property 'refUpdates' cannot be found on this object. Verify that the property exists. At line:978 char:5 + $actualBranch = $WebhookDataObject.resource.refUpdates.name + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException + FullyQualifiedErrorId : PropertyNotFoundStrict

Compare-Branch : Cannot validate argument on parameter 'ActualBranch'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:979 char:62 + ... (Compare-Branch -ExpectedBranch $Branch -ActualBranch $actualBranch) + ~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Compare-Branch], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Compare-Branch

@AlexSen
Copy link

AlexSen commented Mar 11, 2020

Have same issue (manual sync works OK, but auto sync fails with error "Invalid project or repo name ")
And found that reason is when Repo name is different from project name. In case if U will use default repo for project (usually on creating project U have repo with name same as project name).

@MGoedtel
Copy link
Contributor

Due to inactivity with this GitHub issue, I'm going to proceed with closing it. If you are still encountering issues while attempting to setup this feature based on the article, please open a new GitHub issue and I'll include a PM from the product group to participate. #please-close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests