turbot / steampipe-plugin-azure

Use SQL to instantly query Azure resources across regions and subscriptions. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/azure
Apache License 2.0
34 stars 15 forks source link

Table from Azure returns invalid memory address or nil pointer dereference #791

Open halit-c4c opened 1 week ago

halit-c4c commented 1 week ago

Describe the bug I'm using turbot pipes and trying to run a query. But I got an error:

"azure_compute_virtual_machine" table returns error: ERROR: rpc error: code = Unknown desc = c4ctest_azure: failed to populate column 'power_state': rpc error: code = Internal desc = transform getPowerState failed with panic runtime error: invalid memory address or nil pointer dereference (SQLSTATE HV000) query: select * from azure_compute_virtual_machine limit 100;

Steampipe version (steampipe -v) I'm using turbot pipes

Plugin version (steampipe plugin list) I'm using turbot pipes

To reproduce Execute the querie added in the description

Expected behavior Should not receive the error "invalid memory address or nil pointer dereference" and return results

Additional context Add any other context about the problem here.

ParthaI commented 1 week ago

Hello @halit-c4c,

I apologize for the inconvenience.

I investigated the issue but was unable to replicate the error in my local environment. All the time I am getting the result without any error.

Here are the results for the VM named test-power:

  1. Creating state
> select name, power_state from azure_compute_virtual_machine
+-----------------+-------------+
| name            | power_state |
+-----------------+-------------+
| tets-delete     | deallocated |
| test-power      |             |
| turbottest95054 | running     |
+-----------------+-------------+
  1. Starting state
> select name, power_state from azure_compute_virtual_machine
+-----------------+-------------+
| name            | power_state |
+-----------------+-------------+
| turbottest95054 | running     |
| test-power      | starting    |
| tets-delete     | deallocated |
+-----------------+-------------+
  1. Running state
> select name, power_state from azure_compute_virtual_machine
+-----------------+-------------+
| name            | power_state |
+-----------------+-------------+
| turbottest95054 | running     |
| test-power      | running     |
| tets-delete     | deallocated |
+-----------------+-------------+
  1. Stopping state
> select name, power_state from azure_compute_virtual_machine
+-----------------+--------------+
| name            | power_state  |
+-----------------+--------------+
| turbottest95054 | running      |
| test-power      | deallocating |
| tets-delete     | deallocated  |
+-----------------+--------------+
  1. Stopped state
> select name, power_state from azure_compute_virtual_machine
+-----------------+-------------+
| name            | power_state |
+-----------------+-------------+
| turbottest95054 | running     |
| test-power      | deallocated |
| tets-delete     | deallocated |
+-----------------+-------------+
  1. Terminating state
> select name, power_state from azure_compute_virtual_machine
+-----------------+-------------+
| name            | power_state |
+-----------------+-------------+
| tets-delete     | deallocated |
| test-power      |             |
| turbottest95054 | running     |
+-----------------+-------------+

Could you please provide more context about the steps you took to reproduce the error? Also, could you please confirm if you are able to replicate the same in your local environment?

Thank you!