Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get 503 Error When Pulling Model #646

Open
fatherlinux opened this issue Jan 28, 2025 · 8 comments
Open

Get 503 Error When Pulling Model #646

fatherlinux opened this issue Jan 28, 2025 · 8 comments
Assignees

Comments

@fatherlinux
Copy link

fatherlinux commented Jan 28, 2025

Reproducer

  1. As a foolish individual, first try and download the ollama model with the full web URL: ramalama pull https://ollama.com/library/deepseek-r1:7b
  2. Ramalama does some weird stuff and returns
  3. Ramalama leaves a weird small model thingy in its storage:
[fatherlinux@lance ~]$ ramalama list
NAME                                      MODIFIED    SIZE    
https://ollama.com/library/deepseek-r1:7b 1 hour ago  70.95 KB
  1. User foolishly ignores strange thing that was downloaded, and tries to correct the URL: ramalama pull ollama://deepseek-r1:7b
  2. Get's weird/confusing 503 error:
Request failed: 503
Checksum mismatch for blob /home/fatherlinux/.local/share/ramalama/repos/ollama/blobs/sha256:96c415656d377afbff962f6cdb2394ab092ccbcbaab4b82525bc4ca800fe8a49, retrying download...
Traceback (most recent call last):
  File "/usr/local/bin/ramalama", line 95, in <module>
    main(sys.argv[1:])
  File "/usr/local/bin/ramalama", line 72, in main
    args.func(args)
  File "/usr/local/share/ramalama/ramalama/cli.py", line 578, in pull_cli
    return model.pull(args)
  File "/usr/local/share/ramalama/ramalama/ollama.py", line 108, in pull
    return init_pull(repos, accept, registry_head, model_name, model_tag, models, model_path, self.model)
  File "/usr/local/share/ramalama/ramalama/ollama.py", line 56, in init_pull
    pull_blob(repos, layer_digest, accept, registry_head, models, model_name, model_tag, model_path)
  File "/usr/local/share/ramalama/ramalama/ollama.py", line 38, in pull_blob
    os.remove(layer_blob_path)
FileNotFoundError: [Errno 2] No such file or directory: '/home/fatherlinux/.local/share/ramalama/repos/ollama/blobs/sha256:96c415656d377afbff962f6cdb2394ab092ccbcbaab4b82525bc4ca800fe8a49'
  1. Delete the weird thing: ramalama rm https://ollama.com/library/deepseek-r1:7b
  2. Pull the real model, and things work fine:
ramalama pull ollama://deepseek-r1:7b
100% |████████████████████████████████████████████████████████████████████████████████████|    4.36 GB/   4.36 GB  22.62 MB/s        0s

@ericcurtin
Copy link
Collaborator

/ollama.com/library/deepseek-r1:7b 1 hour ago 70.95 KB

At a minimum on a 503 response we shouldn't populate the model store with this little file

@jhjaggars
Copy link
Collaborator

fwiw, ramalama pull https://ollama.com/library/deepseek-r1:7b doesn't impact my ability to do ramaLama pull ollama://deepseek-r1:7b afterward.

@fatherlinux
Copy link
Author

I updated the reporducer to show that when you delete the weird thing, you can download the real model again

@jhjaggars
Copy link
Collaborator

ramalama on  main is 📦 v0.5.3 via 🐍 v3.10.4 on ☁️
❯ ramalama pull https://ollama.com/library/deepseek-r1:1.5b
100% |████████████████████████████████████|   70.98 KB/    0.00 B   2.23 MB/s   59m 59s


ramalama on  main is 📦 v0.5.3 via 🐍 v3.10.4 on ☁️
❯ ramalama pull ollama://deepseek-r1:1.5b
100% |████████████████████████████████████|    1.04 GB/   1.04 GB  34.30 MB/s        0s

I think the 503 is unrelated to the first pull based on my minimal testing.

@ericcurtin
Copy link
Collaborator

ramalama on  main is 📦 v0.5.3 via 🐍 v3.10.4 on ☁️
❯ ramalama pull https://ollama.com/library/deepseek-r1:1.5b
100% |████████████████████████████████████|   70.98 KB/    0.00 B   2.23 MB/s   59m 59s


ramalama on  main is 📦 v0.5.3 via 🐍 v3.10.4 on ☁️
❯ ramalama pull ollama://deepseek-r1:1.5b
100% |████████████████████████████████████|    1.04 GB/   1.04 GB  34.30 MB/s        0s

I think the 503 is unrelated to the first pull based on my minimal testing.

Yeah the:

https://ollama.com/library/deepseek-r1:7b

behaviour, that's kinda expected, we support plain-old pulls via https:// protocol.

@ericcurtin
Copy link
Collaborator

ericcurtin commented Jan 28, 2025

Although I probably will open a PR anyway to detect:

https://ollama.com/library

or

ollama.com/library

prefix and switch to ollama protocol. Because it's not tricky to parse 😄

@jhjaggars
Copy link
Collaborator

As a note for later; I think that HttpClient.init does not raise any Exceptions (rather it returns 1 on error), so the download_file function never gets any exceptions to handle or reraise. So it seems possible to get a 503, then proceed directly to the checksum verification, then fail as @fatherlinux saw.

@ericcurtin
Copy link
Collaborator

RamaLama equivalent:

#648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants