[GH-ISSUE #8745] When downloading a Dataset, crashes after completion. b.Parts[0].Size will error because Parts array is empty #31434

Closed
opened 2026-04-22 11:52:49 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @fallenreaper on GitHub (Feb 1, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8745

Information:
Ollama 0.5.7
OS: Mac
Version: Sonoma

Error: panic: runtime error: index out of range [0] with length 0

panic: runtime error: index out of range [0] with length 0

goroutine 51 [running]:
github.com/ollama/ollama/server.(*blobDownload).Prepare(0x14000518700, {0x1050393e0, 0x1400040c140}, 0x14000902120, 0x1400061a340)
	github.com/ollama/ollama/server/download.go:175 +0x4bc
github.com/ollama/ollama/server.downloadBlob({0x1050393e0, 0x1400040c140}, {{{0x104c43683, 0x5}, {0x104c576dc, 0x12}, {0x104c4c0a1, 0x7}, {0x140002f8060, 0x11}, ...}, ...})
	github.com/ollama/ollama/server/download.go:489 +0x3dc
github.com/ollama/ollama/server.PullModel({0x1050393e0, 0x1400040c140}, {0x140002f8060, 0x18}, 0x1400061a340, 0x14000415020)
	github.com/ollama/ollama/server/images.go:564 +0x600
github.com/ollama/ollama/server.(*Server).PullHandler.func1()
	github.com/ollama/ollama/server/routes.go:594 +0x174
created by github.com/ollama/ollama/server.(*Server).PullHandler in goroutine 11
	github.com/ollama/ollama/server/routes.go:581 +0x528

Prepare on line 172 errors due to the empty array.

This error seems to occur at the END Of downloading some new files.

How to reproduce:

  • Open terminal
  • ollama server
  • Open second terminal
  • ollama pull llama2-uncensored
    Note: I tried it with multiple datasets.

Desired Expectation:
App does not crash and adds downloaded blob to the local optoins.

Course of Action:
What happens if I wrap this with a try-catch? At the end of the download it seems to download another 7kb, which is where it fails.

Originally created by @fallenreaper on GitHub (Feb 1, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8745 Information: Ollama 0.5.7 OS: Mac Version: Sonoma **Error: panic: runtime error: index out of range [0] with length 0** ``` panic: runtime error: index out of range [0] with length 0 goroutine 51 [running]: github.com/ollama/ollama/server.(*blobDownload).Prepare(0x14000518700, {0x1050393e0, 0x1400040c140}, 0x14000902120, 0x1400061a340) github.com/ollama/ollama/server/download.go:175 +0x4bc github.com/ollama/ollama/server.downloadBlob({0x1050393e0, 0x1400040c140}, {{{0x104c43683, 0x5}, {0x104c576dc, 0x12}, {0x104c4c0a1, 0x7}, {0x140002f8060, 0x11}, ...}, ...}) github.com/ollama/ollama/server/download.go:489 +0x3dc github.com/ollama/ollama/server.PullModel({0x1050393e0, 0x1400040c140}, {0x140002f8060, 0x18}, 0x1400061a340, 0x14000415020) github.com/ollama/ollama/server/images.go:564 +0x600 github.com/ollama/ollama/server.(*Server).PullHandler.func1() github.com/ollama/ollama/server/routes.go:594 +0x174 created by github.com/ollama/ollama/server.(*Server).PullHandler in goroutine 11 github.com/ollama/ollama/server/routes.go:581 +0x528 ``` Prepare on line 172 errors due to the empty array. This error seems to occur at the END Of downloading some new files. How to reproduce: - Open terminal - `ollama server` - Open second terminal - `ollama pull llama2-uncensored` Note: I tried it with multiple datasets. Desired Expectation: App does not crash and adds downloaded blob to the local optoins. Course of Action: What happens if I wrap this with a try-catch? At the end of the download it seems to download another 7kb, which is where it fails.
Author
Owner

@rick-github commented on GitHub (Feb 1, 2025):

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

<!-- gh-comment-id:2628962477 --> @rick-github commented on GitHub (Feb 1, 2025): https://github.com/ollama/ollama/issues/8400
Author
Owner

@prusnak commented on GitHub (Feb 1, 2025):

fix in https://github.com/ollama/ollama/pull/8480

<!-- gh-comment-id:2629158901 --> @prusnak commented on GitHub (Feb 1, 2025): fix in https://github.com/ollama/ollama/pull/8480
Author
Owner

@jmorganca commented on GitHub (Feb 2, 2025):

Merging with https://github.com/ollama/ollama/issues/8400, thanks!

<!-- gh-comment-id:2629620696 --> @jmorganca commented on GitHub (Feb 2, 2025): Merging with https://github.com/ollama/ollama/issues/8400, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#31434