[GH-ISSUE #8202] Throw error "Ie.messages is not iterable" in Chat.svelte #118348

Closed
opened 2026-05-20 19:45:58 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @thfai2000 on GitHub (Dec 30, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8202

Bug Report

Openweb UI is very great although I know it is still under development.
I encountered an issue (I'm not sure if it a bug or not) in using the Action Function. Can anyone can help to solve my issue?
Thank you.

Description

Bug Summary:
When I tried to use the "Action", it doesn't work. There is a javascript error shown on chrome console.
image

Threw an error "Ie.messages is not iterable" in Chat.svelte. See my screenshots below.
The javascript object is a empty object. I guess (I traced the code) it is because that web api call gave a empty object.
image

Installation Method

Start using docker

docker compose up
#docker-compose.yaml
services:
  ollama:
    volumes:
      - ollama:/root/.ollama
    container_name: ollama
    pull_policy: always
    tty: true
    restart: unless-stopped
    image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest}
    deploy:
        resources:
          reservations:
            devices:
              - driver: ${OLLAMA_GPU_DRIVER-nvidia}
                count: ${OLLAMA_GPU_COUNT-1}
                capabilities:
                  - gpu
  open-webui:
    build:
      context: .
      args:
        OLLAMA_BASE_URL: '/ollama'
      dockerfile: Dockerfile
    image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
    container_name: open-webui
    volumes:
      - open-webui:/app/backend/data
    depends_on:
      - ollama
    ports:
      - ${OPEN_WEBUI_PORT-3000}:8080
    environment:
      - 'OLLAMA_BASE_URL=http://ollama:11434'
      - 'WEBUI_SECRET_KEY='
    extra_hosts:
      - host.docker.internal:host-gateway
    restart: unless-stopped
    privileged: true

volumes:
  ollama: {}
  open-webui: {}

Environment

  • Open WebUI Version: v0.5.2

  • Ollama (if applicable): 0.5.4-0-g2ddc32d-dirty

  • Operating System: Window 11 (But I run on WSL2 on docker cgroup2)

  • Browser (if applicable): 131.0.6778.205

Confirmation:

  • [v ] I have read and followed all the instructions provided in the README.md.
  • [v ] I am on the latest version of both Open WebUI and Ollama.
  • [v ] I have included the browser console logs.
  • [v] I have included the Docker container logs.
  • [v ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

I expected there is something (e.g. status shown) changed on the user interface after clicking the "Action" click on the dialog. besides, there should be an new message added into the dialog.
image

Actual Behavior:

There is no effect on user interface and there is javascript error.
Throw error "Ie.messages is not iterable" in Chat.svelte.

Reproduction Details

Steps to Reproduce:

  1. Create a Function "Action"
"""
title: Example Action
author: open-webui
author_url: https://github.com/open-webui
funding_url: https://github.com/open-webui
version: 0.1.0
required_open_webui_version: 0.3.9
"""

from pydantic import BaseModel, Field
from typing import Optional, Union, Generator, Iterator

import os
import requests
import asyncio


class Action:
    class Valves(BaseModel):
        pass

    def __init__(self):
        self.valves = self.Valves()
        pass

    async def action(
        self,
        body: dict,
        __user__=None,
        __event_emitter__=None,
        __event_call__=None,
    ) -> Optional[dict]:
        print(f"action:{__name__}")

        # response = await __event_call__(
        #     {
        #         "type": "input",
        #         "data": {
        #             "title": "write a message",
        #             "message": "here write a message to append",
        #             "placeholder": "enter your message",
        #         },
        #     }
        # )
        # print(response)

        if __event_emitter__:
            await __event_emitter__(
                {
                    "type": "status",
                    "data": {"description": "adding message", "done": False},
                }
            )
            await asyncio.sleep(1)
            await __event_emitter__(
                {"type": "message", "data": {"content": "Testing message here"}}
            )
            await __event_emitter__(
                {
                    "type": "status",
                    "data": {"description": "added message", "done": True},
                }
            )

  1. Enable the Action for the Model
    image
  2. Click the "Action"'s button in a message on the conversation dialog
  3. You will find there is no effect and there is javascript error

Logs and Screenshots

Browser Console Logs:

image

image
image
image

Docker Container Logs:
image
Screenshots/Screen Recordings (if applicable):

Additional Information

n/a

Note

n/a

Originally created by @thfai2000 on GitHub (Dec 30, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8202 # Bug Report Openweb UI is very great although I know it is still under development. I encountered an issue (I'm not sure if it a bug or not) in using the Action Function. Can anyone can help to solve my issue? Thank you. ## Description **Bug Summary:** When I tried to use the "Action", it doesn't work. There is a javascript error shown on chrome console. ![image](https://github.com/user-attachments/assets/4aae1433-978e-46fd-8391-9d3d554cc4e7) Threw an error "Ie.messages is not iterable" in Chat.svelte. See my screenshots below. The javascript object is a empty object. I guess (I traced the code) it is because that web api call gave a empty object. ![image](https://github.com/user-attachments/assets/b68db849-744b-4534-8983-265c9e2b0f21) ## Installation Method Start using docker ```bash docker compose up ``` ``` #docker-compose.yaml services: ollama: volumes: - ollama:/root/.ollama container_name: ollama pull_policy: always tty: true restart: unless-stopped image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest} deploy: resources: reservations: devices: - driver: ${OLLAMA_GPU_DRIVER-nvidia} count: ${OLLAMA_GPU_COUNT-1} capabilities: - gpu open-webui: build: context: . args: OLLAMA_BASE_URL: '/ollama' dockerfile: Dockerfile image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main} container_name: open-webui volumes: - open-webui:/app/backend/data depends_on: - ollama ports: - ${OPEN_WEBUI_PORT-3000}:8080 environment: - 'OLLAMA_BASE_URL=http://ollama:11434' - 'WEBUI_SECRET_KEY=' extra_hosts: - host.docker.internal:host-gateway restart: unless-stopped privileged: true volumes: ollama: {} open-webui: {} ``` ## Environment - **Open WebUI Version:** v0.5.2 - **Ollama (if applicable):** 0.5.4-0-g2ddc32d-dirty - **Operating System:** Window 11 (But I run on WSL2 on docker cgroup2) - **Browser (if applicable):** 131.0.6778.205 **Confirmation:** - [v ] I have read and followed all the instructions provided in the README.md. - [v ] I am on the latest version of both Open WebUI and Ollama. - [v ] I have included the browser console logs. - [v] I have included the Docker container logs. - [v ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: I expected there is something (e.g. status shown) changed on the user interface after clicking the "Action" click on the dialog. besides, there should be an new message added into the dialog. ![image](https://github.com/user-attachments/assets/ca089495-579e-4166-96b9-a95670f9c0ee) ## Actual Behavior: There is no effect on user interface and there is javascript error. Throw error "Ie.messages is not iterable" in Chat.svelte. ## Reproduction Details **Steps to Reproduce:** 1. Create a Function "Action" ```python """ title: Example Action author: open-webui author_url: https://github.com/open-webui funding_url: https://github.com/open-webui version: 0.1.0 required_open_webui_version: 0.3.9 """ from pydantic import BaseModel, Field from typing import Optional, Union, Generator, Iterator import os import requests import asyncio class Action: class Valves(BaseModel): pass def __init__(self): self.valves = self.Valves() pass async def action( self, body: dict, __user__=None, __event_emitter__=None, __event_call__=None, ) -> Optional[dict]: print(f"action:{__name__}") # response = await __event_call__( # { # "type": "input", # "data": { # "title": "write a message", # "message": "here write a message to append", # "placeholder": "enter your message", # }, # } # ) # print(response) if __event_emitter__: await __event_emitter__( { "type": "status", "data": {"description": "adding message", "done": False}, } ) await asyncio.sleep(1) await __event_emitter__( {"type": "message", "data": {"content": "Testing message here"}} ) await __event_emitter__( { "type": "status", "data": {"description": "added message", "done": True}, } ) ``` 2. Enable the Action for the Model ![image](https://github.com/user-attachments/assets/5c1f86b1-8ba1-4365-b1fe-3c607b637cca) 3. Click the "Action"'s button in a message on the conversation dialog 4. You will find there is no effect and there is javascript error ## Logs and Screenshots **Browser Console Logs:** ![image](https://github.com/user-attachments/assets/e80efa42-ca00-4ad5-9e8f-6663a22ce3d0) ![image](https://github.com/user-attachments/assets/5dc5aad9-026f-4ac8-b168-9aab1b4f2db2) ![image](https://github.com/user-attachments/assets/bbc518ca-dccb-42ca-92eb-3454c5ed1488) ![image](https://github.com/user-attachments/assets/cc9f98f0-0564-409d-911b-89c27985480a) **Docker Container Logs:** ![image](https://github.com/user-attachments/assets/c21f99ac-17f6-4335-acab-86227199bd69) **Screenshots/Screen Recordings (if applicable):** ## Additional Information n/a ## Note n/a
Author
Owner

@tjbck commented on GitHub (Dec 30, 2024):

Fixed on dev.

<!-- gh-comment-id:2565028585 --> @tjbck commented on GitHub (Dec 30, 2024): Fixed on dev.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#118348