rusq / slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.
GNU General Public License v3.0
1.6k stars 72 forks source link

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

Closed is-pdesai closed 4 months ago

is-pdesai commented 6 months ago

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):

rusq commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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