[PR #4241] [MERGED] Detect noexec and report a better error #42673

Closed
opened 2026-04-24 22:24:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4241
Author: @dhiltgen
Created: 5/7/2024
Status: Merged
Merged: 5/8/2024
Merged by: @dhiltgen

Base: mainHead: fix_tmp_override


📝 Commits (1)

  • 7270027 Detect noexec and report a better error

📊 Changes

1 file changed (+9 additions, -0 deletions)

View changed files

📝 llm/server.go (+9 -0)

📄 Description

This will bubble up a much more informative error message if noexec is preventing us from running the subprocess

Fixes #4105

Repro scenario:

sudo mkdir /tmp2
sudo mount -t tmpfs -o size=1g,noexec tmpfs /tmp2

OLLAMA_TMPDIR=/tmp2/test1 ollama serve
...
time=2024-05-07T23:44:54.304Z level=INFO source=sched.go:308 msg="NewLlamaServer failed" model=/home/daniel/.ollama/models/blobs/sha256-66002b78c70a22ab25e16cc9a1736c6cc6335398c7312e3eb33db202350afe66 error="unable to start server fork/exec /tmp2/test1/runners/cpu_avx/ollama_llama_server: permission denied.  /tmp2/test1/runners/cpu_avx may have noexec set.  Set OLLAMA_TMPDIR for server to a writable executable directory"

On the client that triggered the failure:

% ollama run orca-mini hello
Error: unable to start server fork/exec /tmp2/test1/runners/cpu_avx/ollama_llama_server: permission denied.  /tmp2/test1/runners/cpu_avx may have noexec set.  Set OLLAMA_TMPDIR for server to a writable executable directory

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/4241 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 5/7/2024 **Status:** ✅ Merged **Merged:** 5/8/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `fix_tmp_override` --- ### 📝 Commits (1) - [`7270027`](https://github.com/ollama/ollama/commit/72700279e260694e6df0a24a672f0a6f3e3dc3bf) Detect noexec and report a better error ### 📊 Changes **1 file changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `llm/server.go` (+9 -0) </details> ### 📄 Description This will bubble up a much more informative error message if noexec is preventing us from running the subprocess Fixes #4105 Repro scenario: ``` sudo mkdir /tmp2 sudo mount -t tmpfs -o size=1g,noexec tmpfs /tmp2 OLLAMA_TMPDIR=/tmp2/test1 ollama serve ... time=2024-05-07T23:44:54.304Z level=INFO source=sched.go:308 msg="NewLlamaServer failed" model=/home/daniel/.ollama/models/blobs/sha256-66002b78c70a22ab25e16cc9a1736c6cc6335398c7312e3eb33db202350afe66 error="unable to start server fork/exec /tmp2/test1/runners/cpu_avx/ollama_llama_server: permission denied. /tmp2/test1/runners/cpu_avx may have noexec set. Set OLLAMA_TMPDIR for server to a writable executable directory" ``` On the client that triggered the failure: ``` % ollama run orca-mini hello Error: unable to start server fork/exec /tmp2/test1/runners/cpu_avx/ollama_llama_server: permission denied. /tmp2/test1/runners/cpu_avx may have noexec set. Set OLLAMA_TMPDIR for server to a writable executable directory ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-24 22:24:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#42673