Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic Error on Public IP Scan #268

Closed
cmendible opened this issue Nov 4, 2024 · 6 comments · Fixed by #271
Closed

Panic Error on Public IP Scan #268

cmendible opened this issue Nov 4, 2024 · 6 comments · Fixed by #271
Assignees
Labels
bug Something isn't working

Comments

@cmendible
Copy link
Member

Hello,
the tool worked for a long time than I received:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xf8e8a5]

goroutine 17643 [running]:
github.com/Azure/azqr/internal/scanners/pip.(*PublicIPScanner).Scan(0xc0003882d0, 0xc02e4bad80)
D:/a/azqr/azqr/internal/scanners/pip/pip.go:45 +0x225
github.com/Azure/azqr/internal.Scanner.retry({}, 0x3, 0x0?, {0x1bd3a48, 0xc0003882d0}, 0xc02e4bad80)
D:/a/azqr/azqr/internal/scanner.go:237 +0x103
github.com/Azure/azqr/internal.Scanner.Scan.func1({0x1bd3a48?, 0xc0003882d0?})
D:/a/azqr/azqr/internal/scanner.go:181 +0x5c
created by github.com/Azure/azqr/internal.Scanner.Scan in goroutine 1
D:/a/azqr/azqr/internal/scanner.go:180 +0xc87

I'll run it again with debug option

Regards,
Red.

@cmendible
Copy link
Member Author

Ok that means that the initial issue parsing the ARG query results was fixed.

Now you are hitting something related to an IP which seems that is not returning a value for its type, and that is very strange.

Can you please check if there is at least one row without a type as a result of running the following command?

resources
| where type =~ 'Microsoft.Network/publicIPAddresses'
| project name, type

You can also try running just azqr scan pip -s to run a targeted scan for this test.

@cmendible cmendible mentioned this issue Nov 4, 2024
@cmendible cmendible self-assigned this Nov 4, 2024
@red-erik
Copy link

red-erik commented Nov 4, 2024

Hello,
the query results are fine, all lines have the field "type" correctly populated. Waiting the scan with debug to finish or to stop with errors.

Regards,
Red.

@red-erik
Copy link

red-erik commented Nov 4, 2024

Hello,
here the error

2024-11-04T14:47:25+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.App/managedenvironments
2024-11-04T14:47:25+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.CognitiveServices/accounts
2024-11-04T14:47:25+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.VirtualMachineImages/imageTemplates
2024-11-04T14:47:25+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.Web/serverFarms
2024-11-04T14:47:25+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.Compute/galleries
2024-11-04T14:47:25+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.DBforMySQL/flexibleServers
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xf8e8a5]

goroutine 19383 [running]:
github.com/Azure/azqr/internal/scanners/pip.(*PublicIPScanner).Scan(0xc00033aed0, 0xc00a108de0)
D:/a/azqr/azqr/internal/scanners/pip/pip.go:45 +0x225
github.com/Azure/azqr/internal.Scanner.retry({}, 0x3, 0x0?, {0x1bd3a48, 0xc00033aed0}, 0xc00a108de0)
D:/a/azqr/azqr/internal/scanner.go:237 +0x103
github.com/Azure/azqr/internal.Scanner.Scan.func1({0x1bd3a48?, 0xc00033aed0?})
D:/a/azqr/azqr/internal/scanner.go:181 +0x5c
created by github.com/Azure/azqr/internal.Scanner.Scan in goroutine 1
D:/a/azqr/azqr/internal/scanner.go:180 +0xc87

Regards,
Red.

@red-erik
Copy link

red-erik commented Nov 4, 2024

Hello,
doing a targeted scan, I receive

2024-11-04T15:00:29+01:00 DBG all 100 workers are running. Sleeping for 4 seconds to avoid throttling
2024-11-04T15:00:33+01:00 DBG all 100 workers are running. Sleeping for 4 seconds to avoid throttling
2024-11-04T15:00:37+01:00 DBG all 100 workers are running. Sleeping for 4 seconds to avoid throttling
2024-11-04T15:00:41+01:00 DBG all 100 workers are running. Sleeping for 4 seconds to avoid throttling
2024-11-04T15:00:47+01:00 INF Scanning subscriptions/...c8cb590 for Private Endpoints
2024-11-04T15:00:59+01:00 INF Scanning subscriptions/...c8cb590 for Public IPs
2024-11-04T15:01:02+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.Network/publicIPAddresses
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xf8e8a5]

goroutine 3921 [running]:
github.com/Azure/azqr/internal/scanners/pip.(*PublicIPScanner).Scan(0xc0002bad20, 0xc0081dbd40)
D:/a/azqr/azqr/internal/scanners/pip/pip.go:45 +0x225
github.com/Azure/azqr/internal.Scanner.retry({}, 0x3, 0x0?, {0x1bd3a48, 0xc0002bad20}, 0xc0081dbd40)
D:/a/azqr/azqr/internal/scanner.go:237 +0x103
github.com/Azure/azqr/internal.Scanner.Scan.func1({0x1bd3a48?, 0xc0002bad20?})
D:/a/azqr/azqr/internal/scanner.go:181 +0x5c
created by github.com/Azure/azqr/internal.Scanner.Scan in goroutine 1
D:/a/azqr/azqr/internal/scanner.go:180 +0xc87

Regards,
Red.

cmendible added a commit to cmendible/azqr that referenced this issue Nov 5, 2024
@cmendible cmendible mentioned this issue Nov 5, 2024
3 tasks
@cmendible cmendible added the bug Something isn't working label Nov 5, 2024
@cmendible
Copy link
Member Author

@red-erik can you download and run a targeted pip scan with the binary form here: https://github.com/Azure/azqr/actions/runs/11687084396 and check if it's fixed?

@red-erik
Copy link

red-erik commented Nov 6, 2024

Hi There,
it worked like a charm for PIP but, as you can see, advisor is empty. Thank you very much

2024-11-06T08:02:06+01:00 DBG all 100 workers are running. Sleeping for 4 seconds to avoid throttling
2024-11-06T08:02:10+01:00 DBG all 100 workers are running. Sleeping for 4 seconds to avoid throttling
2024-11-06T08:02:14+01:00 DBG all 100 workers are running. Sleeping for 4 seconds to avoid throttling
2024-11-06T08:02:19+01:00 INF Scanning subscriptions/...c8cb590 for Private Endpoints
2024-11-06T08:02:32+01:00 INF Scanning subscriptions/...c8cb590 for Public IPs
2024-11-06T08:02:35+01:00 INF Scanning subscriptions/...c8cb590 for Microsoft.Network/publicIPAddresses
2024-11-06T08:02:38+01:00 INF Scanning subscriptions/...c8cb590 for Defender Status
2024-11-06T08:02:41+01:00 INF Scanning subscriptions/...c8cb590 for Advisor Recommendations
2024-11-06T08:04:26+01:00 INF Scanning subscriptions for Resource Count per Subscription and Type
2024-11-06T08:04:26+01:00 DBG resources | summarize count() by subscriptionId, type | order by subscriptionId, type
2024-11-06T08:04:28+01:00 INF Generating Report: azqr_action_plan_2024_11_06_T075919.xlsx
2024-11-06T08:05:23+01:00 INF Skipping Advisor. No data to render
2024-11-06T08:05:23+01:00 INF Skipping Costs. No data to render
2024-11-06T08:05:26+01:00 INF Scan completed.

Regards,
Red.

cmendible added a commit that referenced this issue Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants