builtin provider not found when importing
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.6.8
Cloud or Self Hosted
Cloud, Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
When importing a tool where you don't have setup authentication for that tool, you get toast error "builtin provider X not found". And you remain in the same import window, this makes so the user is confused if the error made the import fail or not.
✔️ Expected Behavior
Maybe redirect anyways to the studio, or prompt the user to authenticate for the tool(s) right away.
❌ Actual Behavior
Error, but it imports the app anyways when hard refreshing the site.
To address the issue of encountering a "builtin provider X not found" error during import in Dify version 0.6.8, and improving the overall user experience, consider the following steps:
-
Ensure Immediate Authentication: Implement
@login_requiredand@account_initialization_requireddecorators on API endpoints related to importing or accessing provider data. This will prompt users to authenticate immediately if they haven't already, preventing the error due to unauthenticated access. -
Redirect Users Post-Import: Modify the import process to include a redirection to the studio upon successful completion. This can be done by returning a HTTP redirect response from the API endpoint handling the import, guiding users directly to the studio without confusion.
-
Improve Error Handling: Enhance error handling to provide clear feedback when encountering the "builtin provider X not found" error. Ensure the provider's existence is checked before attempting the import and return a meaningful error message if the provider is not found. Implement a frontend mechanism to display these error messages clearly to the user.
-
Fix Session Management: Address the issue where the import appears successful after a hard refresh by ensuring the session state is correctly updated upon successful import. This may involve setting session variables or using client-side scripts to update the UI accordingly, eliminating the need for a hard refresh.
By implementing these recommendations, you can streamline the import process, ensuring users are promptly authenticated, clearly informed of any errors, and smoothly redirected post-import, enhancing the overall user experience.
Details
Sources
- api/controllers/console/workspace/tool_providers.py
- api/controllers/console/app/app.py
- web/app/components/workflow/store.ts
- web/app/components/workflow/hooks/use-workflow-interactions.ts
- web/app/components/workflow/hooks/use-nodes-sync-draft.ts
- api/controllers/console/wraps.py
- api/controllers/console/workspace/account.py
- api/libs/login.py
- web/app/(shareLayout)/webapp-signin/page.tsx
- web/utils/app-redirection.ts
- api/controllers/web/error.py
- web/app/components/datasets/documents/detail/segment-add/index.tsx
- web/app/components/app/annotation/batch-add-annotation-modal/index.tsx
- api/core/tools/provider/builtin/aippt/aippt.py
- api/services/tools_manage_service.py
- api/core/tools/provider/api_tool_provider.py
- api/core/tools/tool_manager.py
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.