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

Abierto Apto para principiantes
#56 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@SYED-IRTEZA-HUSSAIN-RIZVI ya está trabajando en esto.

Desde el 9/11/2026.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ollama, python
Área
ai, backend

Línea de trabajo

Empieza en bot.py, en wait_for_ollama(), y sigue cómo el controlador de eventos on_ready() gestiona sus errores y su valor de retorno. Añade una espera con límite de tiempo y una gestión de errores adecuada; después, verifica que el inicio pueda continuar o informar de que el servicio Ollama no está disponible cuando se alcance el límite.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Python
Estrellas
10
Forks
11
Merge medio
6 min
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AOSSIE-Org/SkillBot

Todos los issues de AOSSIE-Org/SkillBot

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.