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

cannot unmarshal array into Go value of type map[string]interface {} on Cloudflare provider #3

Open
1 of 3 tasks
jreyesr opened this issue Aug 12, 2023 · 0 comments
Open
1 of 3 tasks
Assignees
Labels
bug Something isn't working

Comments

@jreyesr
Copy link
Owner

jreyesr commented Aug 12, 2023

Terraform backing provider

Name: cloudflare/cloudflare
Version: 4.12.0

SPC file

(remember to remove any confidential tokens from the SPC file, and replace them with dummy data)

connection "tfbridge" {
  plugin = "jreyesr/tfbridge"

  provider = "cloudflare/cloudflare"
  version = "4.12.0"

  provider_config = <<EOT
    api_token = "someAPItoken"
  EOT
}

When does the error happen?

  • When loading the plugin (i.e. while Steampipe is booting)
  • When .inspecting the tables provided by the plugin
  • When running a SQL query that involves the plugin

SQL query

(if the error appears when running a SQL query)

select * from cloudflare_zones where filter='[{"status": "active"}]'

Error

json: cannot unmarshal array into Go value of type map[string]interface {}

image

Steampipe log file

(before running steampipe query, run export STEAMPIPE_LOG_LEVEL=debug and export TF_LOG_PROVIDER=debug, to increase the verbosity of the logs)

(search for the current day in ~/.steampipe/logs/plugin-*.log and paste the relevant contents here, since the last boot of Steampipe. Alternatively, run tail -f ~/.steampipe/logs/plugin-*.log, then start Steampipe and cause the error, and then copy all the logs since Steampipe booted here. Feel free to remove any secret data such as API keys from the logs before pasting them)

(⚠ be careful, since high-verbosity logs WILL expose configuration items, such as API keys. You're encouraged to rotate the API credentials used after submitting the issue. I'll try to warn you if I find such credentials in the logs)

Steampipe logs
2023-08-13 17:31:53.140 UTC [DEBUG] steampipe-plugin-tfbridge.plugin: [DEBUG] 1691947913462: readDataSource: dsSchema="&{0 0xc01763f380}" dsSchemaType="{{{} map[filter:{{{} {{{} map[account_id:{{{} 83}} lookup_type:{{{} 83}} match:{{{} 83}} name:{{{} 83}} paused:{{{} 66}} status:{{{} 83}}] map[]}}}} id:{{{} 83}} zones:{{{} {{{} map[id:{{{} 83}} name:{{{} 83}}] map[]}}}}] map[]}}"
2023-08-13 17:31:53.140 UTC [WARN]  steampipe-plugin-tfbridge.plugin: [WARN]  1691947913462: tfbridge.ListDataSource.readDataSource: name=cloudflare_zones
2023-08-13 17:31:53.140 UTC [WARN]  steampipe-plugin-tfbridge.plugin: [WARN]  1691947913462: doList callHydrateWithRetries (tfbridge-1691947913462) returned err json: cannot unmarshal array into Go value of type map[string]interface {}
2023-08-13 17:31:53.140 UTC [WARN]  steampipe-plugin-tfbridge.plugin: [WARN]  1691947913462: QueryData StreamError json: cannot unmarshal array into Go value of type map[string]interface {} (tfbridge-1691947913462)
@jreyesr jreyesr added the bug Something isn't working label Aug 12, 2023
@jreyesr jreyesr self-assigned this Aug 12, 2023
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

No branches or pull requests

1 participant