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

Editing slack export - FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/xxx/users.json' #37

Open
kar120p opened this issue Dec 11, 2024 · 0 comments

Comments

@kar120p
Copy link

kar120p commented Dec 11, 2024

I've been trying to get rid of a json file for a date in one of the public channels due to an issue the package throws when trying to process/import it.

I unzip the slack export, go to the thread and delete the file, then compress the folder again. When I specify the new .zip it throws an error saying a specific users.json file does not exist.

Traceback for file not found error

Traceback (most recent call last):
  File "/Users/username/.pyenv/versions/slacktodiscord-310/bin/slack-to-discord", line 8, in <module>
    sys.exit(main())
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/slack_to_discord/__main__.py", line 27, in main
    run_import(
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/slack_to_discord/importer.py", line 576, in run_import
    client = SlackImportClient(data_dir=t, **kwargs)
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/slack_to_discord/importer.py", line 399, in __init__
    self._users = slack_usermap(data_dir, real_names=real_names)
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/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/_j/bb8yx30n2vg6wp04h1m_3yn80000gn/T/tmpl7iqnocm/users.json'

Logs from running import, pubic channel date-file causing error

2024-12-11 11:35:46 DEBUG    discord.gateway For Shard ID None: WebSocket Event: {'t': None, 's': None, 'op': 11, 'd': None}
2024-12-11 11:36:27 DEBUG    discord.gateway Keeping shard ID None websocket alive with sequence 13.
2024-12-11 11:36:27 DEBUG    discord.gateway For Shard ID None: WebSocket Event: {'t': None, 's': None, 'op': 11, 'd': None}
2024-12-11 11:37:09 DEBUG    discord.gateway Keeping shard ID None websocket alive with sequence 13.
2024-12-11 11:37:09 DEBUG    discord.gateway For Shard ID None: WebSocket Event: {'t': None, 's': None, 'op': 11, 'd': None}
2024-12-11 11:37:50 DEBUG    discord.gateway Keeping shard ID None websocket alive with sequence 13.
2024-12-11 11:37:50 DEBUG    discord.gateway For Shard ID None: WebSocket Event: {'t': None, 's': None, 'op': 11, 'd': None}
2024-12-11 11:37:53 DEBUG    discord.webhook.async_ Webhook ID XXXXXXXX with POST https://discord.com/api/v10/webhooks/XXXXX/XXXXX has returned status code 524
2024-12-11 11:37:54 DEBUG    urllib3.connectionpool https://files.slack.com:443 "GET /files-pri/XXXXX/XXXXX HTTP/11" 200 127118547
2024-12-11 11:38:31 DEBUG    discord.gateway Received WSMessage(type=<WSMsgType.CLOSED: 257>, data=None, extra=None)
2024-12-11 11:38:31 DEBUG    discord.gateway Websocket closed with WSCloseCode.OK, cannot reconnect.
2024-12-11 11:38:31 DEBUG    discord.client Dispatching event disconnect
2024-12-11 11:38:31 DEBUG    slack_to_discord.importer Stopped import due to a BaseException
Traceback (most recent call last):
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/slack_to_discord/importer.py", line 422, in on_ready
    await self._run_import(g)
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/slack_to_discord/importer.py", line 532, in _run_import
    sent = await self._send_slack_msg(ch_send, msg)
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/slack_to_discord/importer.py", line 449, in _send_slack_msg
    sent = await send(
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/discord/webhook/async_.py", line 1843, in send
    data = await adapter.execute_webhook(
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/discord/webhook/async_.py", line 179, in request
    async with session.request(
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/aiohttp/client.py", line 1423, in __aenter__
    self._resp: _RetType = await self._coro
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/aiohttp/client.py", line 728, in _request
    await resp.start(conn)
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1036, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
  File "/Users/username/.pyenv/versions/3.10.15/envs/slacktodiscord-310/lib/python3.10/site-packages/aiohttp/streams.py", line 667, in read
    await self._waiter
asyncio.exceptions.CancelledError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant