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

[BUG] Unexpected Bucket Already Locked Error #1736

Open
4 tasks done
BigChungus888 opened this issue Sep 11, 2024 · 0 comments
Open
4 tasks done

[BUG] Unexpected Bucket Already Locked Error #1736

BigChungus888 opened this issue Sep 11, 2024 · 0 comments

Comments

@BigChungus888
Copy link

BigChungus888 commented Sep 11, 2024

Library Version

5.13.2

Describe the Bug

Currently unable to consistently report it and not sure the cause. It occurs sometimes and sometimes it works fine. Basically, I run fetch_user (without force=True) in an autocomplete function. Then I get bucket already locked at times.

Steps to Reproduce

  1. Create a command with autocomplete.
  2. Do fetch_user in the autocomplete function.

Expected Results

No error produced.

Minimal Reproducible Code

@base_info.autocomplete(option_name="base_link")
async def base_autocomplete(self, ctx: ipy.AutocompleteContext):
    for some_id in some_ids:
        await self.bot.fetch_user(some_id)
    return some_choices

Traceback

Traceback (most recent call last):
  File "/home/container/.local/lib/python3.11/site-packages/interactions/client/client.py", line 2018, in __dispatch_interaction
    response = await callback
               ^^^^^^^^^^^^^^
  File "/home/container/cogs/BaseCommands.py", line 205, in base_autocomplete
    builder = await self.bot.fetch_user(base_data["builder"]) if base_data["builder"] else "@anonymous"
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/container/.local/lib/python3.11/site-packages/interactions/client/client.py", line 2366, in fetch_user
    return await self.cache.fetch_user(user_id, force=force)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/container/.local/lib/python3.11/site-packages/interactions/client/smart_cache.py", line 120, in fetch_user
    data = await self._client.http.get_user(user_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/http/http_requests/users.py", line 38, in get_user
    return await self.request(Route("GET", "/users/{user_id}", user_id=user_id))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/http/http_client.py", line 446, in request
    await lock.lock_for_duration(lock.delta, block=True)
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/http/http_client.py", line 188, in lock_for_duration
    raise RuntimeError("Attempted to lock a bucket that is already locked.")
RuntimeError: Attempted to lock a bucket that is already locked.

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.
  • I have attempted to debug this myself, and I believe this issue is with the library

Additional Information

No response

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