pR0Ps / slack-to-discord

Import a Slack export into a Discord server
https://pypi.org/project/slack-to-discord/
78 stars 11 forks source link

FileNotFoundError users.json #30

Closed jtauber closed 1 year ago

jtauber commented 1 year ago

On Python 3.11 / macOS 13.5.2, getting the following error:

File "/Users/jtauber/.local/share/virtualenvs/slack-to-discord-PJmOEO33/lib/python3.11/site-packages/slack_to_discord/importer.py", line 79, in slack_usermap
    with open(os.path.join(d, "users.json"), "rb") as fp:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/84/8xqd623s1yv722tvxk7vg5km0000gn/T/tmp_22k3ie9/users.json'
pR0Ps commented 1 year ago

As far as I know, that file is always provided in the export zip. It's where all the information on users is stored so without it the import isn't going to work very well. I just did a fresh export of a server and the file was definitely there. Is it possible that the file was deleted out of your export somehow? What files does your export contain?

jtauber commented 1 year ago

Oh, let me investigate that more. Thanks so much for the response. I'll dig in more and try to work out what's going on (and hopefully if someone else hits the same issue, they can find a solution here).

jtauber commented 1 year ago

Okay, I think I got to the bottom of it:

When I downloaded the export from Slack, macOS expanded it into a folder. I recompressed the file and gave slack-to-discord that file but it seems the structure within that new .zip is not what was expected (there's an enclosing folder that I bet slack-to-discord is not expecting).

jtauber commented 1 year ago

I think I can solve it from here so I will close this issue but hopefully if someone else makes the same mistake as me, this thread will be helpful :-)