A user named Tikkel is experiencing issues with the Ollama plugin in Discourse, encountering an “Internal Server Error” when trying to use it, despite successfully testing the Ollama service inside the container. Falco suggests checking the logs and ensuring the Ollama instance is reachable by Discourse. Tikkel shares the logs, showing a successful API call but an error when testing through the WebUI. After further troubleshooting, Tikkel discovers that the issue was due to incorrect syntax in the environment variable DISCOURSE_ALLOWED_INTERNAL_HOSTS, which required pipes (|) instead of commas to separate values. The correct syntax is DISCOURSE_ALLOWED_INTERNAL_HOSTS: “localhost|127.0.0.1|172.17.0.1”.
In the container, i can use the ollama-service. But in the Discourse-Plugin comes only a “Internal Server Error”.
curl http://172.17.0.1:11434/v1/chat/completions -H “Content-Type: application/json” -d ‘{
“model”: “llama3.1:8b”,
“messages”: \[{“role”: “user”, “content”: “Hallo”}\]
}’
{“id”:“chatcmpl-145”,“object”:“chat.completion”,“created”:1760470827,“model”:“llama3.1:8b”,“system_fingerprint”:“fp_ollama”,“choices”:\[{“index”:0,“message”:{“role”:“assistant”,“content”:“Halló! (That’s the Icelandic pronunciation, by the way) or more commonly: Hallo! How can I help you today?”},“finish_reason”:“stop”}\],“usage”:{“prompt_tokens”:11,“completion_tokens”:29,“total_tokens”:40}}
Can you go to the page at /logs on your instance and share the error info here please?
Did you run the cURL test from inside the Discourse container or from the outside? It may be a networking issue where you need to make the ollama instance reachable by Discourse.