🤖 AI Summary
A developer found that IntelliJ IDEA refused to connect to a local Ollama instance even though curl (both to the Traefik-hosted domain and the raw IP:port) worked fine. The IDE’s Test Connection showed only “Failed to connect,” but the JetBrains log revealed java.net.ConnectException: No route to host. The root cause was the JVM trying IPv6 first on a purely IPv4 LAN and failing to fall back, so the connection attempt died before any IPv4 request. The one‑line fix was to add -Djava.net.preferIPv4Stack=true to IntelliJ’s custom VM options and restart; afterwards both http://10.0.0.105:11434 and https://ollama.tymscar.com connected instantly. A gentler alternative is -Djava.net.preferIPv4Addresses=true.
This matters for AI/ML practitioners because many local model servers (Ollama, Llama, private APIs) are accessed from GUI tools or IDEs running on the JVM; a misleading “connection” error can waste hours debugging TLS, DNS, Traefik, or firewall settings. Key takeaway: check application logs for JVM networking errors and consider IPv4/IPv6 JVM flags before reconfiguring infrastructure. The issue was never TLS or Traefik — it was the JVM’s address-family behavior.
Loading comments...
login to comment
loading comments...
no comments yet