When Curl Works but IntelliJ Doesn't: The Ollama Connection Mystery
a day ago
- #Ollama
- #IPv6
- #IntelliJ
- The author runs internal services through Traefik on their LAN, including Ollama, accessible via HTTPS.
- IntelliJ IDEA fails to connect to Ollama despite curl working fine with both HTTPS and direct HTTP endpoints.
- Initial suspicions included IntelliJ not supporting HTTPS or macOS local network permissions, but these were ruled out.
- The issue was traced to the JVM attempting IPv6 first and failing to fall back to IPv4, leading to a 'No route to host' error.
- The solution was adding '-Djava.net.preferIPv4Stack=true' to IntelliJ's VM options to force IPv4 usage, resolving the connection issue.
- The author emphasizes checking logs for Java GUI connection issues and considering IPv6 preference problems before making extensive changes.