lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / DeepSeek / Qwen), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Plugins/Artifacts) and Thinking. One-click FREE deployment of your private ChatGPT/ Claude / DeepSeek application.
https://chat-preview.lobehub.com
Other
58.26k stars 12.36k forks source link

[Bug] LobeChat 配置 Casdoor_Webhook 无响应 #5836

Closed Matinal111 closed 1 month ago

Matinal111 commented 1 month ago

📦 Environment

Docker

📌 Version

v1.51.3

💻 Operating System

Windows

🌐 Browser

Chrome, Edge

🐛 Bug Description

根据 #3942 PR 的步骤配置了 Webhook,不过好像并不起作用,casdoor-secret 值与 LobeChat 环境变量 CASDOOR_WEBHOOK_SECRET 确定是一致的

Image

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

lobehubbot commented 1 month ago

👀 @Matinal111

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

dosubot[bot] commented 1 month ago

To troubleshoot the issue with the Casdoor webhook not responding in LobeChat, consider the following steps:

  1. Verify Webhook Configuration: Ensure that the webhook URL, method (POST), and content type (application/json) are correctly configured in Casdoor. Double-check that the URL is accessible from the Casdoor server.

  2. Check Secret Consistency: You've mentioned that the casdoor-secret matches the CASDOOR_WEBHOOK_SECRET in LobeChat. Ensure there are no extra spaces or formatting issues in the secret values.

  3. Network and Firewall Settings: Make sure there are no network or firewall restrictions blocking the webhook requests from Casdoor to LobeChat.

  4. Review Logs for Errors: Check the LobeChat logs for any errors or warnings related to webhook processing. This can provide insights into what might be going wrong.

  5. Payload Format: Ensure that the JSON payload sent by Casdoor matches the expected format by LobeChat. The payload should include an action field and an extendedUser object with the necessary fields [1].

  6. Debugging and Tracing: Utilize LobeChat's tracing capabilities to monitor incoming webhook requests and responses. This can help identify where the process might be failing [2].

If these steps do not resolve the issue, consider reviewing any additional documentation or updates related to the specific version of LobeChat you are using.

To continue talking to Dosu, mention @dosu.


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

Matinal111 commented 1 month ago

@cy948

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Sis 48

Matinal111 commented 1 month ago

LobeChat 环境变量

Image

cy948 commented 1 month ago

试试设置secret为只含数字和字母

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Try setting secret to contain only numbers and letters

cy948 commented 1 month ago

麻烦提供一下服务端的日志

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Please provide the server logs

Matinal111 commented 1 month ago

设置为只含数字和字母的 secret 也不行

Image

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Setting to a secret that only contains numbers and letters is not OK

Image

Matinal111 commented 1 month ago

而且 Casdoor_Webhook 里设置的链接响应 405,这个正常的吗

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


And the link response set in Casdoor_Webhook is 405, is this normal?

cy948 commented 1 month ago

@Matinal111 这个响应不正常,请求没有到 lobe 的容器里。

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Matinal111 This response is not normal and the request is to the lobe container.

Matinal111 commented 1 month ago

那就是 LobeChat 有问题了🤨

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


That's LobeChat has a problem 🤧

cy948 commented 1 month ago

尝试把lobe-chat-database回滚到 v1.51.1 试试看配置有没有问题? 新版有 variant router ,暂不清楚会不会受影响。

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Try rolling back to v1.51.1 and try to see if there is any problem with the configuration? The new version has variant router, and it is not clear whether it will be affected.

Matinal111 commented 1 month ago

回滚到 v1.51.1 ,清除浏览器缓存啥的还是一样

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Roll back to v1.51.1, clear browser cache and other things

Matinal111 commented 1 month ago

然后我再次回滚到相关 PR 发布的 v1.19.12 版本也是一样的情况

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Then I rolled back to the v1.19.12 version released by the relevant PR again.

Snowflake-Pink commented 1 month ago

同样的问题,但是我这边是可以成功webhook到lobe-chat容器的。 我这边的问题似乎出在每次casdoor发布的webhook的更新用户名都是casdoor默认用户。lobe-chat容器报错如下: 2025/02/17 12:50AM 40 pid=29 hostname=8256asas3f31 msg=[casdoor]: Webhooks handler user update for "{"avatar":"https://lobe.xxx.com/casdoor/avatar/built-in/admin.jpeg","email":"admin@example.com","fullName":"Admin"}", but no user was found by the providerAccountId.

但是实际上更新用户名的是lobechat中的账户

Snowflake-Pink commented 1 month ago

2025/02/17 01:10AM 40 pid=29 hostname=825asf1a3f31 msg=[casdoor]: Webhooks handler user update for "{"avatar":"https://lobe.example.com/casdoor/avatar/built-in/Pi.jpeg","email":"hen6hg@example.com","fullName":"Snowflake_Pink"}", but no user was found by the providerAccountId. 我多注册了个用于casdoor的同名账号,在同名账号下,同样修改lobechat用户的头像,但是webhook请求更新的账号却是casdoor的同名账号🤔