umbraco / Umbraco.Cloud.Issues

Public issue tracker for Umbraco Cloud
24 stars 2 forks source link

Reoccurring issue with reconciling changes between cloud and code repo using Umbraco Azure CI/CD scripts #776

Open eqtr-ab opened 1 week ago

eqtr-ab commented 1 week ago

Issue description

Hi,

We have faced a reoccurring issue since the start of our Umbraco Cloud project using the CI/CD scripts supplied for Azure pipelines by Umbraco. See these logs for two separate deployment attempts, both attempting to bring down the same change to our repo with the second one failing:

Job 0.0.119 (05/07)

See diff content:

2024-07-05T14:02:33.5562091Z ##[section]Starting: See diff content if any
2024-07-05T14:02:33.5568532Z ==============================================================================
2024-07-05T14:02:33.5568695Z Task         : PowerShell
2024-07-05T14:02:33.5568943Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2024-07-05T14:02:33.5569052Z Version      : 2.239.1
2024-07-05T14:02:33.5569118Z Author       : Microsoft Corporation
2024-07-05T14:02:33.5569201Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2024-07-05T14:02:33.5569347Z ==============================================================================
2024-07-05T14:02:33.7252835Z Generating script.
2024-07-05T14:02:33.7267160Z ========================== Starting Command Output ===========================
2024-07-05T14:02:33.7288140Z [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/a014d4e0-784f-47c5-b175-752399dc3db6.ps1'
2024-07-05T14:02:34.6715256Z diff --git a/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda b/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda
2024-07-05T14:02:34.6727398Z index a8997f7..f1770f7 100644
2024-07-05T14:02:34.6728235Z --- a/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda
2024-07-05T14:02:34.6728676Z +++ b/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda
2024-07-05T14:02:34.6729002Z @@ -3,13 +3,24 @@
2024-07-05T14:02:34.6729130Z    "Alias": "",
2024-07-05T14:02:34.6729364Z    "ItemKey": "Book.ReferralOverlay",
2024-07-05T14:02:34.6729649Z    "ParentId": "a5159b6f-6cbc-4585-a8c7-e4ed4bab4748",
2024-07-05T14:02:34.6729863Z -  "Translations": [],
2024-07-05T14:02:34.6730371Z +  "Translations": [
2024-07-05T14:02:34.6730496Z +    {
2024-07-05T14:02:34.6730808Z +      "Key": "97638237-db01-470c-9dc7-9b2a1927082b",
2024-07-05T14:02:34.6730970Z +      "Value": "",
2024-07-05T14:02:34.6731116Z +      "LanguageIsoCode": "en-GB"
2024-07-05T14:02:34.6731309Z +    }
2024-07-05T14:02:34.6731417Z +  ],
2024-07-05T14:02:34.6731749Z    "Udi": "umb://dictionary-item/97638237db01470c9dc79b2a1927082b",
2024-07-05T14:02:34.6731936Z    "Dependencies": [
2024-07-05T14:02:34.6732056Z      {
2024-07-05T14:02:34.6732396Z        "Udi": "umb://dictionary-item/a5159b6f6cbc4585a8c7e4ed4bab4748",
2024-07-05T14:02:34.6734063Z        "Ordering": true,
2024-07-05T14:02:34.6734279Z        "Mode": "Exist"
2024-07-05T14:02:34.6734393Z +    },
2024-07-05T14:02:34.6734493Z +    {
2024-07-05T14:02:34.6734761Z +      "Udi": "umb://language/en-GB",
2024-07-05T14:02:34.6734902Z +      "Ordering": true,
2024-07-05T14:02:34.6735026Z +      "Mode": "Exist"
2024-07-05T14:02:34.6735197Z      }
2024-07-05T14:02:34.6735297Z    ],
2024-07-05T14:02:34.6735689Z    "__type": "Umbraco.Deploy.Infrastructure,Umbraco.Deploy.Infrastructure.Artifacts.DictionaryItemArtifact",
2024-07-05T14:02:34.6735830Z 
2024-07-05T14:02:34.7654309Z 
2024-07-05T14:02:34.7740584Z ##[section]Finishing: See diff content if any

Apply git patch to branch:

2024-07-05T14:03:02.1298426Z ##[section]Starting: Applying git patch to branch
2024-07-05T14:03:02.1306335Z ==============================================================================
2024-07-05T14:03:02.1306469Z Task         : PowerShell
2024-07-05T14:03:02.1306532Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2024-07-05T14:03:02.1306694Z Version      : 2.239.1
2024-07-05T14:03:02.1306756Z Author       : Microsoft Corporation
2024-07-05T14:03:02.1306847Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2024-07-05T14:03:02.1306955Z ==============================================================================
2024-07-05T14:03:02.6146536Z Generating script.
2024-07-05T14:03:02.6186091Z ========================== Starting Command Output ===========================
2024-07-05T14:03:02.6219997Z [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/5254813f-6643-473d-94d7-e19ea01c79b0.ps1'
2024-07-05T14:03:04.1213875Z hello branch: master
2024-07-05T14:03:04.1954398Z Switched to a new branch 'master'
2024-07-05T14:03:04.1955375Z branch 'master' set up to track 'origin/master'.
2024-07-05T14:03:04.2326089Z Checking patch src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda...
2024-07-05T14:03:04.2330678Z Applied patch src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda cleanly.
2024-07-05T14:03:04.2858519Z [master b2d372e2] Adding cloud changes since deployment 0851f045-7bce-49b4-a40e-5aee8e258a7d [skip ci]
2024-07-05T14:03:04.2859427Z  1 file changed, 12 insertions(+), 1 deletion(-)
2024-07-05T14:03:05.1096979Z To https://dev.azure.com/[snip]/_git/[snip]
2024-07-05T14:03:05.1098299Z    60776f84..b2d372e2  master -> master
2024-07-05T14:03:05.1167029Z branch 'master' set up to track 'origin/master'.
2024-07-05T14:03:05.2613108Z 
2024-07-05T14:03:05.2734871Z ##[section]Finishing: Applying git patch to branch

In this run, the dictionary change has been successfully brought down and applied to the repo in Azure.

On the next run, it attempts to bring down the same change, and produces an error:

Job 0.0.120 (08/07):

See diff content:

2024-07-08T09:02:01.3561033Z ##[section]Starting: See diff content if any
2024-07-08T09:02:01.3567442Z ==============================================================================
2024-07-08T09:02:01.3567605Z Task         : PowerShell
2024-07-08T09:02:01.3567863Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2024-07-08T09:02:01.3567969Z Version      : 2.239.1
2024-07-08T09:02:01.3568035Z Author       : Microsoft Corporation
2024-07-08T09:02:01.3568116Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2024-07-08T09:02:01.3568258Z ==============================================================================
2024-07-08T09:02:01.5465441Z Generating script.
2024-07-08T09:02:01.5482749Z ========================== Starting Command Output ===========================
2024-07-08T09:02:01.5503696Z [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/b641e02b-5f3c-4a54-b1ee-4b06f47701fc.ps1'
2024-07-08T09:02:02.5241808Z diff --git a/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda b/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda
2024-07-08T09:02:02.5245766Z index a8997f7..f1770f7 100644
2024-07-08T09:02:02.5246832Z --- a/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda
2024-07-08T09:02:02.5247570Z +++ b/src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda
2024-07-08T09:02:02.5248402Z @@ -3,13 +3,24 @@
2024-07-08T09:02:02.5248790Z    "Alias": "",
2024-07-08T09:02:02.5249116Z    "ItemKey": "Book.ReferralOverlay",
2024-07-08T09:02:02.5249653Z    "ParentId": "a5159b6f-6cbc-4585-a8c7-e4ed4bab4748",
2024-07-08T09:02:02.5250045Z -  "Translations": [],
2024-07-08T09:02:02.5250435Z +  "Translations": [
2024-07-08T09:02:02.5250822Z +    {
2024-07-08T09:02:02.5251320Z +      "Key": "97638237-db01-470c-9dc7-9b2a1927082b",
2024-07-08T09:02:02.5251730Z +      "Value": "",
2024-07-08T09:02:02.5252154Z +      "LanguageIsoCode": "en-GB"
2024-07-08T09:02:02.5252596Z +    }
2024-07-08T09:02:02.5252957Z +  ],
2024-07-08T09:02:02.5253456Z    "Udi": "umb://dictionary-item/97638237db01470c9dc79b2a1927082b",
2024-07-08T09:02:02.5253795Z    "Dependencies": [
2024-07-08T09:02:02.5254148Z      {
2024-07-08T09:02:02.5254609Z        "Udi": "umb://dictionary-item/a5159b6f6cbc4585a8c7e4ed4bab4748",
2024-07-08T09:02:02.5255552Z        "Ordering": true,
2024-07-08T09:02:02.5256002Z        "Mode": "Exist"
2024-07-08T09:02:02.5314598Z +    },
2024-07-08T09:02:02.5314768Z +    {
2024-07-08T09:02:02.5315165Z +      "Udi": "umb://language/en-GB",
2024-07-08T09:02:02.5315554Z +      "Ordering": true,
2024-07-08T09:02:02.5315691Z +      "Mode": "Exist"
2024-07-08T09:02:02.5315876Z      }
2024-07-08T09:02:02.5315982Z    ],
2024-07-08T09:02:02.5316195Z    "__type": "Umbraco.Deploy.Infrastructure,Umbraco.Deploy.Infrastructure.Artifacts.DictionaryItemArtifact",
2024-07-08T09:02:02.5316408Z 
2024-07-08T09:02:02.6342840Z 
2024-07-08T09:02:02.6415093Z ##[section]Finishing: See diff content if any

Apply git patch to branch:

2024-07-08T09:02:35.9970875Z ##[section]Starting: Applying git patch to branch
2024-07-08T09:02:35.9977632Z ==============================================================================
2024-07-08T09:02:35.9977759Z Task         : PowerShell
2024-07-08T09:02:35.9977821Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2024-07-08T09:02:35.9977911Z Version      : 2.239.1
2024-07-08T09:02:35.9977968Z Author       : Microsoft Corporation
2024-07-08T09:02:35.9978054Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2024-07-08T09:02:35.9978157Z ==============================================================================
2024-07-08T09:02:36.4685338Z Generating script.
2024-07-08T09:02:36.4738519Z ========================== Starting Command Output ===========================
2024-07-08T09:02:36.4742305Z [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/699ff560-165a-4019-b322-01f382576733.ps1'
2024-07-08T09:02:37.9762487Z hello branch: master
2024-07-08T09:02:38.0496297Z Switched to a new branch 'master'
2024-07-08T09:02:38.0498912Z branch 'master' set up to track 'origin/master'.
2024-07-08T09:02:38.0893207Z Checking patch src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda...
2024-07-08T09:02:38.0894100Z error: while searching for:
2024-07-08T09:02:38.0895011Z   "Alias": "",
2024-07-08T09:02:38.0895339Z   "ItemKey": "Book.ReferralOverlay",
2024-07-08T09:02:38.0895899Z   "ParentId": "a5159b6f-6cbc-4585-a8c7-e4ed4bab4748",
2024-07-08T09:02:38.0896492Z   "Translations": [],
2024-07-08T09:02:38.0898108Z   "Udi": "umb://dictionary-item/97638237db01470c9dc79b2a1927082b",
2024-07-08T09:02:38.0898441Z   "Dependencies": [
2024-07-08T09:02:38.0898667Z     {
2024-07-08T09:02:38.0899195Z       "Udi": "umb://dictionary-item/a5159b6f6cbc4585a8c7e4ed4bab4748",
2024-07-08T09:02:38.0899586Z       "Ordering": true,
2024-07-08T09:02:38.0900092Z       "Mode": "Exist"
2024-07-08T09:02:38.0900232Z     }
2024-07-08T09:02:38.0900382Z   ],
2024-07-08T09:02:38.0900550Z   "__type": "Umbraco.Deploy.Infrastructure,Umbraco.Deploy.Infrastructure.Artifacts.DictionaryItemArtifact",
2024-07-08T09:02:38.0900666Z 
2024-07-08T09:02:38.0901127Z error: patch failed: src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda:3
2024-07-08T09:02:38.0901534Z error: src/VistaHealth/umbraco/Deploy/Revision/dictionary-item__97638237db01470c9dc79b2a1927082b.uda: patch does not apply
2024-07-08T09:02:38.1367768Z On branch master
2024-07-08T09:02:38.1392006Z Your branch is up to date with 'origin/master'.
2024-07-08T09:02:38.1392413Z 
2024-07-08T09:02:38.1394765Z nothing to commit, working tree clean
2024-07-08T09:02:38.3122154Z Everything up-to-date
2024-07-08T09:02:38.3141179Z branch 'master' set up to track 'origin/master'.
2024-07-08T09:02:38.4534807Z 
2024-07-08T09:02:38.4625045Z ##[section]Finishing: Applying git patch to branch
eqtr-ab commented 1 week ago

It may also be worth noting that this same deployment failed with a "package would be downgraded" error, despite there being no such downgrade - we upgraded to 13.4.0 earlier and successfully deployed this before these issues started occurring. The packages referenced by the error message already have the correct version.

Cannot apply update because the following packages would be downgraded: Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/VistaHealth.Core/VistaHealth.Core.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/src/VistaHealth/VistaHealth.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/VistaHealth.Core/VistaHealth.Core.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/src/VistaHealth/VistaHealth.csproj.
&se=2024-07-09T09%3A04%3A42Z&sr=b&sp=r&sig=23LD2MyD5YkR8bpHYXWXGYee96Ofod32xBl5vM0B2qo%3D
info: Received HTTP response headers after 98.3815ms - 200
info: End processing HTTP request after 100.0793ms - 200
info: Executed step: Download update
info: Executing step: Extract Update
info: Extracting zip /app/work/Update.zip to /app/work/Update
info: Executed step: Extract Update
info: Executing step: Checking versions
fail: Update failed with message: Cannot apply update because the following packages would be downgraded: Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/VistaHealth.Core/VistaHealth.Core.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/src/VistaHealth/VistaHealth.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/VistaHealth.Core/VistaHealth.Core.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/src/VistaHealth/VistaHealth.csproj.
fail: Error executing step: Umbraco.Cloud.Deployment.UpdateExecutor.Umbraco.Steps.CheckVersions Cannot apply update because the following packages would be downgraded: Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/VistaHealth.Core/VistaHealth.Core.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/src/VistaHealth/VistaHealth.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/VistaHealth.Core/VistaHealth.Core.csproj. Package: Umbraco.Cms, Version: 13.4.0, Project file: /repository/src/VistaHealth/VistaHealth.csproj.
info: Publishing update failed event
info: Executing step: Delete updating marker
info: Start processing HTTP request DELETE https://[snip].umbraco.io/api/vfs/site/locks/updating
info: Sending HTTP request DELETE https://[snip].umbraco.io/api/vfs/site/locks/updating
info: Received HTTP response headers after 146.6575ms - 200
info: End processing HTTP request after 148.7358ms - 200
info: Executed step: Delete updating marker

Edit - I have opened a separate issue for the above, #778.

eqtr-ab commented 1 week ago

To confirm, the changes reflected in the first run of the "See diff content" stage of the Azure CI/CD pipeline were committed to our repo at this point, as shown below:

image

What we are confused/concerned about is the repeated attempts to bring back the same changes in subsequent deployments. We have carried out a second deployment since then, and the same issue occurred.

eqtr-ab commented 4 days ago

Hi, I opened a ticket through Umbraco support for this issue and was told to request updates here. Has this been looked at yet? We are hoping to avoid further occurrences of this issue to maintain the integrity of our deployment process.