slackdump icon indicating copy to clipboard operation
slackdump copied to clipboard

When using `view` received runtime_error invalid memory address or nil pointer dereference

Open is-pdesai opened this issue 1 year ago • 1 comments

Describe the bug When using view command to render an export, received the following error:

template: index.html:148:10: executing "render_message" at : error calling render: runtime error: invalid memory address or nil pointer dereference

To Reproduce Steps to reproduce the behavior:

  1. Run slackdump like this go run ./cmd/slackdump view filename.zip

Expected behavior To view the entire file for an export of a channel with a lot of content.

Output

2024/05/20 09:01:33 ERROR error rendering block error="missing handler for type usergroup called in renderer.(*Slack).rteSection" block_type=rich_text message_ts=1564005317.019000
{
  "type": "rich_text",
  "block_id": "qhqy",
  "elements": [
    {
      "type": "rich_text_section",
      "elements": [
        {
          "type": "usergroup",
          "usergroup_id": "SLT01M939"
        },
        {
          "type": "text",
          "text": " test"
        }
      ]
    }
  ]
}
2024/05/20 09:01:33 ERROR error rendering block error="missing handler for type usergroup called in renderer.(*Slack).rteSection" block_type=rich_text message_ts=1564755978.111900
{
  "type": "rich_text",
  "block_id": "9/w9/",
  "elements": [
    {
      "type": "rich_text_section",
      "elements": [
        {
          "type": "usergroup",
          "usergroup_id": "SLT01M939"
        },
        {
          "type": "text",
          "text": " I'm back up; hopping in my webex room now. Can plan to start about 10:30, if I don't hear anything "
        },
        {
          "type": "emoji",
          "name": "slightly_smiling_face",
          "skin_tone": 0
        }
      ]
    }
  ]
}
2024/05/20 09:01:33 ERROR error rendering block error="missing handler for type color called in renderer.(*Slack).rteSection" block_type=rich_text message_ts=1567169859.007300
{
  "type": "rich_text",
  "block_id": "arhEv",
  "elements": [
    {
      "type": "rich_text_section",
      "elements": [
        {
          "type": "color",
          "value": "#2475D9"
        },
        {
          "type": "text",
          "text": ","
        },
        {
          "type": "color",
          "value": "#FC6215"
        },
        {
          "type": "text",
          "text": ","
        },
        {
          "type": "color",
          "value": "#FFFFFF"
        },
        {
          "type": "text",
          "text": ","
        },
        {
          "type": "color",
          "value": "#0A4B8C"
        },
        {
          "type": "text",
          "text": ","
        },
        {
          "type": "color",
          "value": "#FD8B24"
        },
        {
          "type": "text",
          "text": ","
        },
        {
          "type": "color",
          "value": "#FFFFFF"
        },
        {
          "type": "text",
          "text": ","
        },
        {
          "type": "color",
          "value": "#46BE6E"
        },
        {
          "type": "text",
          "text": ","
        },
        {
          "type": "color",
          "value": "#EE2436"
        }
      ]
    }
  ]
}
2024/05/20 09:01:33 WARN channel not found channel_id=CV3T5TLEQ
2024/05/20 09:01:33 WARN channel not found channel_id=C79T3DMUH
2024/05/20 09:01:33 WARN channel not found channel_id=CUT6UEYNT
2024/05/20 09:01:33 WARN channel not found channel_id=C7NHCKU57
2024/05/20 09:01:33 WARN channel not found channel_id=CF9REP0J0
2024/05/20 09:01:33 WARN channel not found channel_id=CF9REP0J0
2024/05/20 09:01:33 WARN channel not found channel_id=C7GNNTPK6
2024/05/20 09:01:33 WARN channel not found channel_id=C7NHCKU57
2024/05/20 09:01:33 WARN channel not found channel_id=C014C5Z0LF4
2024/05/20 09:01:33 WARN channel not found channel_id=CJWL8AQEM
2024/05/20 09:01:33 WARN channel not found channel_id=CF98TGACD
view: 2024/05/20 09:01:33 error: template: index.html:148:10: executing "render_message" at <render .>: error calling render: runtime error: invalid memory address or nil pointer dereference

Desktop (please complete the following information):

  • OS: [e.g. macOS] macOS
  • OS Version: [e.g. 14.1] 14.4.1
  • Slackdump Version: [e.g. 2.4.2] v3-wiz

is-pdesai avatar May 20 '24 13:05 is-pdesai

Thanks for testing, viewer is early alpha, so it's expected to break. The verbose messages that you posted are quite useful - this means that some block type is not implemented, in this case it's the "usergroup" and "color".

rusq avatar Jun 30 '24 09:06 rusq

I added support for these two types, it's now in "master" branch, this should fix unsupported block types, and also I'm keen to see if it fixes the panic?

rusq avatar Jul 12 '24 11:07 rusq

Since I have not received a response, I'm closing this.

rusq avatar Jul 25 '24 11:07 rusq