Dify + Ollama Integration Configuration Not Persisting #457

Closed
opened 2026-02-16 10:19:28 -05:00 by yindo · 1 comment
Owner

Originally created by @jt-z on GitHub (Jul 17, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.16.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Environment Information

  • Deployment Method: Docker Compose
  • Dify Version: 1.6.0
  • Ollama Deployment: Host machine systemd service
  • Host IP: 192.168.1.113
  • Ollama Address: http://192.168.1.113:11434
  • Operating System: Ubuntu

Container Status

docker ps
# Shows all containers running normally: nginx, api, web, db, redis, weaviate, etc.

Steps to Reproduce

  1. Deploy Dify using Docker Compose

    docker-compose up -d
    # All containers start successfully
    
  2. Install and configure Ollama on host machine

    curl -fsSL https://ollama.com/install.sh | sh
    ollama serve
    ollama pull qwen:0.5b
    ollama pull deepseek-r1:latest
    
  3. Verify Ollama accessibility from containers

    # Test from host
    curl http://192.168.1.113:11434/api/tags
    # Returns: {"models":[{"name":"qwen:0.5b",...},{"name":"deepseek-r1:latest",...}]}
    
    # Test from Dify API container
    docker exec docker-api-1 curl http://192.168.1.113:11434/api/tags
    # Returns same successful response
    
  4. Access Dify web interface

    • Navigate to http://192.168.1.113 (or configured domain)
    • Log in to admin panel
  5. Attempt to configure Ollama provider

    • Go to Settings → Model Providers
    • Click "Add Ollama"
    • Fill in configuration:
      • Model Type: LLM
      • Model Name: qwen:0.5b
      • Base URL: http://192.168.1.113:11434
      • Model Type: Chat
      • Context Length: 4096
      • Max Token Limit: 4096
    • Click "Save"
  6. Observe the issue

    • Frontend displays "Configuration Successful" message
    • Return to Model Providers list
    • Ollama section shows "0 models" (configuration not persisted)

Verified Working Components

  1. Ollama Service Normal: curl http://192.168.1.113:11434/api/tags returns model list
  2. Container Network Connectivity: docker exec docker-api-1 curl http://192.168.1.113:11434/api/tags succeeds
  3. Frontend Interface Normal: Can open configuration page and fill forms
  4. Database Container Normal: postgres status healthy

Core Issue

When configuring Ollama:

  • Frontend configuration submission shows "Configuration Successful"
  • But API container logs show NO new output whatsoever
  • Configuration is not actually saved to database
  • Model list still shows "0 models"

Diagnostic Results

# API log monitoring - No new output during configuration
docker logs docker-api-1 -f | grep -E "(ollama|model|error)"
# Only shows startup logs, no new logs during configuration

# Network connectivity - Normal
docker exec docker-api-1 curl -v http://192.168.1.113:11434/api/tags
# Returns 200 OK with complete model list

Suspected Causes

  1. Frontend-Backend Communication Issue: Frontend configuration requests not reaching backend API
  2. Nginx Reverse Proxy Configuration Issue: Configuration requests intercepted or routed incorrectly
  3. Frontend JavaScript Error: Configuration requests not sent properly
  4. API Routing Issue: Specific model configuration API endpoint malfunction

Investigation Directions

  1. nginx container logs and configuration
  2. web container to api container network connectivity
  3. Browser developer tools network request status
  4. Database write permissions and table structure
  5. Docker Compose network configuration

Expected Outcome

After configuring Ollama should be able to:

  • Correctly save to database
  • Display Ollama-provided models in model list
  • Successfully invoke Ollama models in applications

✔️ Expected Behavior

When configuring Ollama model provider in Docker-deployed Dify platform, the frontend configuration interface shows "Configuration Successful", the configuration is expected to be saved. The model list should displays "1 or more models".

Actual Behavior

When configuring Ollama model provider in Docker-deployed Dify platform, the frontend configuration interface shows "Configuration Successful", but the configuration is not actually saved. The model list still displays "0 models".

Image Image
Originally created by @jt-z on GitHub (Jul 17, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.16.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ## Environment Information - **Deployment Method**: Docker Compose - **Dify Version**: 1.6.0 - **Ollama Deployment**: Host machine systemd service - **Host IP**: 192.168.1.113 - **Ollama Address**: http://192.168.1.113:11434 - **Operating System**: Ubuntu ## Container Status ```bash docker ps # Shows all containers running normally: nginx, api, web, db, redis, weaviate, etc. ``` ## Steps to Reproduce 1. **Deploy Dify using Docker Compose** ```bash docker-compose up -d # All containers start successfully ``` 2. **Install and configure Ollama on host machine** ```bash curl -fsSL https://ollama.com/install.sh | sh ollama serve ollama pull qwen:0.5b ollama pull deepseek-r1:latest ``` 3. **Verify Ollama accessibility from containers** ```bash # Test from host curl http://192.168.1.113:11434/api/tags # Returns: {"models":[{"name":"qwen:0.5b",...},{"name":"deepseek-r1:latest",...}]} # Test from Dify API container docker exec docker-api-1 curl http://192.168.1.113:11434/api/tags # Returns same successful response ``` 4. **Access Dify web interface** - Navigate to `http://192.168.1.113` (or configured domain) - Log in to admin panel 5. **Attempt to configure Ollama provider** - Go to Settings → Model Providers - Click "Add Ollama" - Fill in configuration: - Model Type: LLM - Model Name: `qwen:0.5b` - Base URL: `http://192.168.1.113:11434` - Model Type: Chat - Context Length: 4096 - Max Token Limit: 4096 - Click "Save" 6. **Observe the issue** - Frontend displays "Configuration Successful" message - Return to Model Providers list - Ollama section shows "0 models" (configuration not persisted) ## Verified Working Components 1. ✅ **Ollama Service Normal**: `curl http://192.168.1.113:11434/api/tags` returns model list 2. ✅ **Container Network Connectivity**: `docker exec docker-api-1 curl http://192.168.1.113:11434/api/tags` succeeds 3. ✅ **Frontend Interface Normal**: Can open configuration page and fill forms 4. ✅ **Database Container Normal**: postgres status healthy ## Core Issue When configuring Ollama: - Frontend configuration submission shows "Configuration Successful" - **But API container logs show NO new output whatsoever** - Configuration is not actually saved to database - Model list still shows "0 models" ## Diagnostic Results ```bash # API log monitoring - No new output during configuration docker logs docker-api-1 -f | grep -E "(ollama|model|error)" # Only shows startup logs, no new logs during configuration # Network connectivity - Normal docker exec docker-api-1 curl -v http://192.168.1.113:11434/api/tags # Returns 200 OK with complete model list ``` ## Suspected Causes 1. **Frontend-Backend Communication Issue**: Frontend configuration requests not reaching backend API 2. **Nginx Reverse Proxy Configuration Issue**: Configuration requests intercepted or routed incorrectly 3. **Frontend JavaScript Error**: Configuration requests not sent properly 4. **API Routing Issue**: Specific model configuration API endpoint malfunction ## Investigation Directions 1. nginx container logs and configuration 2. web container to api container network connectivity 3. Browser developer tools network request status 4. Database write permissions and table structure 5. Docker Compose network configuration ## Expected Outcome After configuring Ollama should be able to: - Correctly save to database - Display Ollama-provided models in model list - Successfully invoke Ollama models in applications ### ✔️ Expected Behavior When configuring Ollama model provider in Docker-deployed Dify platform, the frontend configuration interface shows "Configuration Successful", the configuration is expected to be saved. The model list should displays "1 or more models". ### ❌ Actual Behavior When configuring Ollama model provider in Docker-deployed Dify platform, the frontend configuration interface shows "Configuration Successful", but the configuration is not actually saved. The model list still displays "0 models". <img width="616" height="495" alt="Image" src="https://github.com/user-attachments/assets/4bc554f1-893e-4cf9-8b57-f130a805ba44" /> <img width="1470" height="645" alt="Image" src="https://github.com/user-attachments/assets/14ca21af-8e08-47aa-a163-adb72b49af6d" />
yindo closed this issue 2026-02-16 10:19:28 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 19, 2025):

Hi, @jt-z. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that with Dify v0.16.0 (self-hosted via Docker Compose), Ollama running as a systemd service on the host does not retain its configuration when integrated.
  • Ollama is reachable from the Dify containers, but integration settings fail to save correctly.
  • There has been no further activity or comments on this issue since your initial report.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here to keep the discussion open.
  • If I do not hear back within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 19, 2025): Hi, @jt-z. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that with Dify v0.16.0 (self-hosted via Docker Compose), Ollama running as a systemd service on the host does not retain its configuration when integrated. - Ollama is reachable from the Dify containers, but integration settings fail to save correctly. - There has been no further activity or comments on this issue since your initial report. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here to keep the discussion open. - If I do not hear back within 5 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#457