Azure / azqr

Azure Quick Review

Home Page:https://azure.github.io/azqr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Retry: exit due to non-retriable status code panic: runtime error: invalid memory address or nil pointer dereference

tiagopalhota opened this issue · comments

Hi all,

I´m the owner of a subscription and I´m running Powershell 7.3.6. I´ve logged in to Azure through Azure CLI, set the right subscription and whenever I execute azqr scan I end up having the following error:

[Sep 6 16:43:25.589927] Retry: response 400
[Sep 6 16:43:25.589927] Retry: exit due to non-retriable status code
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0xece431]

goroutine 1 [running]:
github.com/Azure/azqr/internal/scanners.(*DiagnosticSettingsScanner).ListResourcesWithDiagnosticSettings(0xc0002cb2b0)
D:/a/azqr/azqr/internal/scanners/diagnostics_settings.go:46 +0xf1
github.com/Azure/azqr/cmd/azqr.scan(0x0?, {0xc0004d5868, 0x20, 0xa877ad?})
D:/a/azqr/azqr/cmd/azqr/scan.go:232 +0xd12
github.com/Azure/azqr/cmd/azqr.glob..func28(0x233da60?, {0x23b37f8?, 0x0?, 0x0?})
D:/a/azqr/azqr/cmd/azqr/scan.go:110 +0x685
github.com/spf13/cobra.(*Command).execute(0x233da60, {0x23b37f8, 0x0, 0x0})
C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0x233d1c0)
C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/Azure/azqr/cmd/azqr.Execute()
D:/a/azqr/azqr/cmd/azqr/root.go:36 +0x39c
main.main()
D:/a/azqr/azqr/cmd/main.go:11 +0x17

I´ve also executed azqr scan > azqr_results and the file is attached here.

azqr_results.txt

Please ignore, I thought that by logging in with azure cli and setting the right subscription, that would end up being used when azqr was called without any subscription_id. Apparently, this was not the case and was using some other subscription where I don´t have enough rights.

Thanks for reaching out! The issue causing the panic be fixed in our next release.

To clarify scan command without parameters iterates through all subscriptions that you have access to, but you need to be reader of all. If you want to scan for a specific subscription use the -s parameter.