[GH-ISSUE #8687] Issue with Ollama Model Download: Restart Automatically or Throws an Error. #52141

Closed
opened 2026-04-28 22:16:40 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @baraich on GitHub (Jan 30, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8687

Originally assigned to: @bmizerany on GitHub.

What is the issue?

Setting the Context

While downloading a model using the ollama pull command the downloading process is initiated. However, the process automatically decided
to restart and begins to downloading again from 0%.

I have seen other issues that were related to downloading, and I believe this problem is caused mainly due to Inactivity Monitoring (https://github.com/ollama/ollama/pull/1916).

Examples

A case when the commands threw error.

Image

A case when the downloading restarts

https://github.com/user-attachments/assets/8ffd5d31-a879-4570-9839-576f2d3a0bf7

Remarks

The downloading is now purely luck based, I am trying to download this model from last 2 hours now and most of the times I see this restart around 34MB, 186MB and 276MB. I don't think these megabytes number should matter but still I am sharing those.

Also, I did download this model once, but when I tried to ollama list after pulling the model the list was empty. I don't know why was that as I am not able to download the model again so I am not sure.

OS

Linux

GPU

No response

CPU

No response

Ollama version

0.5.7

Originally created by @baraich on GitHub (Jan 30, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8687 Originally assigned to: @bmizerany on GitHub. ### What is the issue? ## Setting the Context While downloading a model using the `ollama pull` command the downloading process is initiated. However, the process automatically decided to restart and begins to downloading again from 0%. I have seen other issues that were related to downloading, and I believe this problem is caused mainly due to Inactivity Monitoring (https://github.com/ollama/ollama/pull/1916). ## Examples > A case when the commands threw error. ![Image](https://github.com/user-attachments/assets/94776439-9a33-4fc2-89fc-ab6281eb3c48) > A case when the downloading restarts https://github.com/user-attachments/assets/8ffd5d31-a879-4570-9839-576f2d3a0bf7 ## Remarks The downloading is now purely luck based, I am trying to download this model from last 2 hours now and most of the times I see this restart around 34MB, 186MB and 276MB. I don't think these megabytes number should matter but still I am sharing those. Also, I did download this model once, but when I tried to `ollama list` after pulling the model the list was empty. I don't know why was that as I am not able to download the model again so I am not sure. ### OS Linux ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.5.7
GiteaMirror added the networkingbug labels 2026-04-28 22:16:40 -05:00
Author
Owner

@ctx2002 commented on GitHub (Jan 30, 2025):

check out issue #8484

<!-- gh-comment-id:2623781051 --> @ctx2002 commented on GitHub (Jan 30, 2025): check out issue #8484
Author
Owner

@baraich commented on GitHub (Jan 30, 2025):

@ctx2002 I have already seen the issue and I don't see anything useful there.

<!-- gh-comment-id:2623813355 --> @baraich commented on GitHub (Jan 30, 2025): @ctx2002 I have already seen the issue and I don't see anything useful there.
Author
Owner

@rick-github commented on GitHub (Jan 30, 2025):

You can try downloading the model with https://github.com/ollama/ollama/issues/8535#issuecomment-2613241807

If you have a torrent client, try: magnet:?xt=urn:btih:7d72f93cacb4db1ed32f081f8d890ca7beb39052&dn=models&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce

<!-- gh-comment-id:2623874269 --> @rick-github commented on GitHub (Jan 30, 2025): You can try downloading the model with https://github.com/ollama/ollama/issues/8535#issuecomment-2613241807 If you have a torrent client, try: magnet:?xt=urn:btih:7d72f93cacb4db1ed32f081f8d890ca7beb39052&dn=models&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce
Author
Owner

@Skizzy-create commented on GitHub (Jan 31, 2025):

i use this Powershell script,
just replace the model name

while ($true) {
    Write-Host "Attempting to download model..."
    $process = Start-Process -FilePath "ollama" -ArgumentList "pull model name" -PassThru -NoNewWindow
    try {
        $process | Wait-Process -Timeout 10 -ErrorAction Stop
        if ($process.ExitCode -eq 0) {
            Write-Host "Model downloaded successfully!"
            break
        } else {
            Write-Host "Download failed (Exit code: $($process.ExitCode)). Retrying..."
        }
    } catch {
        Write-Host "Timeout occurred, restarting download..."
        $process | Stop-Process -Force -ErrorAction SilentlyContinue
    }
    Start-Sleep -Seconds 2
}

and here is in bash for linux

#!/bin/bash

while true; do
    echo "Attempting to download model..."
    ollama pull modelname &
    process_pid=$!
    sleep 10

    if wait $process_pid; then
        echo "Model downloaded successfully!"
        break
    else
        echo "Download failed. Retrying..."
        kill -9 $process_pid 2>/dev/null
    fi

    sleep 2
done
<!-- gh-comment-id:2627397325 --> @Skizzy-create commented on GitHub (Jan 31, 2025): i use this Powershell script, just replace the `model name` ```powershell while ($true) { Write-Host "Attempting to download model..." $process = Start-Process -FilePath "ollama" -ArgumentList "pull model name" -PassThru -NoNewWindow try { $process | Wait-Process -Timeout 10 -ErrorAction Stop if ($process.ExitCode -eq 0) { Write-Host "Model downloaded successfully!" break } else { Write-Host "Download failed (Exit code: $($process.ExitCode)). Retrying..." } } catch { Write-Host "Timeout occurred, restarting download..." $process | Stop-Process -Force -ErrorAction SilentlyContinue } Start-Sleep -Seconds 2 } ``` and here is in bash for linux ```bash #!/bin/bash while true; do echo "Attempting to download model..." ollama pull modelname & process_pid=$! sleep 10 if wait $process_pid; then echo "Model downloaded successfully!" break else echo "Download failed. Retrying..." kill -9 $process_pid 2>/dev/null fi sleep 2 done ```
Author
Owner

@charliebrowncpt commented on GitHub (Feb 8, 2025):

i use this Powershell script, just replace the model name

while ($true) {
Write-Host "Attempting to download model..."
$process = Start-Process -FilePath "ollama" -ArgumentList "pull model name" -PassThru -NoNewWindow
try {
$process | Wait-Process -Timeout 10 -ErrorAction Stop
if ($process.ExitCode -eq 0) {
Write-Host "Model downloaded successfully!"
break
} else {
Write-Host "Download failed (Exit code: $($process.ExitCode)). Retrying..."
}
} catch {
Write-Host "Timeout occurred, restarting download..."
$process | Stop-Process -Force -ErrorAction SilentlyContinue
}
Start-Sleep -Seconds 2
}
and here is in bash for linux

#!/bin/bash

while true; do
echo "Attempting to download model..."
ollama pull modelname &
process_pid=$!
sleep 10

if wait $process_pid; then
    echo "Model downloaded successfully!"
    break
else
    echo "Download failed. Retrying..."
    kill -9 $process_pid 2>/dev/null
fi

sleep 2

done

Works well. thank you. I was cursing last night while trying to download deepseek-r1 and llama3.3 only to find it restarted at 20%

<!-- gh-comment-id:2645099245 --> @charliebrowncpt commented on GitHub (Feb 8, 2025): > i use this Powershell script, just replace the `model name` > > while ($true) { > Write-Host "Attempting to download model..." > $process = Start-Process -FilePath "ollama" -ArgumentList "pull model name" -PassThru -NoNewWindow > try { > $process | Wait-Process -Timeout 10 -ErrorAction Stop > if ($process.ExitCode -eq 0) { > Write-Host "Model downloaded successfully!" > break > } else { > Write-Host "Download failed (Exit code: $($process.ExitCode)). Retrying..." > } > } catch { > Write-Host "Timeout occurred, restarting download..." > $process | Stop-Process -Force -ErrorAction SilentlyContinue > } > Start-Sleep -Seconds 2 > } > and here is in bash for linux > > #!/bin/bash > > while true; do > echo "Attempting to download model..." > ollama pull modelname & > process_pid=$! > sleep 10 > > if wait $process_pid; then > echo "Model downloaded successfully!" > break > else > echo "Download failed. Retrying..." > kill -9 $process_pid 2>/dev/null > fi > > sleep 2 > done Works well. thank you. I was cursing last night while trying to download deepseek-r1 and llama3.3 only to find it restarted at 20%
Author
Owner

@Skizzy-create commented on GitHub (Feb 8, 2025):

Glad it worked for you! Yeah, I had the same issue with downloads restarting, so I made this script to keep retrying. An --infiniteretry flag for ollama pull would be a great addition! Would love to see that implemented. Let me know if you need any help testing it. 🚀

I could start the work if the contributors want 🚀

<!-- gh-comment-id:2645812004 --> @Skizzy-create commented on GitHub (Feb 8, 2025): Glad it worked for you! Yeah, I had the same issue with downloads restarting, so I made this script to keep retrying. An --infiniteretry flag for ollama pull would be a great addition! Would love to see that implemented. Let me know if you need any help testing it. 🚀 I could start the work if the contributors want 🚀
Author
Owner

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

while : ; do ollama pull llama3 ; done
<!-- gh-comment-id:2645812132 --> @rick-github commented on GitHub (Feb 8, 2025): ``` while : ; do ollama pull llama3 ; done ```
Author
Owner

@Skizzy-create commented on GitHub (Feb 8, 2025):

Ah yes, the classic while :—the UNIX way of saying, I have given up on life, let the loop decide my fate. 😂 But hey, at least it’s a true infinite retry! Now we just need ollama pull && sleep 9999999 for maximum efficiency. 😆

<!-- gh-comment-id:2645813141 --> @Skizzy-create commented on GitHub (Feb 8, 2025): Ah yes, the classic while :—the UNIX way of saying, I have given up on life, let the loop decide my fate. 😂 But hey, at least it’s a true infinite retry! Now we just need ollama pull && sleep 9999999 for maximum efficiency. 😆
Author
Owner

@baraich commented on GitHub (Feb 19, 2025):

@Skizzy-create, Thanks for the snippet brother.

#!/bin/bash

while true; do
    echo "Attempting to download model..."
    ollama pull modelname &
    process_pid=$!
    sleep 10

    if wait $process_pid; then
        echo "Model downloaded successfully!"
        break
    else
        echo "Download failed. Retrying..."
        kill -9 $process_pid 2>/dev/null
    fi

    sleep 2
done
<!-- gh-comment-id:2667616535 --> @baraich commented on GitHub (Feb 19, 2025): @Skizzy-create, Thanks for the snippet brother. ```bash #!/bin/bash while true; do echo "Attempting to download model..." ollama pull modelname & process_pid=$! sleep 10 if wait $process_pid; then echo "Model downloaded successfully!" break else echo "Download failed. Retrying..." kill -9 $process_pid 2>/dev/null fi sleep 2 done ```
Author
Owner

@ShawnLi1102 commented on GitHub (Mar 12, 2025):

Shouldn't this be built into ollama run command? The restart of the download from 0 every time is crazy. Such a bad design.

<!-- gh-comment-id:2716313882 --> @ShawnLi1102 commented on GitHub (Mar 12, 2025): Shouldn't this be built into ollama run command? The restart of the download from 0 every time is crazy. Such a bad design.
Author
Owner

@Mayonnaisu commented on GitHub (Aug 9, 2025):

My download failed at around 90%, and I have to restart it from scratch. This is simply ridiculous!

@Skizzy-create Thanks for the script!

<!-- gh-comment-id:3172064927 --> @Mayonnaisu commented on GitHub (Aug 9, 2025): My download failed at around 90%, and I have to restart it from scratch. This is simply ridiculous! @Skizzy-create Thanks for the script!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#52141