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

steampipe dashboard crashes on to_timestamp when value is millis not seconds #294

Closed
judell opened this issue Feb 9, 2023 · 6 comments
Closed
Labels
bug Something isn't working stale

Comments

@judell
Copy link
Contributor

judell commented Feb 9, 2023

This value comes from JavaScript.

    table {
      sql = <<EOQ
        select to_timestamp(1670377316386)
      EOQ
    }

The crash:

 Dashboard execution started: fedwiki.dashboard.fedwiki
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x16b28c5]

goroutine 155 [running]:
github.com/turbot/steampipe/pkg/dashboard/dashboardserver.buildLeafNodeUpdatedPayload(0x0)
        /home/runner/work/steampipe/steampipe/pkg/dashboard/dashboardserver/payload.go:187 +0xa5
github.com/turbot/steampipe/pkg/dashboard/dashboardserver.(*Server).HandleDashboardEvent(0xc0008800f0, {0x22935e8, 0xc0004520c0}, {0x227f600?, 0x0?})
        /home/runner/work/steampipe/steampipe/pkg/dashboard/dashboardserver/server.go:149 +0x5b1
github.com/turbot/steampipe/pkg/workspace.(*Workspace).handleDashboardEvent(0xc0004e6000, {0x22935e8, 0xc0004520c0})
        /home/runner/work/steampipe/steampipe/pkg/workspace/workspace_events.go:71 +0x104
created by github.com/turbot/steampipe/pkg/workspace.(*Workspace).RegisterDashboardEventHandler
        /home/runner/work/steampipe/steampipe/pkg/workspace/workspace_events.go:47 +0xed

The fix:

    table {
      sql = <<EOQ
        select to_timestamp(1670377316386 / 1000)
      EOQ
    }
@judell judell added the bug Something isn't working label Feb 9, 2023
@github-actions
Copy link

'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

@github-actions github-actions bot added the stale label Apr 10, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 90 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2023
@kaidaguerre kaidaguerre reopened this Dec 18, 2023
@github-actions github-actions bot removed the stale label Dec 19, 2023
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Feb 18, 2024
@github-actions github-actions bot removed the stale label Mar 9, 2024
@pskrbasu pskrbasu transferred this issue from turbot/steampipe Mar 19, 2024
@pskrbasu
Copy link
Collaborator

Reproduced with Powerpipe v0.1.3.

dashboard "testing_card_blocks" {
  title = "Testing card blocks"

  container {
    card "card1" {
      sql = <<-EOQ
        select 1 as card1_value
      EOQ
      width = 2
    }

    card "card2" {
      type  = "info"
      width = 2
      sql = <<-EOQ
        select to_timestamp(1670377316386)
      EOQ
    }
  }
}
[ Wait    ] Starting WorkspaceEvents Server
[ Message ] WorkspaceEvents loaded
[ Message ] Initialization complete
[ Ready   ] Dashboard server started on 9033 and listening on local
[ Message ] Visit http://localhost:9033
[ Message ] Press Ctrl+C to exit
[ Wait    ] WorkspaceEvents execution started: dashboard_cards.dashboard.testing_card_blocks
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x105f4b45c]

goroutine 86 [running]:
github.com/turbot/powerpipe/internal/dashboardserver.buildLeafNodeUpdatedPayload(0x0)
        /go/src/powerpipe/internal/dashboardserver/payload.go:261 +0x8c
github.com/turbot/powerpipe/internal/dashboardserver.(*Server).HandleDashboardEvent(0x14000864100, {0x10848fd90?, 0x1400054e580}, {0x1084741a0?, 0x0?})
        /go/src/powerpipe/internal/dashboardserver/server.go:146 +0x710
github.com/turbot/powerpipe/internal/dashboardworkspace.(*WorkspaceEvents).handleDashboardEvent(0x14000937740, {0x10848fd90, 0x1400054e580})
        /go/src/powerpipe/internal/dashboardworkspace/workspace_events.go:66 +0x118
created by github.com/turbot/powerpipe/internal/dashboardworkspace.(*WorkspaceEvents).RegisterDashboardEventHandler in goroutine 1
        /go/src/powerpipe/internal/dashboardworkspace/workspace_events.go:42 +0xe0

powerpipe query run "select to_timestamp(1670377316386)" - WORKS
steampipe query "select to_timestamp(1670377316386)" - WORKS

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label May 19, 2024
Copy link

This issue was closed because it has been stalled for 90 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 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 stale
Projects
None yet
Development

No branches or pull requests

3 participants