question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: A hash conflict was encountered for the role Assignment ID. Please use a new Guid

See original GitHub issue

Describe the bug Running a script from Azure DevOps pipeline, I randomly get the following error, once every 100 calls or so:

az role assignment create --subscription <sub_id> --role 'Support Request Contributor' --assignee-object <object_id> --scope /subscriptions/<sub_id>
ERROR: A hash conflict was encountered for the role Assignment ID. Please use a new Guid

this is making it impossible to run a long script that has hundreds of these role assignments

To Reproduce call

az role assignment create --subscription <sub_id> --role '<any role>' --assignee-object <object_id> --scope /subscriptions/<sub_id>

1,000 times, it will randomly fail with the above.

Expected behavior az role assignment completes

Environment summary no idea how this was installed on the AzDevOps agents. Here is the output from az --version though:

This command group is in preview. It may be changed/removed in a future release.
WARNING: You have 2 updates available. Consider updating your CLI installation. Instructions can be found at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
azure-cli                         2.0.77 *

command-modules-nspkg              2.0.3
core                              2.0.77 *
nspkg                              3.0.4
telemetry                          1.0.4

Python location '/opt/az/bin/python3'
Extensions directory '/data/vsts-agent/_work/_temp/.azclitask/cliextensions'

Python (Linux) 3.6.5 (default, Nov 22 2019, 05:32:09) 
[GCC 7.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
jongiocommented, Aug 7, 2020

I also encountered this today using terraform

resource "azurerm_role_assignment" "cli_queue_msg_storage" {
  scope                = azurerm_storage_account.storage.id
  role_definition_name = "Storage Queue Data Message Processor"
  principal_id         = data.azurerm_client_config.current.object_id
}
1reaction
Kruti-Joshicommented, Dec 7, 2021

What is the scope of uniqueness of the roleAssignmentID? I’m frequently seeing these error messages too, but in the ARM template, I’ve set role assignment 'name' = "[guid(concat(resourceGroup().id, 'some-string-here'))]"

Since this depends on the resource group in the current deployment, is it possible that there’s a hash conflict with the role assignment id of some other resource group which is already present in the subscription?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incremental redeployment of an ARM Template with Role ...
To resolve this issue, we need ensure that each deployment to a different resource group uses a different GUID for the role assignment, ......
Read more >
Assign Azure roles using Azure Resource Manager templates
This article describes how to assign roles using templates. Note. Bicep is a new language for defining your Azure resources.
Read more >
Troubleshooting Windows Devices: Workspace ONE ...
Use these steps to identify the reasons why a profile failed to install. ☐Check Event Viewer logs for a 404 failure message: App...
Read more >
Stripe API reference – curl
By default, the Stripe API Docs demonstrate using curl to interact with the ... The payment error encountered in the previous PaymentIntent confirmation....
Read more >
Release Notes for Cisco Identity Services Engine, Release 3.1
In Cisco ISE, you can now work around this problem by configuring Cisco ISE to use a unique device identifier called GUID instead...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found