Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation error for HttpRequestNodeData method Input #11877

Closed
5 tasks done
yx900210 opened this issue Dec 20, 2024 · 13 comments · Fixed by #12401
Closed
5 tasks done

validation error for HttpRequestNodeData method Input #11877

yx900210 opened this issue Dec 20, 2024 · 13 comments · Fixed by #12401
Labels
🐞 bug Something isn't working 🔨 feat:tools Tools for agent, function call related stuff.

Comments

@yx900210
Copy link

yx900210 commented Dec 20, 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.14.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I use an HTTP request tool, the request type is fixed as an uppercase type, which does not match the API I need to call.

✔️ Expected Behavior

successful running

❌ Actual Behavior

1 validation error for HttpRequestNodeData method Input should be 'get', 'post', 'put', 'patch', 'delete' or 'head' [type=literal_error, input_value='GET', input_type=str] For further information visit https://errors.pydantic.dev/2.9/v/literal_error

捕获
Copy link

dosubot bot commented Dec 20, 2024

Hey @yx900210! 👋 I'm here to help you with any bugs, questions, or contributions you have for the Dify project. I'm a bot designed to assist you while you wait for a human maintainer. Let's squash those bugs together!

The validation error you're encountering is due to the case sensitivity of the HTTP method input in the HttpRequestNodeData class. The class expects the HTTP method to be in lowercase (e.g., "get", "post"), but your tool is sending it in uppercase (e.g., "GET").

To resolve this issue, you can modify the input to ensure that the HTTP method is in lowercase before it is passed to the HttpRequestNodeData class. If you have control over the tool or the code that sends the request, you can convert the method to lowercase using a method like .lower() in Python.

If modifying the input is not feasible, you might need to adjust the code in the Dify platform to handle uppercase inputs by converting them to lowercase before validation. However, this would require changes to the codebase, which should be done with caution and proper testing.

To continue talking to Dosu, mention @dosu.


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

@dosubot dosubot bot added 🐞 bug Something isn't working 🔨 feat:tools Tools for agent, function call related stuff. labels Dec 20, 2024
@crazywoola
Copy link
Member

The image is broken.

@HZFeng666
Copy link

我也遇到了这个问题。我使用fastapi结合pydantic开发了一个脚本,服务启动以后,通过linux服务器上部署的dify的HTTP请求节点去访问接口就会有这个问题,但是我本地Win11系统通过桌面端docker部署的dify,去访问这个接口就没有这个问题。我的win11系统上dify版本是0.11.0。两台服务器dify版本分别是0.11.0和0.14.0。

@yx900210
Copy link
Author

The image is broken.

fixed

@yihong0618
Copy link
Contributor

can you offer your dsl?
I think in frontend we can not use other request method

@yx900210
Copy link
Author

n frontend we can not use other requ

我找到一个解决的办法了,通过curl方式导入api,里面的请求方式动手改成小写就行

@yihong0618
Copy link
Contributor

n frontend we can not use other requ

我找到一个解决的办法了,通过curl方式导入api,里面的请求方式动手改成小写就行

but the lower is default, how did you use GET to HttpRequestNodeData

@nakedking123
Copy link

Also ran into the same issue:
image

@yihong0618
Copy link
Contributor

Also ran into the same issue:

image

can you help to share how to reproduce it?

@876720687
Copy link

876720687 commented Jan 6, 2025

n frontend we can not use other requn 前端我们不能使用其他要求

我找到一个解决的办法了,通过curl方式导入api,里面的请求方式动手改成小写就行

通过你这个方法改变之后我的问题变成了“Reached maximum retries (0) for URL http://...”
并且在重启了服务之后还是这个问题,请问是否遇到过吗?我的版本是0.14.2

@yx900210
Copy link
Author

yx900210 commented Jan 6, 2025 via email

@nakedking123
Copy link

Also ran into the same issue:
image

can you help to share how to reproduce it?

我创建了一个reproduce.yml 里面就一个HTTP block。你可以点开HTTP block,然后点击运行此步骤, 这样就能够浮现了。我是跑在0.14.2上

image image

reproduce.yml.zip

@yihong0618
Copy link
Contributor

Also ran into the same issue:
image

can you help to share how to reproduce it?

我创建了一个reproduce.yml 里面就一个HTTP block。你可以点开HTTP block,然后点击运行此步骤, 这样就能够浮现了。我是跑在0.14.2上

image image
reproduce.yml.zip

Thanks will take a look

yihong0618 added a commit to yihong0618/dify that referenced this issue Jan 6, 2025


Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Scorpion1221 added a commit to yybht155/dify that referenced this issue Jan 11, 2025
* commit 'c236f05f4b575884b42fc45819ad71b05a22115c': (135 commits)
  chore: bump version to 0.15.0 (langgenius#12297)
  refactor: enhance API token validation with session locking and last used timestamp update (langgenius#12426)
  Fix newline characters in tables during document parsing (langgenius#12112)
  fix:deepseek tool call not working correctly (langgenius#12437)
  add fish-speech-1.5 from siliconflow (langgenius#12425)
  chore(docker/.env.example): Add TOP_K_MAX_VALUE to the `.env.example`… (langgenius#12422)
  refactor: use tiktoken for token calculation (langgenius#12416)
  fix: [PromptEditorHeightResizeWrap] Bug  langgenius#12410  (langgenius#12406)
  Fixes langgenius#12414: Add cheaper model and long context model for Qwen2.5-72B-Instruct from siliconflow (langgenius#12415)
  Support TTS and Speech2Text for Model Provider GPUStack (langgenius#12381)
  mark deprecated models in siliconflow langgenius#12399 (langgenius#12405)
  fix: http method can be upper case and lower case close langgenius#11877 (langgenius#12401)
  fix: enhance chunk list management with new invalidation keys and imp… (langgenius#12396)
  [Fix] revert sagemaker llm to support model hub (langgenius#12378)
  sandbox doesn't provide auto disable log (langgenius#12388)
  feat: support config top max value by env (langgenius#12375)
  chore: chat app textarea auto focus (langgenius#12366)
  feat: support configuration of refresh token expiration by environment variable (langgenius#12335)
  fix: resolve issue with the opening statement generated by the `AutomaticRes` component failing to sync between states. (langgenius#12349)
  Fix the issue where `TextGeneration` component does not correctly clear input data. (langgenius#12351)
  ...

# Conflicts:
#	api/core/helper/code_executor/code_executor.py
#	api/poetry.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🔨 feat:tools Tools for agent, function call related stuff.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants