[BUG]: wait_for_ollama() Retries Indefinitely When Ollama Is Unavailable

Ouverte Adaptée aux débutants
#56 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@SYED-IRTEZA-HUSSAIN-RIZVI y travaille déjà.

Depuis le 9/11/2026.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
72/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
ollama, python
Domaine
ai, backend

Piste de recherche

Commencez dans bot.py, au niveau de wait_for_ollama(), et suivez la manière dont le gestionnaire d’événement on_ready() traite ses erreurs et sa valeur de retour. Ajoutez une attente limitée dans le temps avec une gestion appropriée des échecs, puis vérifiez que le démarrage peut se poursuivre ou signaler l’indisponibilité du service Ollama une fois la limite atteinte.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug enhancement
Bug Description

The wait_for_ollama() function in bot.py contains an unconditional while True loop that continuously checks whether the Ollama service is available.

When Ollama is unavailable, unreachable, or fails to return a successful response, the function catches the request error, waits for 10 seconds, and retries again. However, there is no maximum retry count or overall timeout to stop this process.

Since wait_for_ollama() is called from the Discord bot's on_ready() event handler, the bot's readiness workflow can remain blocked indefinitely while Ollama is unavailable.

As a result, subsequent operations within on_ready(), including the backlog scan, cannot execute until Ollama becomes reachable. The same behavior can occur during Discord reconnections because on_ready() is invoked again after a connection is re-established.

The function currently lacks a defined timeout, retry limit, or failure-handling mechanism for prolonged Ollama unavailability.

Steps to Reproduce
  1. Ensure that the SkillBot project dependencies are installed and the bot is configured correctly.
  2. Stop the local Ollama service running on port 11434.
  3. Start the SkillBot application while Ollama remains unavailable.
  4. Allow the bot to execute the wait_for_ollama() function during its startup process.
  5. Observe the application logs for Ollama connection retry messages.
  6. Keep the Ollama service stopped and observe that the function continues retrying every 10 seconds.
  7. Verify that the function does not terminate after a defined number of attempts or a maximum waiting duration.

Expected Result:

The function should stop retrying after a configurable timeout or maximum number of attempts and handle Ollama unavailability gracefully.

Actual Result:

The function continues retrying every 10 seconds indefinitely while Ollama remains unavailable.

Logs and Screenshots

No response

Environment Details

Operating System: Windows 11
Programming Language: Python 3.11.3
Application: SkillBot (Discord Bot)
Discord Library: discord.py 2.7.1
LLM Runtime: Ollama (Local)
Ollama API Endpoint: http://localhost:11434/
Affected File: bot.py
Affected Function: wait_for_ollama()
Affected Workflow: Bot startup and Discord reconnection
Retry Interval: 10 seconds

Impact

High - Major feature is broken

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Langage dominant
Python
Étoiles
10
Forks
11
Merge moyen
6 min
PR mergées (30 j)
4

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de AOSSIE-Org/SkillBot

Toutes les issues de AOSSIE-Org/SkillBot

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.