microsoft / microsoft/sql-server-samples
Exception calling "ToUInt32" with "1" argument(s): "Input string was not in a correct format."
Open
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 11.2k
- Forks
- 9.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
Running the preparesubnet.ps1 script results in the following error:
Selecting subscription 'REDACTED'.
Subscription selected.
Loading virtual network 'vnw-redacted-dev-az1-vnet' in resource group 'rsg-redacted-dev-az1-vnet'.
Virtual network loaded.
Loading subnet 'sbt-redacted-app'.
Subnet loaded.
Verifying subnet 'sbt-redacted-app'.
Passed Validation - Subnet is of enough size.
Passed Validation - There are no conflicting resources inside the subnet.
Verifying DNS servers list for virtual network 'vnw-redacted-dev-az1-vnet'.
Passed Validation - DNS Servers List.
Verifying Service endpoints for subnet 'sbt-redacted-app'.
Passed Validation - No service endpoints.
Verifying Network security group for subnet 'sbt-redacted-app'.
Loading Network security group for subnet 'sbt-redacted-app'.
Warning - Network security group needs modifications.
Verifying RT for subnet 'sbt-redacted-app'.
Loading Route table for subnet 'sbt-redacted-app'.
Route table loaded.
Verifying Route table 'rtb-redacted-dev-az1-app'.
Exception calling "ToUInt32" with "1" argument(s): "Input string was not in a correct format."
At /home/jenkins/workspace/module-tests/scripts/prepareSubnet.ps1:284 char:5
+ $ipnum = ([Convert]::ToUInt32($cidrRangeParts[0]) -shl 24) -bor `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FormatException
Exception calling "ToUInt32" with "1" argument(s): "Input string was not in a correct format."
At /home/jenkins/workspace/module-tests/scripts/prepareSubnet.ps1:284 char:5
+ $ipnum = ([Convert]::ToUInt32($cidrRangeParts[0]) -shl 24) -bor `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FormatException
Exception calling "ToUInt32" with "1" argument(s): "Input string was not in a correct format."
At /home/jenkins/workspace/module-tests/scripts/prepareSubnet.ps1:284 char:5
+ $ipnum = ([Convert]::ToUInt32($cidrRangeParts[0]) -shl 24) -bor `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FormatException
Passed Validation - Route table.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in scripts/prepareSubnet.ps1 at line 284, where route table validation calls ToUInt32 while processing the route table. Reproduce the prepareSubnet.ps1 run through route table verification and inspect the CIDR parts used there. Done means route table validation completes without the FormatException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100