[GH-ISSUE #22513] issue: Bug: XML file content is corrupted (XML tags stripped) when uploaded in non-temporary chat #123039

Closed
opened 2026-05-21 02:12:18 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @nekomiya-hinata on GitHub (Mar 10, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22513

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.8.10

Ollama Version (if applicable)

No response

Operating System

Ubuntu 22.04

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When "Bypass Embedding and Retrieval" is enabled in Settings > Documents,
the complete and unmodified file content should be sent to the LLM,
including all XML tags and structure.

Actual Behavior

When uploading XML files (e.g., logback-spring.xml, MyBatis mapper XML) in a
normal (non-temporary) chat with "Bypass Embedding and Retrieval" enabled,
all XML tags are stripped from the file content before being sent to the LLM.
Only the text nodes between tags are preserved.

However, the same files uploaded in Temporary Chat mode are sent completely
and correctly.

Steps to Reproduce

  1. Install Open WebUI v0.8.10 via Docker on Ubuntu 22.04.
  2. Go to Settings > Documents, enable "Bypass Embedding and Retrieval".
  3. Start a normal (non-temporary) chat.
  4. Upload any XML file (e.g., a Spring logback config or MyBatis mapper XML).
  5. Ask the model: "Is this file complete?"
  6. Use tcpdump to inspect the actual request body sent to the LLM backend.

Observe: All XML tags are stripped. Only text node content remains.

For comparison:
7. Start a Temporary Chat and repeat steps 4–6.
Observe: File content is complete and all XML tags are preserved.

Logs & Screenshots

Normal chat, "Bypass Embedding and Retrieval" enabled.
XML tags are stripped from the content inside tag.

### Task:
Respond to the user query using the provided context, incorporating inline citations in the format [id] **only when the <source> tag includes an explicit id attribute** (e.g., <source id="1">).

### Guidelines:
- If you don't know the answer, clearly state that.
- If uncertain, ask the user for clarification.
- Respond in the same language as the user's query.
- If the context is unreadable or of poor quality, inform the user and provide the best possible answer.
- If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding.
- **Only include inline citations using [id] (e.g., [1], [2]) when the <source> tag includes an id attribute.**
- Do not cite if the <source> tag does not contain an id attribute.
- Do not use XML tags in your response.
- Ensure citations are concise and directly related to the information provided.

### Example of Citation:
If the user asks about a specific topic and the information is found in a source with a provided id attribute, the response should include the citation like in the following example:
* "According to the study, the proposed method increases efficiency by 20% [1]."

### Output:
Provide a clear and direct response to the user's query, including inline citations in the format [id] only when the <source> tag with id attribute is present in the context.

<context>
<source id="1" name="logback-spring.xml">${CONSOLE_LOG_PATTERN}

UTF-8

${LOG_HOME}/${LOG_FILENAME}.log

${CONSOLE_LOG_PATTERN}

UTF-8

${LOG_HOME}/${LOG_FILENAME}.%d{yyyy-MM-dd}.%i.gz

${LOG_FILEMAXDAY}

${LOG_FILESIZE}

INFO</source>
</context>

<user_query>
xxx
</user_query>

xxx

Same file uploaded in Temporary Chat mode. Content is complete.

### Task:
Respond to the user query using the provided context, incorporating inline citations in the format [id] **only when the <source> tag includes an explicit id attribute** (e.g., <source id="1">).

### Guidelines:
- If you don't know the answer, clearly state that.
- If uncertain, ask the user for clarification.
- Respond in the same language as the user's query.
- If the context is unreadable or of poor quality, inform the user and provide the best possible answer.
- If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding.
- **Only include inline citations using [id] (e.g., [1], [2]) when the <source> tag includes an id attribute.**
- Do not cite if the <source> tag does not contain an id attribute.
- Do not use XML tags in your response.
- Ensure citations are concise and directly related to the information provided.

### Example of Citation:
If the user asks about a specific topic and the information is found in a source with a provided id attribute, the response should include the citation like in the following example:
* "According to the study, the proposed method increases efficiency by 20% [1]."

### Output:
Provide a clear and direct response to the user's query, including inline citations in the format [id] only when the <source> tag with id attribute is present in the context.

<context>
<source id="1" name="logback-spring.xml"><?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <springProperty scope="context" name="ServerIP" source="spring.cloud.client.ipAddress" defaultValue="0.0.0.0"/>
    <springProperty scope="context" name="ServerPort" source="server.port" defaultValue="0000"/>
    <springProperty scope="context" name="KafkaHost" source="logback.kafka.producer.broker.connect" defaultValue="0.0.0.0:9092"/>
    <springProperty scope="context" name="LOG_HOME" source="logback.home" defaultValue="logs"/>
    <springProperty scope="context" name="springAppName" source="spring.application.name"/>
    <springProperty scope="context" name="LOG_FILENAME" source="logback.filename" defaultValue="${springAppName}"/>
    <springProperty scope="context" name="LOG_FILESIZE" source="logback.filesize" defaultValue="50MB"/>
    <springProperty scope="context" name="LOG_FILEMAXDAY" source="logback.filemaxday" defaultValue="15"/>

    <!-- \u5f69\u8272\u65e5\u5fd7 -->
    <conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter"/>
    <conversionRule conversionWord="wex" class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
    <conversionRule conversionWord="wEx"
                    class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
    <!-- \u5f69\u8272\u65e5\u5fd7\u683c\u5f0f -->
    <property name="CONSOLE_LOG_PATTERN"
              value="%d{yyyy-MM-dd HH:mm:ss.SSS} ${ServerIP}:${ServerPort} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%15.15t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>

    <!-- \u63a7\u5236\u53f0\u65e5\u5fd7 -->
    <appender name="StdoutAppender" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>${CONSOLE_LOG_PATTERN}</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>

    <!-- \u6309\u7167\u6bcf\u5929\u751f\u6210\u5e38\u89c4\u65e5\u5fd7\u6587\u4ef6 -->
    <appender name="FileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${LOG_HOME}/${LOG_FILENAME}.log</file>
        <encoder>
            <pattern>${CONSOLE_LOG_PATTERN}</pattern>
            <charset>UTF-8</charset>
        </encoder>

        <!-- \u6eda\u52a8\u7b56\u7565 -->
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- \u6bcf\u5929\u4e00\u4e2a\u6587\u4ef6\uff0c\u5e76\u6309\u65e5\u671f+gzip \u538b\u7f29 -->
            <fileNamePattern>${LOG_HOME}/${LOG_FILENAME}.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
            <!-- \u4fdd\u7559\u5929\u6570 -->
            <maxHistory>${LOG_FILEMAXDAY}</maxHistory>
            <!-- \u6309\u65f6\u95f4 + \u6587\u4ef6\u5927\u5c0f\u6eda\u52a8 -->
            <timeBasedFileNamingAndTriggeringPolicy
                class="ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy">
                <maxFileSize>${LOG_FILESIZE}</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>

        <!-- \u65e5\u5fd7\u7ea7\u522b\u8fc7\u6ee4 -->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>INFO</level>
        </filter>
    </appender>
    <!--TRACE DEBUG INFO WARN ERROR ALL OFF-->
    <root level="INFO">
        <appender-ref ref="StdoutAppender"/>
        <!--
        \u7531\u4e8e\u6211\u4eec\u7684Kafka\u670d\u52a1\u5668\u8fde\u63a5\u5730\u5740\u4fe1\u606f\u5728zookeeper\u4e2d,\u6240\u4ee5,root\u4e2d\u4e0d\u80fd\u4f7f\u7528KafkaAppender,
        \u5426\u5219,\u5c31\u9700\u8981\u5728\u542f\u52a8\u5e94\u7528\u65f6\u6307\u5b9aKafka\u5730\u5740\u4fe1\u606f,\u5982:&#45;&#45;(\u4e24\u4e2a\u6a2a\u6760)logback.kafka.producer.broker.connect=192.168.1.11:9092
        \u540c\u65f6,\u7531\u4e8eroot\u4e2d\u6ca1\u6709kafkaAppender,\u6240\u4ee5\u4e0b\u9762\u9700\u8981\u6307\u5b9a\u90a3\u4e2a\u5305\u7684\u65e5\u5fd7\u5e94\u8be5\u8f93\u51fa\u5230kafka\u4e2d\u3002

        \u8bf4\u660e:\u65e5\u5fd7\u8f93\u51fa\u5230kafka\u662f\u4e3a\u4e86\u914d\u5408\u65e5\u5fd7\u6613\u4f7f\u7528
        -->
        <!--<appender-ref ref="KafkaAppender"/>-->
    </root>

    <logger name="com" level="INFO" additivity="false">
        <appender-ref ref="StdoutAppender"/>
        <appender-ref ref="FileAppender"/>
        <!--<appender-ref ref="KafkaAppender"/>-->
    </logger>
    ${LOG_LOGGERS}

</configuration>
</source>
</context>

<user_query>
xxx
</user_query>

xxx

Additional Information

Root cause hypothesis:

In normal chat mode, uploaded files go through an ingestion pipeline
(extraction → storage to DB). During this step, the content extractor
appears to parse the XML file as a markup document and strips all tags,
storing only the inner text in the database.

"Bypass Embedding and Retrieval" only skips the vector search/retrieval step,
but the file content retrieved from DB is already corrupted at this point.

In Temporary Chat mode, the raw file is read directly without going through
the ingestion pipeline, so the content is intact.

Suggested fix: Either (1) bypass the extraction step as well when
"Bypass Embedding and Retrieval" is enabled, or (2) treat non-document
files (XML, JSON, YAML, etc.) as plain text and skip markup parsing entirely.

Originally created by @nekomiya-hinata on GitHub (Mar 10, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/22513 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.8.10 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 22.04 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When "Bypass Embedding and Retrieval" is enabled in Settings > Documents, the complete and unmodified file content should be sent to the LLM, including all XML tags and structure. ### Actual Behavior When uploading XML files (e.g., logback-spring.xml, MyBatis mapper XML) in a normal (non-temporary) chat with "Bypass Embedding and Retrieval" enabled, all XML tags are stripped from the file content before being sent to the LLM. Only the text nodes between tags are preserved. However, the same files uploaded in Temporary Chat mode are sent completely and correctly. ### Steps to Reproduce 1. Install Open WebUI v0.8.10 via Docker on Ubuntu 22.04. 2. Go to Settings > Documents, enable "Bypass Embedding and Retrieval". 3. Start a normal (non-temporary) chat. 4. Upload any XML file (e.g., a Spring logback config or MyBatis mapper XML). 5. Ask the model: "Is this file complete?" 6. Use tcpdump to inspect the actual request body sent to the LLM backend. Observe: All XML tags are stripped. Only text node content remains. For comparison: 7. Start a Temporary Chat and repeat steps 4–6. Observe: File content is complete and all XML tags are preserved. ### Logs & Screenshots Normal chat, "Bypass Embedding and Retrieval" enabled. XML tags are stripped from the content inside <source> tag. ``` ### Task: Respond to the user query using the provided context, incorporating inline citations in the format [id] **only when the <source> tag includes an explicit id attribute** (e.g., <source id="1">). ### Guidelines: - If you don't know the answer, clearly state that. - If uncertain, ask the user for clarification. - Respond in the same language as the user's query. - If the context is unreadable or of poor quality, inform the user and provide the best possible answer. - If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding. - **Only include inline citations using [id] (e.g., [1], [2]) when the <source> tag includes an id attribute.** - Do not cite if the <source> tag does not contain an id attribute. - Do not use XML tags in your response. - Ensure citations are concise and directly related to the information provided. ### Example of Citation: If the user asks about a specific topic and the information is found in a source with a provided id attribute, the response should include the citation like in the following example: * "According to the study, the proposed method increases efficiency by 20% [1]." ### Output: Provide a clear and direct response to the user's query, including inline citations in the format [id] only when the <source> tag with id attribute is present in the context. <context> <source id="1" name="logback-spring.xml">${CONSOLE_LOG_PATTERN} UTF-8 ${LOG_HOME}/${LOG_FILENAME}.log ${CONSOLE_LOG_PATTERN} UTF-8 ${LOG_HOME}/${LOG_FILENAME}.%d{yyyy-MM-dd}.%i.gz ${LOG_FILEMAXDAY} ${LOG_FILESIZE} INFO</source> </context> <user_query> xxx </user_query> xxx ``` Same file uploaded in Temporary Chat mode. Content is complete. ``` ### Task: Respond to the user query using the provided context, incorporating inline citations in the format [id] **only when the <source> tag includes an explicit id attribute** (e.g., <source id="1">). ### Guidelines: - If you don't know the answer, clearly state that. - If uncertain, ask the user for clarification. - Respond in the same language as the user's query. - If the context is unreadable or of poor quality, inform the user and provide the best possible answer. - If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding. - **Only include inline citations using [id] (e.g., [1], [2]) when the <source> tag includes an id attribute.** - Do not cite if the <source> tag does not contain an id attribute. - Do not use XML tags in your response. - Ensure citations are concise and directly related to the information provided. ### Example of Citation: If the user asks about a specific topic and the information is found in a source with a provided id attribute, the response should include the citation like in the following example: * "According to the study, the proposed method increases efficiency by 20% [1]." ### Output: Provide a clear and direct response to the user's query, including inline citations in the format [id] only when the <source> tag with id attribute is present in the context. <context> <source id="1" name="logback-spring.xml"><?xml version="1.0" encoding="UTF-8"?> <configuration> <springProperty scope="context" name="ServerIP" source="spring.cloud.client.ipAddress" defaultValue="0.0.0.0"/> <springProperty scope="context" name="ServerPort" source="server.port" defaultValue="0000"/> <springProperty scope="context" name="KafkaHost" source="logback.kafka.producer.broker.connect" defaultValue="0.0.0.0:9092"/> <springProperty scope="context" name="LOG_HOME" source="logback.home" defaultValue="logs"/> <springProperty scope="context" name="springAppName" source="spring.application.name"/> <springProperty scope="context" name="LOG_FILENAME" source="logback.filename" defaultValue="${springAppName}"/> <springProperty scope="context" name="LOG_FILESIZE" source="logback.filesize" defaultValue="50MB"/> <springProperty scope="context" name="LOG_FILEMAXDAY" source="logback.filemaxday" defaultValue="15"/> <!-- \u5f69\u8272\u65e5\u5fd7 --> <conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter"/> <conversionRule conversionWord="wex" class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> <conversionRule conversionWord="wEx" class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> <!-- \u5f69\u8272\u65e5\u5fd7\u683c\u5f0f --> <property name="CONSOLE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} ${ServerIP}:${ServerPort} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%15.15t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/> <!-- \u63a7\u5236\u53f0\u65e5\u5fd7 --> <appender name="StdoutAppender" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>${CONSOLE_LOG_PATTERN}</pattern> <charset>UTF-8</charset> </encoder> </appender> <!-- \u6309\u7167\u6bcf\u5929\u751f\u6210\u5e38\u89c4\u65e5\u5fd7\u6587\u4ef6 --> <appender name="FileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOG_HOME}/${LOG_FILENAME}.log</file> <encoder> <pattern>${CONSOLE_LOG_PATTERN}</pattern> <charset>UTF-8</charset> </encoder> <!-- \u6eda\u52a8\u7b56\u7565 --> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- \u6bcf\u5929\u4e00\u4e2a\u6587\u4ef6\uff0c\u5e76\u6309\u65e5\u671f+gzip \u538b\u7f29 --> <fileNamePattern>${LOG_HOME}/${LOG_FILENAME}.%d{yyyy-MM-dd}.%i.gz</fileNamePattern> <!-- \u4fdd\u7559\u5929\u6570 --> <maxHistory>${LOG_FILEMAXDAY}</maxHistory> <!-- \u6309\u65f6\u95f4 + \u6587\u4ef6\u5927\u5c0f\u6eda\u52a8 --> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy"> <maxFileSize>${LOG_FILESIZE}</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> <!-- \u65e5\u5fd7\u7ea7\u522b\u8fc7\u6ee4 --> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>INFO</level> </filter> </appender> <!--TRACE DEBUG INFO WARN ERROR ALL OFF--> <root level="INFO"> <appender-ref ref="StdoutAppender"/> <!-- \u7531\u4e8e\u6211\u4eec\u7684Kafka\u670d\u52a1\u5668\u8fde\u63a5\u5730\u5740\u4fe1\u606f\u5728zookeeper\u4e2d,\u6240\u4ee5,root\u4e2d\u4e0d\u80fd\u4f7f\u7528KafkaAppender, \u5426\u5219,\u5c31\u9700\u8981\u5728\u542f\u52a8\u5e94\u7528\u65f6\u6307\u5b9aKafka\u5730\u5740\u4fe1\u606f,\u5982:&#45;&#45;(\u4e24\u4e2a\u6a2a\u6760)logback.kafka.producer.broker.connect=192.168.1.11:9092 \u540c\u65f6,\u7531\u4e8eroot\u4e2d\u6ca1\u6709kafkaAppender,\u6240\u4ee5\u4e0b\u9762\u9700\u8981\u6307\u5b9a\u90a3\u4e2a\u5305\u7684\u65e5\u5fd7\u5e94\u8be5\u8f93\u51fa\u5230kafka\u4e2d\u3002 \u8bf4\u660e:\u65e5\u5fd7\u8f93\u51fa\u5230kafka\u662f\u4e3a\u4e86\u914d\u5408\u65e5\u5fd7\u6613\u4f7f\u7528 --> <!--<appender-ref ref="KafkaAppender"/>--> </root> <logger name="com" level="INFO" additivity="false"> <appender-ref ref="StdoutAppender"/> <appender-ref ref="FileAppender"/> <!--<appender-ref ref="KafkaAppender"/>--> </logger> ${LOG_LOGGERS} </configuration> </source> </context> <user_query> xxx </user_query> xxx ``` ### Additional Information Root cause hypothesis: In normal chat mode, uploaded files go through an ingestion pipeline (extraction → storage to DB). During this step, the content extractor appears to parse the XML file as a markup document and strips all tags, storing only the inner text in the database. "Bypass Embedding and Retrieval" only skips the vector search/retrieval step, but the file content retrieved from DB is already corrupted at this point. In Temporary Chat mode, the raw file is read directly without going through the ingestion pipeline, so the content is intact. Suggested fix: Either (1) bypass the extraction step as well when "Bypass Embedding and Retrieval" is enabled, or (2) treat non-document files (XML, JSON, YAML, etc.) as plain text and skip markup parsing entirely.
GiteaMirror added the bug label 2026-05-21 02:12:18 -05:00
Author
Owner

@nekomiya-hinata commented on GitHub (Mar 10, 2026):

Suggested Fix

For configuration files like XML, JSON, YAML, etc., they should be treated as plain text without markup parsing. Consider adding a check in the _get_loader() method to use TextLoader directly for these file types, skipping BeautifulSoup processing entirely. This would preserve the original file structure and prevent tag stripping.

<!-- gh-comment-id:4029913110 --> @nekomiya-hinata commented on GitHub (Mar 10, 2026): ## Suggested Fix For configuration files like XML, JSON, YAML, etc., they should be treated as plain text without markup parsing. Consider adding a check in the `_get_loader()` method to use `TextLoader` directly for these file types, skipping BeautifulSoup processing entirely. This would preserve the original file structure and prevent tag stripping.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#123039