Skip to content

Misc. bug: Model download hangs on hosts with broken IPv6 (no fallback to IPv4) #24783

Description

@CptTZ

Name and Version

any version after #18828

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

No response

Command line

./build/bin/llama-server -hf xxx -c 0 -v

Problem description & steps to reproduce

On a host (e.g. HF) that has an IPv6 (AAAA) DNS record but local does not have working IPv6 route, llama-server -hf hangs at the first HTTP request. With -v it stalls:

tonyz@tonyz-sff-lin ~/s/llama.cpp (master)> ./build/bin/llama-server -hf xxx -c 0 -v
0.00.083.740 I common_params_handle_remote_preset: looking for remote preset at https://huggingface.co/xxx/resolve/main/preset.ini
0.00.084.861 D common_download_file_single_online: no previous model file found xxx

Upon investigation, hang is in cli.Head(). huggingface.co has multiple addresses and cpp-httplib tries them sequentially with IPv6 first, and it never falls back to the working IPv4 address. The default connection timeout at 300s, the request blocks for ~5 minutes before failing.

First Bad Commit

#18828

Relevant log output

Logs
tonyz@tonyz-sff-lin ~/s/llama.cpp (master)> ./build/bin/llama-server -hf xxx -c 0 -v
0.00.083.740 I common_params_handle_remote_preset: looking for remote preset at https://huggingface.co/xxx/resolve/main/preset.ini
0.00.084.861 D common_download_file_single_online: no previous model file found xxx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions