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.51k stars 70 forks source link

Application error while dumping a slack channel #280

Closed Dvik closed 5 months ago

Dvik commented 6 months ago

Describe the bug Got application error while dumping a slack channel

2024/04/05 16:35:36 application error: export error: error exporting conversation C031LU2KL8B: failed to dump "syncup" (C031LU2KL8B): callback was unable to complete without errors within the allowed number of retries

It works fine for other channels. It's failing only for this channel. The above error log is also not verbose enough to know why it's failing.

Authentication type (please read) SSO

To Reproduce Steps to reproduce the behavior: Run slackdump like this ./slackdump -export my-workspace.zip C031LU2KL8B

Expected behavior Entire data should be downloaded.

Output It continued logging for 10mins and then failed.

..............................................................................
................................................................................
2024/04/05 19:47:27   thread fetch complete, total: 2
2024/04/05 19:47:27   thread request #    1, fetched:   17, total:       17, process results:  (speed:  32.72/sec, avg:  32.72/sec)
2024/04/05 19:47:27   thread fetch complete, total: 17
2024/04/05 19:47:28   thread request #    1, fetched:    2, total:        2, process results:  (speed:   4.96/sec, avg:   4.96/sec)
2024/04/05 19:47:28   thread fetch complete, total: 2
2024/04/05 19:47:28   thread request #    1, fetched:    3, total:        3, process results:  (speed:   5.86/sec, avg:   5.86/sec)
2024/04/05 19:47:28   thread fetch complete, total: 3
2024/04/05 19:47:29   thread request #    1, fetched:    8, total:        8, process results:  (speed:  19.52/sec, avg:  19.52/sec)
2024/04/05 19:47:29   thread fetch complete, total: 8
2024/04/05 19:47:29   thread request #    1, fetched:    4, total:        4, process results:  (speed:   9.79/sec, avg:   9.79/sec)
2024/04/05 19:47:29   thread fetch complete, total: 4
2024/04/05 19:47:29   thread request #    1, fetched:   15, total:       15, process results:  (speed:  36.34/sec, avg:  36.34/sec)
2024/04/05 19:47:29   thread fetch complete, total: 15
2024/04/05 19:47:40   thread request #    1, fetched:    3, total:        3, process results:  (speed:   0.28/sec, avg:   0.28/sec)
2024/04/05 19:47:40   thread fetch complete, total: 3
2024/04/05 19:47:41   thread request #    1, fetched:    4, total:        4, process results:  (speed:   9.73/sec, avg:   9.73/sec)
2024/04/05 19:47:41   thread fetch complete, total: 4
2024/04/05 19:47:41   thread request #    1, fetched:    6, total:        6, process results:  (speed:  11.65/sec, avg:  11.65/sec)
2024/04/05 19:47:41   thread fetch complete, total: 6
2024/04/05 19:49:52 application error: export error: error exporting conversation C031LU2KL8B: failed to dump "syncup" (C031LU2KL8B): callback was unable to complete without errors within the allowed number of retries

Desktop (please complete the following information):

Additional context This channel is a slack connect private channel. However, there are other private channels also which are slack connect channels in this same workspace for which i'm able to download the data.

rusq commented 5 months ago

Hey @Dvik , thanks for the report!

I think I know what's going on , there's a progressive wait on API error, it's just not clear in non-verbose output what error has happened. I suspect that an error that can not be recovered is attempting to be recovered. For Tier2 the default number of retries is set to 20.

Could you please repeat this command with -v and -trace=trace.out flags, like so:

./slackdump -v -log=i280.log -trace=trace.out -t2-retries=3 -export my-workspace.zip C031LU2KL8B 

It will fail, but it will fail faster.

After that, could you please:

  1. encrypt the trace.out with this GPG key: https://github.com/rusq.gpg and upload it.
  2. Attach the resulting i280.log file which will contain the verbose log output. You can encrypt it too, if you wish.

The trace file does not contain any secrets, but may contain the workspace name, though I think I removed that long time ago.

Dvik commented 5 months ago

Hmmm..once i ran it with the above command, it succeeded. I do see a lot of slack rate limit exceeded messages in the i280.log file now though but at last, it was successful in exporting the entire channel.

Not sure why it's successful when running with log and trace though or is it bcs of -t2-retries=3?

rusq commented 5 months ago

That explains it - there's a retry logic on 500 server error, and most probable explanation is that something in that channel was returning 500, so it was retrying it. When you ran it for the second time after the server issue was resolved, you were able to download it.

The action item for me is to make the errors move obvious :)

Dvik commented 5 months ago

Thanks @rusq

rusq commented 5 months ago

No problem,

fixed in v2.5.8, it will display the underlying error should the retry fail.

rusq commented 5 months ago

(v3 fixed)