Arcade: Publish to BAR Fails with 500 error when a repo has the same default channel association for both the github and internal azure devops repo

Created on 20 Mar 2019  路  9Comments  路  Source: dotnet/arcade

Reported by @vatsan-madhavan ; a few of his builds failing when interacting with BAR:

https://dev.azure.com/dnceng/internal/_build/results?buildId=129133
https://dev.azure.com/dnceng/internal/_build/results?buildId=129107

Error:

D:\a\1\s\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19167.10\tools\SdkTasks\PublishBuildAssets.proj(30,5): error : RestApiException`1: The response contained an invalid status code 500 Internal Server Error
D:\a\1\s\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19167.10\tools\SdkTasks\PublishBuildAssets.proj(30,5): error : 
D:\a\1\s\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19167.10\tools\SdkTasks\PublishBuildAssets.proj(30,5): error : Body: {"message":"An error occured.","errors":null}
D:\a\1\s\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19167.10\tools\SdkTasks\PublishBuildAssets.proj(30,5): error :    at Microsoft.DotNet.Maestro.Client.Builds.CreateInternalAsync(BuildData body, CancellationToken cancellationToken) in /_/src/Maestro/Client/src/Generated/Builds.cs:line 285
D:\a\1\s\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19167.10\tools\SdkTasks\PublishBuildAssets.proj(30,5): error :    at Microsoft.DotNet.Maestro.Client.Builds.CreateAsync(BuildData body, CancellationToken cancellationToken) in /_/src/Maestro/Client/src/Generated/Builds.cs:line 210
D:\a\1\s\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19167.10\tools\SdkTasks\PublishBuildAssets.proj(30,5): error :    at Microsoft.DotNet.Maestro.Tasks.PushMetadataToBuildAssetRegistry.PushMetadataAsync(CancellationToken cancellationToken) in /_/src/Maestro/Microsoft.DotNet.Maestro.Tasks/src/PushMetadataToBuildAssetRegistry.cs:line 84
D:\a\1\s\.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19167.10\tools\SdkTasks\PublishBuildAssets.proj(30,5): error : 

cc @jcagme @mmitche @riarenas

Most helpful comment

In theory nothing. Only one of them should be needed. However we should not be crashing if both entries exist. I'll be keeping an eye to make sure the correct things are being assigned while I submit the correct fix.

All 9 comments

Looking

We were hitting exceptions trying to insert the same build/channel id pair into the Database.

@alexperovich helped me track the problem here: https://github.com/dotnet/arcade-services/blob/master/src/Maestro/Maestro.Data/Models/Build.cs#L27 where we look for both the azure devops and Github repos and insert the BuildChannel for both.

WPF has a default channel entry on the arcade branch for both the github and azure devops repos, which is what is triggering the problem.

We only started seeing it today after @jcagme's Azure Devops normalization fixes so that default channels flowed properly for AzDO repos.

I deleted one of the Default channels and that should unblock the builds, and will work on the fix to the trigger so that we don't try to insert duplicates even if we find a default channel entry for both repos.

https://dev.azure.com/dnceng/internal/_build/results?buildId=129199 was the first build after I deleted one of the duplicate default channels, and it succeeded.

What do we lose by not having a default channel for the Github repo?

In theory nothing. Only one of them should be needed. However we should not be crashing if both entries exist. I'll be keeping an eye to make sure the correct things are being assigned while I submit the correct fix.

Thanks for looking into this Ricardo

Thanks for resolving this quickly - appreciate it!!

Reopening and changed title to track the real fix for this

Oh, nice catch.

Was this page helpful?
0 / 5 - 0 ratings