In the workflow’s code executor, an exception occurs when the value of the input parameter is set to the string ‘daily’, however others strings are acceptable. #7852

Closed
opened 2026-02-21 18:22:41 -05:00 by yindo · 3 comments
Owner

Originally created by @HENScience on GitHub (Jan 22, 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

0.15.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

sandbox settings:

config.yaml:

app:
  port: 8194
  debug: True
  key: dify-sandbox
max_workers: 4
max_requests: 50
worker_timeout: 5
python_path: /usr/local/bin/python3
python_lib_path:
  - /usr/local/lib/python3.10
  - /usr/lib/python3.10
  - /usr/lib/python3

python-requirements:

requests
lxml

✔️ Expected Behavior

I want to scrape content from certain websites. The URL links of these websites require passing parameters such as ‘daily’ and ‘weekly’. When the parameter ‘weekly’ is passed, the content can be retrieved normally, but when the ‘daily’ parameter is passed, an error occurs as follows:

Traceback (most recent call last): File "/var/sandbox/sandbox-python/tmp/32d1ea8e_8455_4014_b651_7a5d7bea3461.py", line 48, in File "", line 51, in File "", line 18, in main AttributeError: 'NoneType' object has no attribute 'text' error: exit status 255

Actual Behavior

No response

Originally created by @HENScience on GitHub (Jan 22, 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). - [ ] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [ ] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [ ] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [ ] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ### **sandbox settings:** **config.yaml:** ``` app: port: 8194 debug: True key: dify-sandbox max_workers: 4 max_requests: 50 worker_timeout: 5 python_path: /usr/local/bin/python3 python_lib_path: - /usr/local/lib/python3.10 - /usr/lib/python3.10 - /usr/lib/python3 ``` **python-requirements:** ``` requests lxml ``` ### ✔️ Expected Behavior I want to scrape content from certain websites. The URL links of these websites require passing parameters such as ‘daily’ and ‘weekly’. When the parameter ‘weekly’ is passed, the content can be retrieved normally, but when the ‘daily’ parameter is passed, an error occurs as follows: > Traceback (most recent call last): File "/var/sandbox/sandbox-python/tmp/32d1ea8e_8455_4014_b651_7a5d7bea3461.py", line 48, in <module> File "<string>", line 51, in <module> File "<string>", line 18, in main AttributeError: 'NoneType' object has no attribute 'text' error: exit status 255 ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:22:41 -05:00
yindo closed this issue 2026-02-21 18:22:41 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 22, 2025):

@HENScience Hello there! I'm here to help you with bug fixes, answer your questions, and guide you on how to contribute. Let's tackle this issue together!

The error you're encountering, AttributeError: 'NoneType' object has no attribute 'text', suggests that when the 'daily' parameter is used, the response object is None, and you're trying to access the text attribute on it. This typically happens when the request to the URL fails or returns an unexpected result.

Here are a few steps you can take to troubleshoot and resolve this issue:

  1. Check the URL and Parameters: Ensure that the URL you are using with the 'daily' parameter is correct and accessible. There might be a difference in how the server handles 'daily' compared to 'weekly'.

  2. Inspect the Response: Before accessing the text attribute, check if the response is None or if the status code indicates an error. You can add a check like this:

    if response is None or response.status_code != 200:
        print("Failed to retrieve content")
    else:
        content = response.text
    
  3. Error Handling: Implement error handling to manage cases where the response might be None. This can prevent the script from crashing and provide more informative error messages.

  4. Server Logs: If you have access to server logs, check them for any errors or messages that occur when the 'daily' parameter is used. This might give you more insight into why the request fails.

  5. API Documentation: If you're using an API, refer to its documentation to see if there are any known issues or limitations with using 'daily' as a parameter.

By following these steps, you should be able to identify the root cause of the issue and implement a solution. If the problem persists, consider logging additional details about the request and response to help diagnose the issue further.

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 (Jan 22, 2025): <!-- Greeting --> @HENScience Hello there! I'm here to help you with bug fixes, answer your questions, and guide you on how to contribute. Let's tackle this issue together! <!-- Answer --> The error you're encountering, `AttributeError: 'NoneType' object has no attribute 'text'`, suggests that when the 'daily' parameter is used, the response object is `None`, and you're trying to access the `text` attribute on it. This typically happens when the request to the URL fails or returns an unexpected result. Here are a few steps you can take to troubleshoot and resolve this issue: 1. **Check the URL and Parameters**: Ensure that the URL you are using with the 'daily' parameter is correct and accessible. There might be a difference in how the server handles 'daily' compared to 'weekly'. 2. **Inspect the Response**: Before accessing the `text` attribute, check if the response is `None` or if the status code indicates an error. You can add a check like this: ```python if response is None or response.status_code != 200: print("Failed to retrieve content") else: content = response.text ``` 3. **Error Handling**: Implement error handling to manage cases where the response might be `None`. This can prevent the script from crashing and provide more informative error messages. 4. **Server Logs**: If you have access to server logs, check them for any errors or messages that occur when the 'daily' parameter is used. This might give you more insight into why the request fails. 5. **API Documentation**: If you're using an API, refer to its documentation to see if there are any known issues or limitations with using 'daily' as a parameter. By following these steps, you should be able to identify the root cause of the issue and implement a solution. If the problem persists, consider logging additional details about the request and response to help diagnose the issue further. <!-- 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/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Jan 22, 2025):

Can you provide the example content in code node?

@crazywoola commented on GitHub (Jan 22, 2025): Can you provide the example content in code node?
Author
Owner

@HENScience commented on GitHub (Jan 22, 2025):

@HENScience Hello there! I'm here to help you with bug fixes, answer your questions, and guide you on how to contribute. Let's tackle this issue together!

The error you're encountering, AttributeError: 'NoneType' object has no attribute 'text', suggests that when the 'daily' parameter is used, the response object is None, and you're trying to access the text attribute on it. This typically happens when the request to the URL fails or returns an unexpected result.

Here are a few steps you can take to troubleshoot and resolve this issue:

  1. Check the URL and Parameters: Ensure that the URL you are using with the 'daily' parameter is correct and accessible. There might be a difference in how the server handles 'daily' compared to 'weekly'.
  2. Inspect the Response: Before accessing the text attribute, check if the response is None or if the status code indicates an error. You can add a check like this:
    if response is None or response.status_code != 200:
    print("Failed to retrieve content")
    else:
    content = response.text
  3. Error Handling: Implement error handling to manage cases where the response might be None. This can prevent the script from crashing and provide more informative error messages.
  4. Server Logs: If you have access to server logs, check them for any errors or messages that occur when the 'daily' parameter is used. This might give you more insight into why the request fails.
  5. API Documentation: If you're using an API, refer to its documentation to see if there are any known issues or limitations with using 'daily' as a parameter.

By following these steps, you should be able to identify the root cause of the issue and implement a solution. If the problem persists, consider logging additional details about the request and response to help diagnose the issue further.

To continue talking to Dosu, mention @dosu.

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

@HENScience commented on GitHub (Jan 22, 2025): > [@HENScience](https://github.com/HENScience) Hello there! I'm here to help you with bug fixes, answer your questions, and guide you on how to contribute. Let's tackle this issue together! > > The error you're encountering, `AttributeError: 'NoneType' object has no attribute 'text'`, suggests that when the 'daily' parameter is used, the response object is `None`, and you're trying to access the `text` attribute on it. This typically happens when the request to the URL fails or returns an unexpected result. > > Here are a few steps you can take to troubleshoot and resolve this issue: > > 1. **Check the URL and Parameters**: Ensure that the URL you are using with the 'daily' parameter is correct and accessible. There might be a difference in how the server handles 'daily' compared to 'weekly'. > 2. **Inspect the Response**: Before accessing the `text` attribute, check if the response is `None` or if the status code indicates an error. You can add a check like this: > if response is None or response.status_code != 200: > print("Failed to retrieve content") > else: > content = response.text > 3. **Error Handling**: Implement error handling to manage cases where the response might be `None`. This can prevent the script from crashing and provide more informative error messages. > 4. **Server Logs**: If you have access to server logs, check them for any errors or messages that occur when the 'daily' parameter is used. This might give you more insight into why the request fails. > 5. **API Documentation**: If you're using an API, refer to its documentation to see if there are any known issues or limitations with using 'daily' as a parameter. > > By following these steps, you should be able to identify the root cause of the issue and implement a solution. If the problem persists, consider logging additional details about the request and response to help diagnose the issue further. > > _To continue talking to [Dosu](https://dosu.dev), mention [@dosu](https://github.com/dosu)._ > > Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/2f09a4e8-587d-4c10-a47d-a8a13774806a?feedback_type=other)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7852