[PR #9645] [CLOSED] server: MkdirAll only if path does not exist #59721

Closed
opened 2026-04-29 14:39:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9645
Author: @brccabral
Created: 3/11/2025
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • 682fa68 server: MkdirAll only if path does not exist

📊 Changes

13 files changed (+88 additions, -35 deletions)

View changed files

📝 cmd/cmd.go (+5 -2)
📝 readline/history.go (+5 -3)
📝 server/create.go (+5 -2)
📝 server/fixblobs_test.go (+5 -2)
📝 server/images.go (+10 -4)
📝 server/internal/cache/blob/cache.go (+15 -6)
📝 server/internal/cache/blob/cache_test.go (+4 -1)
📝 server/internal/cache/blob/casecheck_test.go (+4 -1)
📝 server/internal/testutil/testutil.go (+5 -2)
📝 server/manifest.go (+5 -2)
📝 server/manifest_test.go (+5 -2)
📝 server/modelpath.go (+10 -4)
📝 server/routes_create_test.go (+10 -4)

📄 Description

Related to #9597
Added checks to see if path does not exist before trying to create it.
Ollama was trying to create the whole folder structure for a custom OLLAMA_MODELS path, but it already exist and parent directories have no permission, but target directory does have permission, so, only try to create if it does not exist.


🔄 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/9645 **Author:** [@brccabral](https://github.com/brccabral) **Created:** 3/11/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`682fa68`](https://github.com/ollama/ollama/commit/682fa686c63c5508156f5488a3e39854b592075a) server: MkdirAll only if path does not exist ### 📊 Changes **13 files changed** (+88 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+5 -2) 📝 `readline/history.go` (+5 -3) 📝 `server/create.go` (+5 -2) 📝 `server/fixblobs_test.go` (+5 -2) 📝 `server/images.go` (+10 -4) 📝 `server/internal/cache/blob/cache.go` (+15 -6) 📝 `server/internal/cache/blob/cache_test.go` (+4 -1) 📝 `server/internal/cache/blob/casecheck_test.go` (+4 -1) 📝 `server/internal/testutil/testutil.go` (+5 -2) 📝 `server/manifest.go` (+5 -2) 📝 `server/manifest_test.go` (+5 -2) 📝 `server/modelpath.go` (+10 -4) 📝 `server/routes_create_test.go` (+10 -4) </details> ### 📄 Description Related to #9597 Added checks to see if path does not exist before trying to create it. Ollama was trying to create the whole folder structure for a custom OLLAMA_MODELS path, but it already exist and parent directories have no permission, but target directory does have permission, so, only try to create if it does not exist. --- <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-29 14:39:35 -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#59721