Azure / azure-iot-remote-monitoring

Azure IoT Remote Monitoring preconfigured solution
Other
249 stars 221 forks source link

Unable to create unique name for resource localrm when #430

Closed melzoghbi closed 3 years ago

melzoghbi commented 7 years ago

While i am trying to run the solution locally by execuing build.cmd local i am getting the following error:

Unable to create unique name for resource localrm forurl blob.core.windows.net

Below is a screen shot of the error message: image

How would i fix this issue?

Thanks.

zhang-hua commented 7 years ago

@melzoghbi , this issue is similar to issue 421 reported before. we have a PR 428 to address this issue. Basically we suspect the command to get a globally unique DNS name failed since

[Net.Dns]::GetHostEntry("localrmXXXXX.blob.core.windows.net")

always returns an entry no matter how many times to retry different random number XXXXX. If this happened, it won't work to use current script on master branch. You can try this PR on branch fix_issue_421 and let us know your feedback.

melzoghbi commented 7 years ago

I pulled this branch but i am facing the a different issue on next line no. 294 instead of 293.

image

Looking forward to your insights.

melzoghbi commented 7 years ago

Any update on this issue?

zhang-hua commented 7 years ago

@melzoghbi , can you try to run the command in Powershell and let me know the output:

$name = "{0}{1:x5}" -f "LocalRM", (get-random -max 1048575)
$hubname = $name + ".azure-devices.net"
Write-Host $hubname
[Net.Dns]::GetHostEntry($hubname)

Looks like the random number is not correctly appended to the resource name. Need this snippet to know if it will generate random name.

melzoghbi commented 7 years ago

Sure, here is the output of this command:

image

zhang-hua commented 7 years ago

@melzoghbi , thanks for your feedback. It seems that the DNS resolution is not quite right because that address doesn't exists in my test from here. I suspect your local DNS resolution always return you an incorrect response which should be handled by this PR. would you please help to run this commands so that I can fix it for you?

[Net.Dns]::GetHostEntry("ramdomsites97f51.nonexistentdomainname.com")
Invoke-WebRequest -Uri "https://LocalRM4a9a6.azure-devices.net/devices"
Invoke-WebRequest -Uri "https://LocalRM.azure-devices.net/devices"
melzoghbi commented 7 years ago

Thanks @zhang-hua for taking care of this and helping me to fix it. Here is an error i am getting when trying to execute above commands in PS:

image

zhang-hua commented 7 years ago

@melzoghbi , thanks for your feedback. I have pushed another new branch fix_issue_430 for you. please apply this code and see if it works.

Basically I found the DNS problem has little difference from what I can see here. The localRM4a9a6.azure-devices.net is an unknown host for me but known at your side. That's why my patch doesn't work. I add some code to distinguish the errors so that we can get a correct name for resource. Hope this can work for you this time.

zhang-hua commented 7 years ago

@melzoghbi , how is it going for this issue and patch?

melzoghbi commented 7 years ago

@zhang-hua I tried to get latest from the master branch today and while trying to run the solution locally, i am getting the following error:

image

Any thoughts on how to resolve this issue since it has been awhile and i see other issues reported the same problem such as: #432.

Thanks.

ankitscribbles commented 3 years ago

Note: As of December 10th 2020, Remote Monitoring solution accelerator is no longer supported. All supporting repositories have been archived.