Add Proxy in Alibaba Cloud Dify: 'Expecting value' Error on Page and X Installation Failure in Model Providers #12945

Closed
opened 2026-02-21 19:09:48 -05:00 by yindo · 2 comments
Owner

Originally created by @zyfhg on GitHub (Apr 15, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Cloud or Self Hosted

Cloud

Steps to reproduce

Hello, I launched Dify on Alibaba Cloud. In order to use the Grok API on it, I made the following modifications to the docker-compose.yaml file, hoping to use the proxy on the host machine. Here are the modifications I made: I added proxy configurations to four services, namely api, worker, web, and plugin_daemon.
After the modification, I conducted a test and was able to successfully use curl to access Google within the api Docker container. However, after accessing the Dify startup page, the page kept showing the error "Expecting value: line 1 column 1 (char 0)". Could you tell me what might be the cause of this issue?
Moreover, I found that I'm unable to install X in the model providers section. Can you help me troubleshoot this problem?


x-proxy-env: &proxy-env #new
  HTTP_PROXY:  http://172.17.0.1:7890
  HTTPS_PROXY: http://172.17.0.1:7890
  NO_PROXY: localhost,127.0.0.1,::1,db,redis,nginx,ssrf_proxy,sandbox

x-shared-env: &shared-api-worker-env
   .....
services:
  # API service
  api:
    image: langgenius/dify-api:1.2.0
    restart: always
    dns:  #new addition
      - 8.8.8.8
      - 8.8.4.4
    environment:
      # Use the shared environment variables.
      <<: [*shared-api-worker-env, *proxy-env]  #new addition
      # Startup mode, 'api' starts the API server.
      MODE: api
....
  worker:
    image: langgenius/dify-api:1.2.0
    restart: always
    dns:  #new addition
      - 8.8.8.8
      - 8.8.4.4
    environment:
      # Use the shared environment variables.
      <<: [*shared-api-worker-env, *proxy-env]  #new addition
      # Startup mode, 'worker' starts the Celery worker for processing the queue.
      MODE: worker
....
  web:
    image: langgenius/dify-web:1.2.0
    restart: always
    dns:  #new addition
      - 8.8.8.8
      - 8.8.4.4
    environment:
      <<: *proxy-env  #new addition
      CONSOLE_API_URL: ${CONSOLE_API_URL:-}
  # plugin daemon
  plugin_daemon:
    image: langgenius/dify-plugin-daemon:0.0.7-local
    dns:   #new addition
      - 8.8.8.8
      - 8.8.4.4
    restart: always
    environment:
      # Use the shared environment variables.   
      <<: [*shared-api-worker-env, *proxy-env]    #new addition
      DB_DATABASE: ${DB_PLUGIN_DATABASE:-dify_plugin}
      SERVER_PORT: ${PLUGIN_DAEMON_PORT:-5002}

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @zyfhg on GitHub (Apr 15, 2025). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce Hello, I launched Dify on Alibaba Cloud. In order to use the Grok API on it, I made the following modifications to the docker-compose.yaml file, hoping to use the proxy on the host machine. Here are the modifications I made: I added proxy configurations to four services, namely api, worker, web, and plugin_daemon. After the modification, I conducted a test and was able to successfully use curl to access Google within the api Docker container. However, after accessing the Dify startup page, the page kept showing the error "Expecting value: line 1 column 1 (char 0)". Could you tell me what might be the cause of this issue? Moreover, I found that I'm unable to install X in the model providers section. Can you help me troubleshoot this problem? ``` x-proxy-env: &proxy-env #new HTTP_PROXY: http://172.17.0.1:7890 HTTPS_PROXY: http://172.17.0.1:7890 NO_PROXY: localhost,127.0.0.1,::1,db,redis,nginx,ssrf_proxy,sandbox x-shared-env: &shared-api-worker-env ..... services: # API service api: image: langgenius/dify-api:1.2.0 restart: always dns: #new addition - 8.8.8.8 - 8.8.4.4 environment: # Use the shared environment variables. <<: [*shared-api-worker-env, *proxy-env] #new addition # Startup mode, 'api' starts the API server. MODE: api .... worker: image: langgenius/dify-api:1.2.0 restart: always dns: #new addition - 8.8.8.8 - 8.8.4.4 environment: # Use the shared environment variables. <<: [*shared-api-worker-env, *proxy-env] #new addition # Startup mode, 'worker' starts the Celery worker for processing the queue. MODE: worker .... web: image: langgenius/dify-web:1.2.0 restart: always dns: #new addition - 8.8.8.8 - 8.8.4.4 environment: <<: *proxy-env #new addition CONSOLE_API_URL: ${CONSOLE_API_URL:-} # plugin daemon plugin_daemon: image: langgenius/dify-plugin-daemon:0.0.7-local dns: #new addition - 8.8.8.8 - 8.8.4.4 restart: always environment: # Use the shared environment variables. <<: [*shared-api-worker-env, *proxy-env] #new addition DB_DATABASE: ${DB_PLUGIN_DATABASE:-dify_plugin} SERVER_PORT: ${PLUGIN_DAEMON_PORT:-5002} ``` ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🙏 help wanted🤔 cant-reproduce labels 2026-02-21 19:09:48 -05:00
yindo closed this issue 2026-02-21 19:09:48 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 15, 2025):

Hello @zyfhg! I'm Dosu, a bot here to help you with bugs, answer your questions, and assist you in becoming a contributor. I'm ready to help while you wait for a human maintainer. Let's tackle your issue together!

I found similar threads discussing the "Expecting value: line 1 column 1 (char 0)" error and issues with proxy configurations in Dify:

  1. An open discussion titled "After installing and deploying dify with docker-compose, I encountered an error in the latest version 1.2.0 as shown in the picture. What should I do? Thank you." which might be relevant to your situation [1].

  2. A closed issue suggests configuring the NO_PROXY environment variable with specific values to resolve similar errors. You should include weaviate,qdrand,db,redis,web,worker,plugin_daemon in your NO_PROXY settings to ensure proper communication between Docker containers [2][3].

To address the error and installation failure:

  • Ensure your NO_PROXY configuration includes all necessary services to prevent internal traffic from being routed through the proxy. This includes services like weaviate,qdrand,db,redis,web,worker,plugin_daemon.
  • Verify that your proxy settings (HTTP_PROXY, HTTPS_PROXY) are correctly configured and that they do not interfere with internal communications.
  • Consider adding all Docker services to the noProxy variable in your Docker configuration files (.docker/config.json or docker/daemon.json) [4].

These steps should help resolve the JSON parsing error and the installation issue in the model providers section.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 15, 2025): <!-- Greeting --> Hello @zyfhg! I'm [Dosu](https://dosu.dev), a bot here to help you with bugs, answer your questions, and assist you in becoming a contributor. I'm ready to help while you wait for a human maintainer. Let's tackle your issue together! <!-- Answer --> I found similar threads discussing the "Expecting value: line 1 column 1 (char 0)" error and issues with proxy configurations in Dify: 1. An open discussion titled "[After installing and deploying dify with docker-compose, I encountered an error in the latest version 1.2.0 as shown in the picture. What should I do? Thank you.](https://github.com/langgenius/dify/discussions/18008)" which might be relevant to your situation <sup>[[1]](https://github.com/langgenius/dify/discussions/18008)</sup>. 2. A closed issue suggests configuring the `NO_PROXY` environment variable with specific values to resolve similar errors. You should include `weaviate,qdrand,db,redis,web,worker,plugin_daemon` in your `NO_PROXY` settings to ensure proper communication between Docker containers <sup>[[2]](https://github.com/langgenius/dify/issues/14608)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/14822)</sup>. To address the error and installation failure: - Ensure your `NO_PROXY` configuration includes all necessary services to prevent internal traffic from being routed through the proxy. This includes services like `weaviate,qdrand,db,redis,web,worker,plugin_daemon`. - Verify that your proxy settings (`HTTP_PROXY`, `HTTPS_PROXY`) are correctly configured and that they do not interfere with internal communications. - Consider adding all Docker services to the `noProxy` variable in your Docker configuration files (`.docker/config.json` or `docker/daemon.json`) <sup>[[4]](https://github.com/langgenius/dify/issues/14663)</sup>. These steps should help resolve the JSON parsing error and the installation issue in the model providers section. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/19c21df1-c0ad-4d0b-90d5-eff4c4e47a1d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/19c21df1-c0ad-4d0b-90d5-eff4c4e47a1d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/19c21df1-c0ad-4d0b-90d5-eff4c4e47a1d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/19c21df1-c0ad-4d0b-90d5-eff4c4e47a1d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/19c21df1-c0ad-4d0b-90d5-eff4c4e47a1d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/19c21df1-c0ad-4d0b-90d5-eff4c4e47a1d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/19c21df1-c0ad-4d0b-90d5-eff4c4e47a1d?feedback_type=other)</sup>
Author
Owner

@Sakura4036 commented on GitHub (Apr 21, 2025):

I added HTTP PROXY env for sanbox and plugin_daemon in middleware docker yaml, like you implemented, but I did not modify the dns, and also since I was started from source code, I also added HTTP PROXY at startup env. Currently, Google Gemini Model Provider is correctly used.

x-proxy-env: &proxy-env
  HTTP_PROXY:  http://192.168.1.5:7890
  HTTPS_PROXY: http://192.168.1.5:7890
  NO_PROXY: localhost,127.0.0.1,::1,db,redis,ssrf_proxy,sandbox, 192.168.0.1/16

services:
  sandbox:
    image: langgenius/dify-sandbox:0.2.11
    restart: always
    env_file:
      - ./middleware.env
    environment:
      <<: *proxy-env
      ...

  plugin_daemon:
    image: langgenius/dify-plugin-daemon:0.0.7-local
    restart: always
    env_file:
      - ./middleware.env
    environment:
      <<: *proxy-env
...
@Sakura4036 commented on GitHub (Apr 21, 2025): I added HTTP PROXY env for sanbox and plugin_daemon in middleware docker yaml, like you implemented, but I did not modify the dns, and also since I was started from source code, I also added HTTP PROXY at startup env. Currently, Google Gemini Model Provider is correctly used. ```yaml x-proxy-env: &proxy-env HTTP_PROXY: http://192.168.1.5:7890 HTTPS_PROXY: http://192.168.1.5:7890 NO_PROXY: localhost,127.0.0.1,::1,db,redis,ssrf_proxy,sandbox, 192.168.0.1/16 services: sandbox: image: langgenius/dify-sandbox:0.2.11 restart: always env_file: - ./middleware.env environment: <<: *proxy-env ... plugin_daemon: image: langgenius/dify-plugin-daemon:0.0.7-local restart: always env_file: - ./middleware.env environment: <<: *proxy-env ... ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12945