Repository navigation
!d discord not working correctly #3326
Copy link
Copy link
Open
Labels
a: informationRelated to information commands: (doc, help, information, reddit, site, tags)Related to information commands: (doc, help, information, reddit, site, tags)
Description
Invoking !d discord to lookup the the discord.py documentation is currently not working as intended. It causes the bot start typing and never produces an output.
It seems to be a specific issue with the discord look-up in particular, but more work into what specifically the error could be caused by is needed. The logging present currently isn't enough to trace down the specific issue in production.
It could possibly be an issue with the refresh docs method here:
Lines 211 to 229 in ad6c7f8
| async def refresh_inventories(self) -> None: | |
| """Refresh internal documentation inventories.""" | |
| self.refresh_event.clear() | |
| await self.symbol_get_event.wait() | |
| log.debug("Refreshing documentation inventory...") | |
| self.inventory_scheduler.cancel_all() | |
| self.base_urls.clear() | |
| self.doc_symbols.clear() | |
| self.renamed_symbols.clear() | |
| await self.item_fetcher.clear() | |
| coros = [ | |
| self.update_or_reschedule_inventory(package["package"], package["base_url"], package["inventory_url"]) | |
| for package in await self.bot.api_client.get("bot/documentation-links") | |
| ] | |
| await asyncio.gather(*coros) | |
| log.debug("Finished inventory refresh.") | |
| self.refresh_event.set() |
That method does not check if a refresh is already underway.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: informationRelated to information commands: (doc, help, information, reddit, site, tags)Related to information commands: (doc, help, information, reddit, site, tags)

Activity
DragonSenseiGuy commentedon Sep 26, 2025
Works for me here
jb3 commentedon Sep 26, 2025
It does not always produce this result, we haven't seen this behaviour in a bit I don't think but it's (as specified originally) not something that always manifests.
L3viathan commentedon Oct 7, 2025
Happened again yesterday after I attempted to remove the
disnakeinventory (because it seemed to have moved). After that, all!dinvocations led to this issue until the bot was restarted.wookie184 commentedon Oct 7, 2025
Reproduction
The stuck typing issue is reproducable by running:
!d setdoc disnake https://docs.disnake.dev/en/latest/objects.inv https://docs.disnake.dev/en/latest/api/!d disnake.Role.color!d refreshdocIssue
Due to the invalid base URL
!d disnake.Role.colorfails with this tracebackThis method is where the issue is introduced
bot/bot/exts/info/doc/_batch_parser.py
Lines 99 to 123 in f0e4d45
Normally:
self._item_futuresHowever, in our case, 2 failed, meaning 3 and 4 were not run, so there is a future stuck in
self._item_futuresthat will never be resolved.This becomes an issue when the refresh command is run, as it waits for the futures in
self._item_futuresto resolve, which will never happen for these stuck futures.bot/bot/exts/info/doc/_batch_parser.py
Lines 187 to 188 in f0e4d45
Fix
A simple fix would be to catch the exception from the http session and immediately
set_result(None)on the future.This code feels very fragile and complex currently though, so having a deeper look and considering a refactor may be worth looking into (though wouldn't need to be block an initial fix).
I have not looked into the code further to see if there are other related issues.