build v0.13.1, report exception #7096

Closed
opened 2026-02-21 18:18:54 -05:00 by yindo · 6 comments
Owner

Originally created by @zhudemiao on GitHub (Dec 7, 2024).

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

0.13.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

make build-api

✔️ Expected Behavior

build successfully

Actual Behavior

report exception:
Step 14/40 : COPY pyproject.toml poetry.lock ./
 ---> b04a92c25834
Step 15/40 : RUN  poetry install --sync --no-cache --no-root
 ---> Running in 088e0657d45f
Creating virtualenv non-package-mode in /app/api/.venv
Installing dependencies from lock file

Package operations: 405 installs, 0 updates, 0 removals

  - Installing frozenlist (1.5.0)
  - Installing idna (3.10)
  - Installing multidict (6.1.0)
  - Installing pycparser (2.22)
  - Installing aiohappyeyeballs (2.4.4)
  - Installing aiosignal (1.3.1)
  - Installing attrs (23.2.0)
  - Installing cffi (1.17.1)
  - Installing charset-normalizer (3.4.0)
  - Installing certifi (2024.8.30)
  - Installing urllib3 (2.2.3)
  - Installing wrapt (1.17.0)
  - Installing yarl (1.9.11)
  - Installing zipp (3.21.0)

  TimeoutError

  The read operation timed out

  at /usr/local/lib/python3.12/ssl.py:1103 in read
      1099│         if self._sslobj is None:
      1100│             raise ValueError("Read on closed or unwrapped SSL socket.")
      1101│         try:
      1102│             if buffer is not None:
    → 1103│                 return self._sslobj.read(len, buffer)
      1104│             else:
      1105│                 return self._sslobj.read(len)
      1106│         except SSLError as x:
      1107│             if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:

The following error occurred when trying to handle this error:


  ReadTimeoutError

  HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

  at /usr/local/lib/python3.12/site-packages/urllib3/response.py:753 in _error_catcher
       749│
       750│             except SocketTimeout as e:
       751│                 # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but
       752│                 # there is yet no clean way to get at it from this context.
    →  753│                 raise ReadTimeoutError(self._pool, None, "Read timed out.") from e  # type: ignore[arg-type]
       754│
       755│             except BaseSSLError as e:
       756│                 # FIXME: Is there a better way to differentiate between SSLErrors?
       757│                 if "read operation timed out" not in str(e):

The following error occurred when trying to handle this error:


  ConnectionError

  HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

  at /usr/local/lib/python3.12/site-packages/requests/models.py:826 in generate
       822│                     raise ChunkedEncodingError(e)
       823│                 except DecodeError as e:
       824│                     raise ContentDecodingError(e)
       825│                 except ReadTimeoutError as e:
    →  826│                     raise ConnectionError(e)
       827│                 except SSLError as e:
       828│                     raise RequestsSSLError(e)
       829│             else:
       830│                 # Standard file-like object.

Cannot install yarl.

The command '/bin/sh -c poetry install --sync --no-cache --no-root' returned a non-zero code: 1
make: *** [Makefile:16: build-api] Error 1
Originally created by @zhudemiao on GitHub (Dec 7, 2024). ### 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 0.13.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce make build-api ### ✔️ Expected Behavior build successfully ### ❌ Actual Behavior ``` report exception: Step 14/40 : COPY pyproject.toml poetry.lock ./ ---> b04a92c25834 Step 15/40 : RUN poetry install --sync --no-cache --no-root ---> Running in 088e0657d45f Creating virtualenv non-package-mode in /app/api/.venv Installing dependencies from lock file Package operations: 405 installs, 0 updates, 0 removals - Installing frozenlist (1.5.0) - Installing idna (3.10) - Installing multidict (6.1.0) - Installing pycparser (2.22) - Installing aiohappyeyeballs (2.4.4) - Installing aiosignal (1.3.1) - Installing attrs (23.2.0) - Installing cffi (1.17.1) - Installing charset-normalizer (3.4.0) - Installing certifi (2024.8.30) - Installing urllib3 (2.2.3) - Installing wrapt (1.17.0) - Installing yarl (1.9.11) - Installing zipp (3.21.0) TimeoutError The read operation timed out at /usr/local/lib/python3.12/ssl.py:1103 in read 1099│ if self._sslobj is None: 1100│ raise ValueError("Read on closed or unwrapped SSL socket.") 1101│ try: 1102│ if buffer is not None: → 1103│ return self._sslobj.read(len, buffer) 1104│ else: 1105│ return self._sslobj.read(len) 1106│ except SSLError as x: 1107│ if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: The following error occurred when trying to handle this error: ReadTimeoutError HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. at /usr/local/lib/python3.12/site-packages/urllib3/response.py:753 in _error_catcher 749│ 750│ except SocketTimeout as e: 751│ # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but 752│ # there is yet no clean way to get at it from this context. → 753│ raise ReadTimeoutError(self._pool, None, "Read timed out.") from e # type: ignore[arg-type] 754│ 755│ except BaseSSLError as e: 756│ # FIXME: Is there a better way to differentiate between SSLErrors? 757│ if "read operation timed out" not in str(e): The following error occurred when trying to handle this error: ConnectionError HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. at /usr/local/lib/python3.12/site-packages/requests/models.py:826 in generate 822│ raise ChunkedEncodingError(e) 823│ except DecodeError as e: 824│ raise ContentDecodingError(e) 825│ except ReadTimeoutError as e: → 826│ raise ConnectionError(e) 827│ except SSLError as e: 828│ raise RequestsSSLError(e) 829│ else: 830│ # Standard file-like object. Cannot install yarl. The command '/bin/sh -c poetry install --sync --no-cache --no-root' returned a non-zero code: 1 make: *** [Makefile:16: build-api] Error 1 ```
yindo added the 🐞 bug label 2026-02-21 18:18:54 -05:00
yindo closed this issue 2026-02-21 18:18:54 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 7, 2024):

@zhudemiao 你好! 我是Dosu,一个可以帮你解决问题、回答你的疑问,并且成为贡献者的机器人。有什么我可以帮你的吗?

A similar issue has been discussed in the Dify repository, where a user encountered timeout errors while building a Docker image [1]. Although the discussion is unsolved, it might provide some context or potential leads.

For your specific issue, the timeout error during the poetry install process suggests a network-related problem. Here are some steps you can try to resolve it:

  1. Check Network Connectivity: Ensure that your network connection is stable and that there are no restrictions or firewalls blocking access to files.pythonhosted.org.

  2. Increase Timeout: You can try increasing the timeout for network operations by setting the POETRY_HTTP_TIMEOUT environment variable to a higher value, such as 120.

  3. Use a Proxy: If you're behind a corporate network or firewall, you might need to configure a proxy. Set the HTTP_PROXY and HTTPS_PROXY environment variables with your proxy details.

  4. Retry the Installation: Sometimes, simply retrying the installation can help if the issue was due to a temporary network glitch.

  5. Check for Local Network Issues: Ensure that there are no local network issues, such as DNS problems, that might be causing the timeout.

These steps should help mitigate the timeout errors during the build process.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Dec 7, 2024): <!-- Greeting --> @zhudemiao 你好! 我是[Dosu](https://dosu.dev),一个可以帮你解决问题、回答你的疑问,并且成为贡献者的机器人。有什么我可以帮你的吗? <!-- Answer --> A similar issue has been discussed in the Dify repository, where a user encountered timeout errors while building a Docker image <sup>[[1]](https://github.com/langgenius/dify/discussions/8113)</sup>. Although the discussion is unsolved, it might provide some context or potential leads. For your specific issue, the timeout error during the `poetry install` process suggests a network-related problem. Here are some steps you can try to resolve it: 1. **Check Network Connectivity:** Ensure that your network connection is stable and that there are no restrictions or firewalls blocking access to `files.pythonhosted.org`. 2. **Increase Timeout:** You can try increasing the timeout for network operations by setting the `POETRY_HTTP_TIMEOUT` environment variable to a higher value, such as `120`. 3. **Use a Proxy:** If you're behind a corporate network or firewall, you might need to configure a proxy. Set the `HTTP_PROXY` and `HTTPS_PROXY` environment variables with your proxy details. 4. **Retry the Installation:** Sometimes, simply retrying the installation can help if the issue was due to a temporary network glitch. 5. **Check for Local Network Issues:** Ensure that there are no local network issues, such as DNS problems, that might be causing the timeout. These steps should help mitigate the timeout errors during the build process. <!-- 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/38bd99d0-6c2e-4612-aab3-297a1fde00e0?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/38bd99d0-6c2e-4612-aab3-297a1fde00e0?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/38bd99d0-6c2e-4612-aab3-297a1fde00e0?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/38bd99d0-6c2e-4612-aab3-297a1fde00e0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/38bd99d0-6c2e-4612-aab3-297a1fde00e0?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/38bd99d0-6c2e-4612-aab3-297a1fde00e0?feedback_type=other)</sup>
Author
Owner

@zhudemiao commented on GitHub (Dec 7, 2024):

if I modify api/Dockerfile from :
RUN poetry install --sync --no-cache --no-root
TO
RUN poetry config repositories.pypi https://pypi.tuna.tsinghua.edu.cn/simple/ && poetry install --sync --no-cache --no-root.
BUT also report error。

@zhudemiao commented on GitHub (Dec 7, 2024): if I modify api/Dockerfile from : RUN poetry install --sync --no-cache --no-root TO RUN poetry config repositories.pypi https://pypi.tuna.tsinghua.edu.cn/simple/ && poetry install --sync --no-cache --no-root. BUT also report error。
Author
Owner

@zhudemiao commented on GitHub (Dec 7, 2024):

  - Installing mdurl (0.1.2)
  - Installing isodate (0.7.2)
  - Installing packaging (24.2)
  - Installing proto-plus (1.25.0)
  - Installing msal (1.31.1)
  - Installing pyparsing (3.2.0)
  - Installing referencing (0.35.1)
  - Installing requests-oauthlib (2.0.0)
  - Installing portalocker (2.10.1)
  - Installing sniffio (1.3.1)
  - Installing markupsafe (3.0.2)
  - Installing opentelemetry-semantic-conventions (0.49b2)

  TimeoutError

  The read operation timed out

  at /usr/local/lib/python3.12/ssl.py:1103 in read
      1099│         if self._sslobj is None:
      1100│             raise ValueError("Read on closed or unwrapped SSL socket.")
      1101│         try:
      1102│             if buffer is not None:
    → 1103│                 return self._sslobj.read(len, buffer)
      1104│             else:
      1105│                 return self._sslobj.read(len)
      1106│         except SSLError as x:
      1107│             if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:

The following error occurred when trying to handle this error:


  ReadTimeoutError

  HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

  at /usr/local/lib/python3.12/site-packages/urllib3/response.py:753 in _error_catcher
       749│
       750│             except SocketTimeout as e:
       751│                 # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but
       752│                 # there is yet no clean way to get at it from this context.
    →  753│                 raise ReadTimeoutError(self._pool, None, "Read timed out.") from e  # type: ignore[arg-type]
       754│
       755│             except BaseSSLError as e:
       756│                 # FIXME: Is there a better way to differentiate between SSLErrors?
       757│                 if "read operation timed out" not in str(e):

The following error occurred when trying to handle this error:


  ConnectionError

  HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

  at /usr/local/lib/python3.12/site-packages/requests/models.py:826 in generate
       822│                     raise ChunkedEncodingError(e)
       823│                 except DecodeError as e:
       824│                     raise ContentDecodingError(e)
       825│                 except ReadTimeoutError as e:
    →  826│                     raise ConnectionError(e)
       827│                 except SSLError as e:
       828│                     raise RequestsSSLError(e)
       829│             else:
       830│                 # Standard file-like object.

Cannot install botocore.

Warning: The file chosen for install of rpds-py 0.22.1 (rpds_py-0.22.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl) is yanked. Reason for being yanked: https://github.com/PyO3/pyo3/issues/4757
The command '/bin/sh -c poetry config repositories.thu https://pypi.tuna.tsinghua.edu.cn/simple/ && poetry install --sync --no-cache --no-root' returned a non-zero code: 1
make: *** [Makefile:16: build-api] Error 1
@zhudemiao commented on GitHub (Dec 7, 2024): ``` - Installing mdurl (0.1.2) - Installing isodate (0.7.2) - Installing packaging (24.2) - Installing proto-plus (1.25.0) - Installing msal (1.31.1) - Installing pyparsing (3.2.0) - Installing referencing (0.35.1) - Installing requests-oauthlib (2.0.0) - Installing portalocker (2.10.1) - Installing sniffio (1.3.1) - Installing markupsafe (3.0.2) - Installing opentelemetry-semantic-conventions (0.49b2) TimeoutError The read operation timed out at /usr/local/lib/python3.12/ssl.py:1103 in read 1099│ if self._sslobj is None: 1100│ raise ValueError("Read on closed or unwrapped SSL socket.") 1101│ try: 1102│ if buffer is not None: → 1103│ return self._sslobj.read(len, buffer) 1104│ else: 1105│ return self._sslobj.read(len) 1106│ except SSLError as x: 1107│ if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: The following error occurred when trying to handle this error: ReadTimeoutError HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. at /usr/local/lib/python3.12/site-packages/urllib3/response.py:753 in _error_catcher 749│ 750│ except SocketTimeout as e: 751│ # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but 752│ # there is yet no clean way to get at it from this context. → 753│ raise ReadTimeoutError(self._pool, None, "Read timed out.") from e # type: ignore[arg-type] 754│ 755│ except BaseSSLError as e: 756│ # FIXME: Is there a better way to differentiate between SSLErrors? 757│ if "read operation timed out" not in str(e): The following error occurred when trying to handle this error: ConnectionError HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. at /usr/local/lib/python3.12/site-packages/requests/models.py:826 in generate 822│ raise ChunkedEncodingError(e) 823│ except DecodeError as e: 824│ raise ContentDecodingError(e) 825│ except ReadTimeoutError as e: → 826│ raise ConnectionError(e) 827│ except SSLError as e: 828│ raise RequestsSSLError(e) 829│ else: 830│ # Standard file-like object. Cannot install botocore. Warning: The file chosen for install of rpds-py 0.22.1 (rpds_py-0.22.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl) is yanked. Reason for being yanked: https://github.com/PyO3/pyo3/issues/4757 The command '/bin/sh -c poetry config repositories.thu https://pypi.tuna.tsinghua.edu.cn/simple/ && poetry install --sync --no-cache --no-root' returned a non-zero code: 1 make: *** [Makefile:16: build-api] Error 1 ```
Author
Owner

@crazywoola commented on GitHub (Dec 7, 2024):

We do not provide help for building from source code, please figure it out yourself or you can ask help in discussion.

@crazywoola commented on GitHub (Dec 7, 2024): We do not provide help for building from source code, please figure it out yourself or you can ask help in discussion.
Author
Owner

@wnqnxbb commented on GitHub (Dec 19, 2024):

The same question

@wnqnxbb commented on GitHub (Dec 19, 2024): The same question
Author
Owner

@chlg commented on GitHub (Mar 4, 2025):

The same question too

@chlg commented on GitHub (Mar 4, 2025): The same question too
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7096