[GH-ISSUE #9809] Model Gemma3:27b causes "panic: failed to sample token: no tokens to sample from" #68475

Closed
opened 2026-05-04 14:06:10 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @ronaldvdmeer on GitHub (Mar 17, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9809

What is the issue?

I’m encountering a panic error when running Ollama v0.6.1 with the Gemma3:27b model in combination with Open WebUI v0.5.20. The issue seems to occur randomly. I've noticed that the proces is still running but the model is no longer responding. Reboot of the service is required and often takes a while to shutdown.

Context Length in Open WebUI is set to 8192 and temperature is set to 0.1

Below is the log output:

Mar 16 19:26:19 su8ai01 ollama[743081]: panic: failed to sample token: no tokens to sample from
Mar 16 19:26:19 su8ai01 ollama[743081]: goroutine 19 [running]:
Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner.(*Server).run(0xc0004e2fc0, {0x55864ec7b5e0, 0xc00050f400})
Mar 16 19:26:19 su8ai01 ollama[743081]:         github.com/ollama/ollama/runner/ollamarunner/runner.go:323 +0x65
Mar 16 19:26:19 su8ai01 ollama[743081]: created by github.com/ollama/ollama/runner/ollamarunner.Execute in goroutine 1
Mar 16 19:26:19 su8ai01 ollama[743081]:         github.com/ollama/ollama/runner/ollamarunner/runner.go:919 +0xa9c

System Information:
• Ollama version: v0.6.1
• Model: Gemma3:27b
• Open WebUI version: v0.5.20
• OS: Debian 12
• GPU: NVIDIA RTX 3090
• RAM: 48GB

Reproduction Steps:
1. Run Ollama with Gemma3:27b and Open WebUI.
2. Perform normal interactions in Open WebUI.
3. Issue occurs seemingly at random moments.

Expected Behavior:
Ollama should not stop working due to a token sampling error.

Additional Context:
• The issue might be related to how Open WebUI interacts with Ollama.

Would appreciate any insights or guidance on how to resolve this issue. Thanks!

Relevant log output

Mar 16 19:26:19 su8ai01 ollama[743081]: panic: failed to sample token: no tokens to sample from
Mar 16 19:26:19 su8ai01 ollama[743081]: goroutine 19 [running]:
Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner.(*Server).run(0xc0004e2fc0, {0x55864ec7b5e0, 0xc00050f400})
Mar 16 19:26:19 su8ai01 ollama[743081]:         github.com/ollama/ollama/runner/ollamarunner/runner.go:323 +0x65
Mar 16 19:26:19 su8ai01 ollama[743081]: created by github.com/ollama/ollama/runner/ollamarunner.Execute in goroutine 1
Mar 16 19:26:19 su8ai01 ollama[743081]:         github.com/ollama/ollama/runner/ollamarunner/runner.go:919 +0xa9c

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.6.1

Originally created by @ronaldvdmeer on GitHub (Mar 17, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9809 ### What is the issue? I’m encountering a panic error when running **Ollama v0.6.1** with the **Gemma3:27b** model in combination with **Open WebUI v0.5.20**. The issue seems to occur randomly. I've noticed that the proces is still running but the model is no longer responding. Reboot of the service is required and often takes a while to shutdown. Context Length in Open WebUI is set to `8192` and temperature is set to `0.1` **Below is the log output:** ``` Mar 16 19:26:19 su8ai01 ollama[743081]: panic: failed to sample token: no tokens to sample from Mar 16 19:26:19 su8ai01 ollama[743081]: goroutine 19 [running]: Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner.(*Server).run(0xc0004e2fc0, {0x55864ec7b5e0, 0xc00050f400}) Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner/runner.go:323 +0x65 Mar 16 19:26:19 su8ai01 ollama[743081]: created by github.com/ollama/ollama/runner/ollamarunner.Execute in goroutine 1 Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner/runner.go:919 +0xa9c ``` **System Information:** • Ollama version: v0.6.1 • Model: Gemma3:27b • Open WebUI version: v0.5.20 • OS: Debian 12 • GPU: NVIDIA RTX 3090 • RAM: 48GB **Reproduction Steps:** 1. Run Ollama with Gemma3:27b and Open WebUI. 2. Perform normal interactions in Open WebUI. 3. Issue occurs seemingly at random moments. **Expected Behavior:** Ollama should not stop working due to a token sampling error. **Additional Context:** • The issue might be related to how Open WebUI interacts with Ollama. Would appreciate any insights or guidance on how to resolve this issue. Thanks! ### Relevant log output ```shell Mar 16 19:26:19 su8ai01 ollama[743081]: panic: failed to sample token: no tokens to sample from Mar 16 19:26:19 su8ai01 ollama[743081]: goroutine 19 [running]: Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner.(*Server).run(0xc0004e2fc0, {0x55864ec7b5e0, 0xc00050f400}) Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner/runner.go:323 +0x65 Mar 16 19:26:19 su8ai01 ollama[743081]: created by github.com/ollama/ollama/runner/ollamarunner.Execute in goroutine 1 Mar 16 19:26:19 su8ai01 ollama[743081]: github.com/ollama/ollama/runner/ollamarunner/runner.go:919 +0xa9c ``` ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.6.1
GiteaMirror added the bug label 2026-05-04 14:06:10 -05:00
Author
Owner

@rick-github commented on GitHub (Mar 17, 2025):

#9733

<!-- gh-comment-id:2728578814 --> @rick-github commented on GitHub (Mar 17, 2025): #9733
Author
Owner

@ronaldvdmeer commented on GitHub (Mar 17, 2025):

#9733

Ah yes that seems to be the same but other operating system.

<!-- gh-comment-id:2728694336 --> @ronaldvdmeer commented on GitHub (Mar 17, 2025): > [#9733](https://github.com/ollama/ollama/issues/9733) Ah yes that seems to be the same but other operating system.
Author
Owner

@jmorganca commented on GitHub (Mar 17, 2025):

Closing for https://github.com/ollama/ollama/issues/9733. Sorry this happened

<!-- gh-comment-id:2730237045 --> @jmorganca commented on GitHub (Mar 17, 2025): Closing for https://github.com/ollama/ollama/issues/9733. Sorry this happened
Author
Owner

@ParthSareen commented on GitHub (Mar 18, 2025):

@ronaldvdmeer are you still running into this after 0.6.2?

<!-- gh-comment-id:2734003328 --> @ParthSareen commented on GitHub (Mar 18, 2025): @ronaldvdmeer are you still running into this after `0.6.2`?
Author
Owner

@ronaldvdmeer commented on GitHub (Mar 18, 2025):

I have not seen the error anymore but now after about 5-10 prompts it completely stalls.

<!-- gh-comment-id:2734093876 --> @ronaldvdmeer commented on GitHub (Mar 18, 2025): I have not seen the error anymore but now after about 5-10 prompts it completely stalls.
Author
Owner

@ronaldvdmeer commented on GitHub (Mar 18, 2025):

https://github.com/ollama/ollama/issues/9857

<!-- gh-comment-id:2734098143 --> @ronaldvdmeer commented on GitHub (Mar 18, 2025): https://github.com/ollama/ollama/issues/9857
Author
Owner

@ParthSareen commented on GitHub (Mar 18, 2025):

Thanks for reporting @ronaldvdmeer - we're taking a look now

<!-- gh-comment-id:2734116002 --> @ParthSareen commented on GitHub (Mar 18, 2025): Thanks for reporting @ronaldvdmeer - we're taking a look now
Author
Owner

@tjwebb commented on GitHub (Nov 17, 2025):

still seeing this on 0.12, not using openwebui

<!-- gh-comment-id:3542192075 --> @tjwebb commented on GitHub (Nov 17, 2025): still seeing this on 0.12, not using openwebui
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#68475