[GH-ISSUE #12380] Recent ollama + qwen3-coder:30b XML error. #8222

Closed
opened 2026-04-12 20:42:31 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @eranif on GitHub (Sep 23, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12380

What is the issue?

Hello,

I recently updated the latest Ollama + pulled the latest qwen3-coder:30b to my local machine.

Here is ollama ls + ollama ps output:

$ ollama ls
NAME               ID              SIZE      MODIFIED
gemma3:12b         f4031aab637d    8.1 GB    57 minutes ago
qwen3-coder:30b    b248ac89e7ec    18 GB     3 hours ago
gpt-oss:20b        aa4295ac10c3    13 GB     3 days ago
$ ollama ps
NAME               ID              SIZE     PROCESSOR          CONTEXT    UNTIL
qwen3-coder:30b    b248ac89e7ec    26 GB    13%/87% CPU/GPU    32768      2 minutes from now

Running query using an external tool, I am getting an error stating XML error. To rule out that tool I am using, I used cURL and wget.

The command I am running (and XML error message):

$ wget -O - --post-file=request-tools.json  http://127.0.0.1/api/chat
--2025-09-23 13:23:20--  http://127.0.0.1/api/chat
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-ndjson]
Saving to: ‘STDOUT’

-                                             [<=>                                                                                   ]       0  --.-KB/s               
-  {"error":"XML syntax error on line 7: expected element name after \u003c"}

Here is the request JSON payload:

{
  "keep_alive": "5m",
  "messages": [
    {
      "content": "write fib program in c++. also write cmake file to build it",
      "role": "user"
    }
  ],
  "model": "qwen3-coder:30b",
  "options": {
    "num_ctx": 32768,
    "temperature": 0
  },
  "stream": true,
  "tools": [
    {
      "function": {
        "description": "Return the text of the active tab inside the editor.",
        "name": "Get the text of the active tab inside the editor",
        "parameters": {
          "required": [],
          "type": "object"
        }
      },
      "type": "function"
    },
    {
      "function": {
        "description": "Try to open file 'filepath' and load it into the editor for editing or viewing.",
        "name": "Open a file in an editor",
        "parameters": {
          "properties": {
            "filepath": {
              "description": "The path of the file to open inside the editor.",
              "type": "string"
            }
          },
          "required": [
            "filepath"
          ],
          "type": "object"
        }
      },
      "type": "function"
    },
    {
      "function": {
        "description": "Reads the entire content of the file 'filepath' from the disk. On success, this function returns the entire file's content.",
        "name": "Read file from the file system",
        "parameters": {
          "properties": {
            "filepath": {
              "description": "The path of the file to read.",
              "type": "string"
            }
          },
          "required": [
            "filepath"
          ],
          "type": "object"
        }
      },
      "type": "function"
    },
    {
      "function": {
        "description": "Read and fetches the compiler build log output of the most recent build command executed by the user and return it to the caller. Use this method to read the compiler output. This is useful for helping explaining and resolving build issues. On success read, this function return the complete build log output.",
        "name": "Read the compiler build output",
        "parameters": {
          "required": [],
          "type": "object"
        }
      },
      "type": "function"
    },
    {
      "function": {
        "description": "Write the content 'file_content' to the file system at the given path identified by 'filepath'",
        "name": "Write file content to disk at a given path",
        "parameters": {
          "properties": {
            "file_content": {
              "description": "The content of the file to be written to the disk.",
              "type": "string"
            },
            "filepath": {
              "description": "The path file path.",
              "type": "string"
            }
          },
          "required": [
            "file_content",
            "filepath"
          ],
          "type": "object"
        }
      },
      "type": "function"
    },
    {
      "function": {
        "description": "Add two numbers and return the result.",
        "name": "add",
        "parameters": {
          "properties": {
            "a": {
              "description": "A",
              "type": "integer"
            },
            "b": {
              "description": "B",
              "type": "integer"
            }
          },
          "required": [
            "a",
            "b"
          ],
          "type": "object"
        }
      },
      "type": "function"
    }
  ]
}

If I remove the tools part of the from the JSON payload it works. The "tool" part of the payload is added automatically based on the model info, which qwen3-code:30b HAS tools capability:

$ ollama show qwen3-coder:30b
  Model
    architecture        qwen3moe
    parameters          30.5B
    context length      262144
    embedding length    2048
    quantization        Q4_K_M

  Capabilities
    completion
    tools

Also, changing the model back to gpt-oss:20b works as expected.

Is this a bug or am I doing something wrong?

Thanks!
Eran

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @eranif on GitHub (Sep 23, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12380 ### What is the issue? Hello, I recently updated the latest Ollama + pulled the latest `qwen3-coder:30b` to my local machine. Here is `ollama ls` + `ollama ps` output: ```bash $ ollama ls NAME ID SIZE MODIFIED gemma3:12b f4031aab637d 8.1 GB 57 minutes ago qwen3-coder:30b b248ac89e7ec 18 GB 3 hours ago gpt-oss:20b aa4295ac10c3 13 GB 3 days ago ``` ```bash $ ollama ps NAME ID SIZE PROCESSOR CONTEXT UNTIL qwen3-coder:30b b248ac89e7ec 26 GB 13%/87% CPU/GPU 32768 2 minutes from now ``` Running query using an external tool, I am getting an error stating XML error. To rule out that tool I am using, I used `cURL` and `wget`. The command I am running (and XML error message): ```bash $ wget -O - --post-file=request-tools.json http://127.0.0.1/api/chat --2025-09-23 13:23:20-- http://127.0.0.1/api/chat Connecting to 127.0.0.1:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/x-ndjson] Saving to: ‘STDOUT’ - [<=> ] 0 --.-KB/s - {"error":"XML syntax error on line 7: expected element name after \u003c"} ``` Here is the request JSON payload: ```json { "keep_alive": "5m", "messages": [ { "content": "write fib program in c++. also write cmake file to build it", "role": "user" } ], "model": "qwen3-coder:30b", "options": { "num_ctx": 32768, "temperature": 0 }, "stream": true, "tools": [ { "function": { "description": "Return the text of the active tab inside the editor.", "name": "Get the text of the active tab inside the editor", "parameters": { "required": [], "type": "object" } }, "type": "function" }, { "function": { "description": "Try to open file 'filepath' and load it into the editor for editing or viewing.", "name": "Open a file in an editor", "parameters": { "properties": { "filepath": { "description": "The path of the file to open inside the editor.", "type": "string" } }, "required": [ "filepath" ], "type": "object" } }, "type": "function" }, { "function": { "description": "Reads the entire content of the file 'filepath' from the disk. On success, this function returns the entire file's content.", "name": "Read file from the file system", "parameters": { "properties": { "filepath": { "description": "The path of the file to read.", "type": "string" } }, "required": [ "filepath" ], "type": "object" } }, "type": "function" }, { "function": { "description": "Read and fetches the compiler build log output of the most recent build command executed by the user and return it to the caller. Use this method to read the compiler output. This is useful for helping explaining and resolving build issues. On success read, this function return the complete build log output.", "name": "Read the compiler build output", "parameters": { "required": [], "type": "object" } }, "type": "function" }, { "function": { "description": "Write the content 'file_content' to the file system at the given path identified by 'filepath'", "name": "Write file content to disk at a given path", "parameters": { "properties": { "file_content": { "description": "The content of the file to be written to the disk.", "type": "string" }, "filepath": { "description": "The path file path.", "type": "string" } }, "required": [ "file_content", "filepath" ], "type": "object" } }, "type": "function" }, { "function": { "description": "Add two numbers and return the result.", "name": "add", "parameters": { "properties": { "a": { "description": "A", "type": "integer" }, "b": { "description": "B", "type": "integer" } }, "required": [ "a", "b" ], "type": "object" } }, "type": "function" } ] } ``` If I remove the `tools` part of the from the JSON payload it works. The "tool" part of the payload is added automatically based on the model info, which qwen3-code:30b HAS tools capability: ```bash $ ollama show qwen3-coder:30b Model architecture qwen3moe parameters 30.5B context length 262144 embedding length 2048 quantization Q4_K_M Capabilities completion tools ``` Also, changing the model back to `gpt-oss:20b` works as expected. Is this a bug or am I doing something wrong? Thanks! Eran ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-12 20:42:31 -05:00
Author
Owner

@rick-github commented on GitHub (Sep 23, 2025):

Server logs will show relevant info, but it may be https://github.com/ollama/ollama/issues/12357.

<!-- gh-comment-id:3324116564 --> @rick-github commented on GitHub (Sep 23, 2025): [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) will show relevant info, but it may be https://github.com/ollama/ollama/issues/12357.
Author
Owner

@rick-github commented on GitHub (Sep 23, 2025):

The XML parser chokes on line 7 of the qwen event:

     1	[{raw:
     2	<function=Write file content to disk at a given path>
     3	<parameter=file_content>
     4	#include <iostream>
     5	
     6	int fibonacci(int n) {
     7	    if (n <= 1)
     8	        return n;
     9	    return fibonacci(n - 1) + fibonacci(n - 2);
    10	}
...

So it's failing on the unescaped <. This is fixed in #12357 and resolved by 0.12.1-rc1.

<!-- gh-comment-id:3324305886 --> @rick-github commented on GitHub (Sep 23, 2025): The XML parser chokes on line 7 of the qwen event: ``` 1 [{raw: 2 <function=Write file content to disk at a given path> 3 <parameter=file_content> 4 #include <iostream> 5 6 int fibonacci(int n) { 7 if (n <= 1) 8 return n; 9 return fibonacci(n - 1) + fibonacci(n - 2); 10 } ... ``` So it's failing on the unescaped `<`. This is fixed in #12357 and resolved by [0.12.1-rc1](https://github.com/ollama/ollama/releases/tag/v0.12.1-rc1).
Author
Owner

@eranif commented on GitHub (Sep 23, 2025):

thanks @rick-github !

Are there any instructions for installing release candidates?

<!-- gh-comment-id:3324412949 --> @eranif commented on GitHub (Sep 23, 2025): thanks @rick-github ! Are there any instructions for installing release candidates?
Author
Owner

@rick-github commented on GitHub (Sep 23, 2025):

curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.12.1-rc1 sh
<!-- gh-comment-id:3324479207 --> @rick-github commented on GitHub (Sep 23, 2025): ``` curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.12.1-rc1 sh ```
Author
Owner

@eranif commented on GitHub (Sep 23, 2025):

Thanks, this seems to fix the problem. I am going to close this issue as the problem seems to be fixed in 0.12.1-rc1.
Big thanks!

<!-- gh-comment-id:3325056299 --> @eranif commented on GitHub (Sep 23, 2025): Thanks, this seems to fix the problem. I am going to close this issue as the problem seems to be fixed in `0.12.1-rc1`. Big thanks!
Author
Owner

@siraxe commented on GitHub (Oct 8, 2025):

0.12.3

Image
<!-- gh-comment-id:3382116343 --> @siraxe commented on GitHub (Oct 8, 2025): 0.12.3 <img width="813" height="1255" alt="Image" src="https://github.com/user-attachments/assets/1950b047-21ce-4b01-84f9-8349fece10da" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#8222