turbot / steampipe

Zero-ETL, infinite possibilities. Live query APIs, code & more with SQL. No DB required.
https://steampipe.io
GNU Affero General Public License v3.0
6.66k stars 262 forks source link

Tables from Azure and AWS returns this invalid memory address or nil pointer dereference #4279

Open jeffreymp17 opened 1 month ago

jeffreymp17 commented 1 month ago

Describe the bug There are some tables that returns this error invalid memory address or nil pointer dereference when we execute a query for example Azure tables

SELECT 
  scc.id, 
  sub.subscription_id, 
  sub.display_name, 
  scc.email, 
  scc.alert_notifications, 
  scc.alerts_to_admins 
FROM 
  azure_security_center_contact AS scc 
  INNER JOIN azure_subscription AS sub ON sub.subscription_id = scc.subscription_id 
WHERE 
  scc.alert_notifications = 'On';

and this one


select
  sa.subscription_id,
  sa.name,
  sa.id as resource,
  sa.network_rule_default_action,
  resource_group,
  sub.display_name as subscription
from
  azure_storage_account sa,
  azure_subscription sub
where
  sub.subscription_id = sa.subscription_id and
  sa.network_rule_default_action = 'Allow';

GCP queries

select 
  name, 
  cluster_name, 
  config ->> 'imageType' as image_type, 
  location, 
  project 
from 
  gcp_kubernetes_node_pool 
where 
  config ->> 'imageType' != 'COS_CONTAINERD';
select 
  name, 
  cluster_name, 
  initial_node_count, 
  version, 
  status, 
  project, 
  autoscaling -> 'enabled' as autoscaling_enabled, 
  location 
from 
  gcp_kubernetes_node_pool 
where 
  autoscaling ->> 'enabled' != 'true' 
  or autoscaling = '{}';

Steampipe version (steampipe -v) Example: v0.19.3

To reproduce Execute the queries added in the description

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

Additional context Add any other context about the problem here.

ParthaI commented 1 month ago

Hello, @jeffreymp17, sorry to see that you are experiencing the error. Could you please try with the latest Steampipe CLI version and the latest plugin version? Please let us know if the error still persists. Thanks!

jeffreymp17 commented 1 week ago

I updated steampipe to v0.23.2 and the issue is still happening, but in this case are GCP tables

jeffreymp17 commented 1 week ago

@ParthaI is there a plan to review this issue? Thanks in advance

ParthaI commented 6 days ago

Hello @jeffreymp17,

As per my observation, there was a breaking change in the Steampipe SDK version 5.10.0. However, this issue has been fixed in SDK version 5.10.1. I have pushed a commit to the update-steampipe-sdk-version-5.10.1 branch in the GCP plugin, updating the SDK version to 5.10.1.

Could you please try using the PR branch and let me know if the issue still persists?

Steps to build the plugin from the update-steampipe-sdk-version-5.10.1 branch:

  1. Clone the repository: git clone https://github.com/turbot/steampipe-plugin-gcp.git
  2. Navigate to the repository:cd steampipe-plugin-gcp
  3. Checkout the specified branch:git checkout update-steampipe-sdk-version-5.10.1
  4. Build the plugin:make
  5. Execute the query.

Note: Before running the query, please terminate all running Steampipe processes.

Thanks!