Skip to content

new knowledge base metadata api by openapi methods (curl) return 404 #16179

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

Closed
5 tasks done
StrayDragon opened this issue Mar 19, 2025 · 3 comments · Fixed by #16211
Closed
5 tasks done

new knowledge base metadata api by openapi methods (curl) return 404 #16179

StrayDragon opened this issue Mar 19, 2025 · 3 comments · Fixed by #16211
Assignees
Labels
🐞 bug Something isn't working

Comments

@StrayDragon
Copy link
Contributor

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.1.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I'm noticed new version is released! That cool! But when using in openapi methods to interactive services, i got 404 for all new metadata apis

just follow https://cloud.dify.ai/datasets?category=api doc usage of the /datasets/{dataset_id}/metadata/built-in/{action} api, and fullfil the target knowledge base {dataset_id} and {api_key}

curl --location --request POST 'http://ai.urchinet.lan/v1/datasets/{dataset_id}/metadata/built-in/enable' \
--header 'Authorization: Bearer {api_key}'

got result 404

<!doctype html>
<html lang=en>
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

by the way, directly operate on web ui is ok, maybe some code forgot to added to openapi

ref:

✔️ Expected Behavior

200 ok response

❌ Actual Behavior

404 not found

@dosubot dosubot bot added the 🐞 bug Something isn't working label Mar 19, 2025
@crazywoola
Copy link
Member

crazywoola commented Mar 19, 2025

curl --location --request POST 'https://api.dify.ai/v1/datasets/{dataset_id}/metadata' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json'\
--data-raw '{"type": "string", "name": "test"}'

You can see our service API starts with https://api.dify.ai which can be set in the .env.

SERVICE_API_URL: ${SERVICE_API_URL:-}

From provided information, I think you check this in above setting.

curl --location --request POST 'http://ai.urchinet.lan/v1/datasets/{dataset_id}/metadata/built-in/enable' \
--header 'Authorization: Bearer {api_key}'

@crazywoola crazywoola removed the 🐞 bug Something isn't working label Mar 19, 2025
@StrayDragon
Copy link
Contributor Author

StrayDragon commented Mar 19, 2025

@crazywoola thanks for you rapid reply, maybe i'm not explain clearly, i just use official doc url for accessing curl example content easily, and using self-host docker version actually...

i checked the env SERVICE_API_URL logic, it has default value of host_url value ('http://ai.urchinet.lan'), and tested pass other datasets api!

by the way, i tested in dify official cloud version by

$ curl --location --request POST 'https://api.dify.ai/v1/datasets/XXX/metadata' --header 'Authorization: Bearer XXXX' --header 'Content-Type: application/json'--data-raw '{"type": "string", "name": "test"}'

response 404 ...

<!doctype html>
<html lang=en>
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

@crazywoola
Copy link
Member

Looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants