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

[Bug] 数据库版本修改显示名称和头像不生效 #6130

Closed
Whisht opened this issue Feb 14, 2025 · 36 comments · Fixed by #6181
Closed

[Bug] 数据库版本修改显示名称和头像不生效 #6130

Whisht opened this issue Feb 14, 2025 · 36 comments · Fixed by #6181
Labels
🐛 Bug Something isn't working | 缺陷 files 上传文件/知识库 released

Comments

@Whisht
Copy link

Whisht commented Feb 14, 2025

📦 部署环境

Docker

📌 软件版本

latest

💻 系统环境

Ubuntu

🌐 浏览器

Firefox

🐛 问题描述

在管理后端修改用户的头像(已链接 MinIO 服务)和显示名称不生效,但是密码和用户名可以生效。
后台管理界面:

Image 用户界面: Image

📷 复现步骤

  1. 根据官网文档配置MinIO 存储服务。
  2. 登录管理后端(8000)端口修改用户头像和用户显示名称。

🚦 期望结果

修改后可以生效

📝 补充信息

No response

@Whisht Whisht added the 🐛 Bug Something isn't working | 缺陷 label Feb 14, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Feb 14, 2025
@lobehubbot
Copy link
Member

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


📦 Deployment environment

Docker

📌 Software version

Latest

💻 System environment

Ubuntu

🌐 Browser

Firefox

🐛 Question description

Modifying the user's avatar (linked MinIO service) and display name on the management backend does not take effect, but the password and username can take effect.
Backend management interface:

Image user interface: Image

📷 Reproduction steps

  1. According to [official website document] (https://lobehub.com/zh/docs/self-hosting/server-database/docker-compose#%E4%BD%BF%E7%94%A8-min-io-% E5%AD%98%E5%82%A8-casdoor-%E5%A4%B4%E5%83%8F) Configure MinIO storage service.
  2. Log in to the management backend (8000) port to modify the user avatar and user display name.

🚦 Expected results

It can take effect after modification

📝 Supplementary information

No response

@lobehubbot
Copy link
Member

👀 @Whisht

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Feb 14, 2025

The issue you're experiencing, where changes to the avatar and display name are not taking effect, could be related to a few potential causes:

  1. MinIO Configuration: Ensure that the MinIO service is correctly configured and accessible. Verify that the bucket policies allow for the necessary actions (s3:PutObject, s3:GetObject, etc.) as described in the documentation [1].

  2. Caching Mechanism: There might be a caching mechanism in place that prevents immediate updates from being reflected. The presence of cache headers like x-nextjs-cache:HIT suggests aggressive caching by Next.js. Clearing the OpenResty cache might help resolve this issue [2].

  3. Database Update Logic: Check if the updateUser method in the UserService class is correctly updating the user profile information in the database. This method should handle the update of the avatar and display name [3].

  4. Frontend Data Binding: Ensure that the frontend is correctly retrieving and displaying the updated user profile data. There might be issues with data binding or state management that prevent the changes from being shown.

Review these areas to identify and resolve the issue. If the problem persists, further investigation into the specific implementation details might be necessary.

To continue talking to Dosu, mention @dosu.


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

@dosubot dosubot bot added the files 上传文件/知识库 label Feb 14, 2025
Copy link

dosubot bot commented Feb 14, 2025

The issue you're experiencing, where changes to the avatar and display name are not taking effect, could be related to a few potential causes:

  1. MinIO Configuration: Ensure that the MinIO service is correctly configured and accessible. Verify that the bucket policies allow for the necessary actions (s3:PutObject, s3:GetObject, etc.) as described in the documentation [1].

  2. Caching Mechanism: There might be a caching mechanism in place that prevents immediate updates from being reflected. The presence of cache headers like x-nextjs-cache:HIT suggests aggressive caching by Next.js. Clearing the OpenResty cache might help resolve this issue [2].

  3. Database Update Logic: Check if the updateUser method in the UserService class is correctly updating the user profile information in the database. This method should handle the update of the avatar and display name [3].

  4. Frontend Data Binding: Ensure that the frontend is correctly retrieving and displaying the updated user profile data. There might be issues with data binding or state management that prevent the changes from being shown.

Review these areas to identify and resolve the issue. If the problem persists, further investigation into the specific implementation details might be necessary.

To continue talking to Dosu, mention @dosu.


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

@SpeedupMaster
Copy link
Contributor

需要配置webhooks

@lobehubbot
Copy link
Member

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


Requires webhooks

@Whisht
Copy link
Author

Whisht commented Feb 14, 2025

添加了 webhooks 还是不生效,麻烦确认下是否配置有问题。

前端显示:
Image

后端配置:
Image

webohooks:
Image

@SpeedupMaster
Copy link
Contributor

添加了 webhooks 还是不生效,麻烦确认下是否配置有问题。

前端显示: Image

后端配置: Image

webohooks: Image

CASDOOR_WEBHOOK_SECRET 这个环境变量有设置吗?

@lobehubbot
Copy link
Member

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


I added webhooks but it still doesn't work. Please confirm whether there is any configuration problem.

Front-end display: Image

Backend configuration: Image

webohooks: Image

Is there any setting of this environment variable CASDOOR_WEBHOOK_SECRET?

@Whisht
Copy link
Author

Whisht commented Feb 14, 2025

添加了 webhooks 还是不生效,麻烦确认下是否配置有问题。
前端显示: Image
后端配置: Image
webohooks: Image

CASDOOR_WEBHOOK_SECRET 这个环境变量有设置吗?

有设置,放在了 .env 文件里,重新启动了服务。

Image

@lobehubbot
Copy link
Member

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


Is webhooks added or not effective? Please confirm whether there is any configuration problem.
Front-end display: Image
Backend configuration: Image
webohooks: Image

Is there any setting of this environment variable CASDOOR_WEBHOOK_SECRET?

There is a setting, it is placed in the .env file, and the service has been restarted.

Image

@SpeedupMaster
Copy link
Contributor

添加了 webhooks 还是不生效,麻烦确认下是否配置有问题。
前端显示: Image
后端配置: Image
webohooks: Image

CASDOOR_WEBHOOK_SECRET 这个环境变量有设置吗?

有设置,放在了 .env 文件里,重新启动了服务。

Image

那就不太清楚了,配置好像也没问题

@lobehubbot
Copy link
Member

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


Is webhooks added still not effective? Please confirm whether there is any configuration problem.
Front-end display: Image
Backend configuration: Image
webohooks: Image

Is there any setting of this environment variable CASDOOR_WEBHOOK_SECRET?

There is a setting, it is placed in the .env file, and the service has been restarted.

Image

Then I don't know much about the configuration, it seems that there is no problem with the

@cy948
Copy link
Contributor

cy948 commented Feb 14, 2025

要确保 casdoor 能访问 lobechat 。可以触发一次 webhook,看 lobechat 容器内有没有日志。

@lobehubbot
Copy link
Member

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


Make sure casdoor has access to lobechat. You can trigger a webhook to see if there is a log in the lobechat container.

@coulsontl
Copy link
Contributor

coulsontl commented Feb 14, 2025

要确保 casdoor 能访问 lobechat 。可以触发一次 webhook,看 lobechat 容器内有没有日志

同样出现了问题

[auth][error] UnknownAction: Cannot parse action at /api/auth/webhooks/casdoor. Read more at https://errors.authjs.dev#unknownaction
    at /app/.next/server/chunks/35758.js:1:40743
    at tP (/app/.next/server/chunks/35758.js:1:40810)
    at i3 (/app/.next/server/chunks/35758.js:368:53069)
    at t (/app/.next/server/chunks/35758.js:368:63368)
    at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:80:14)
    at tr.do (/app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17611)
    at /app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:23794
    at /app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist/server/lib/trace/tracer.js:169:36
    at NoopContextManager.with (/app/node_modules/.pnpm/@[email protected]/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19)
    at ContextAPI.with (/app/node_modules/.pnpm/@[email protected]/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)

Image

@lobehubbot
Copy link
Member

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


Make sure casdoor has access to lobechat. You can trigger a webhook to see if there is a log in the lobechat container

There was also a problem

[auth][error] UnknownAction: Cannot parse action at /api/auth/webhooks/casdoor. Read more at https://errors.authjs.dev#unknownaction
    at /app/.next/server/chunks/35758.js:1:40743
    at tP (/app/.next/server/chunks/35758.js:1:40810)
    at i3 (/app/.next/server/chunks/35758.js:368:53069)
    at t (/app/.next/server/chunks/35758.js:368:63368)
    at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:80:14)
    at tr.do (/app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules /next/dist/compiled/next-server/app-route.runtime.prod.js:18:17611)
    at /app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist /compiled/next-server/app-route.runtime.prod.js:18:23794
    at /app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist /server/lib/trace/tracer.js:169:36
    at NoopContextManager.with (/app/node_modules/.pnpm/@[email protected]/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19)
    at ContextAPI.with (/app/node_modules/.pnpm/@[email protected]/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)

@fashioncj
Copy link

要确保 casdoor 能访问 lobechat 。可以触发一次 webhook,看 lobechat 容器内有没有日志

同样出现了问题

[auth][error] UnknownAction: Cannot parse action at /api/auth/webhooks/casdoor. Read more at https://errors.authjs.dev#unknownaction
    at /app/.next/server/chunks/35758.js:1:40743
    at tP (/app/.next/server/chunks/35758.js:1:40810)
    at i3 (/app/.next/server/chunks/35758.js:368:53069)
    at t (/app/.next/server/chunks/35758.js:368:63368)
    at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:80:14)
    at tr.do (/app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17611)
    at /app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:23794
    at /app/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]_react-dom@19._xvsvkpj3jd5r2eomtvlthcwjka/node_modules/next/dist/server/lib/trace/tracer.js:169:36
    at NoopContextManager.with (/app/node_modules/.pnpm/@[email protected]/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19)
    at ContextAPI.with (/app/node_modules/.pnpm/@[email protected]/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)

Image

也出现了这个问题,1.53.11 docker 版本

@cy948
Copy link
Contributor

cy948 commented Feb 15, 2025

抱歉,我的文档 url 写错了,应该是 http://lobe.example.com/api/webhooks/casdoor

@lobehubbot
Copy link
Member

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


Sorry, my document url is written incorrectly, it should be http://lobe.example.com/api/webhooks/casdoor

@ArvinCharl
Copy link

抱歉,我的文档 url 写错了,应该是 http://lobe.example.com/api/webhooks/casdoor

确实是这个问题,修改后就可以了 ^_^

@lobehubbot
Copy link
Member

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


Sorry, my document url is written incorrectly, it should be http://lobe.example.com/api/webhooks/casdoor

It's indeed this problem, just modify it ^_^

@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Feb 15, 2025
@lobehubbot
Copy link
Member

@Whisht

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 1.56.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Whisht
Copy link
Author

Whisht commented Feb 16, 2025

我修改 url 为 /api/webhooks/casdoor,仍然不行,日志报错为:

"msg":"[casdoor]: Webhooks handler user update for \"{\"avatar\":\"https://cdn.casbin.org/img/casbin.svg\",\"email\":\"[email protected]\",\"fullName\":\"Admin\"}\", but no user was found by the providerAccountId.
Image

这是我的配置信息,
Image
请问 providerAccountId 是在哪里指定呢?

@cy948
Copy link
Contributor

cy948 commented Feb 16, 2025

@Whisht 你是从别的 sso 迁移过来的吗?

@lobehubbot
Copy link
Member

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


@Whisht Did you migrate from another sso?

@He-Xun
Copy link

He-Xun commented Feb 16, 2025

确实还是不行

@lobehubbot
Copy link
Member

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


It's true that it's not possible

@cy948
Copy link
Contributor

cy948 commented Feb 16, 2025

@He-Xun 进lobechat容器看看日志?

@lobehubbot
Copy link
Member

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


@He-Xun Enter the lobechat container to check the logs?

@coulsontl
Copy link
Contributor

@Whisht 你是从别的 sso 迁移过来的吗?

我也是相同的日志,日志显示识别为admin。我的确是用admin管理员账号登录来更新别的用户的,但是被我更新的的用户是正常普通用户。所以lobe是不是只能识别casdoor系统当前的登录用户而不是实际被修改的用户。

@lobehubbot
Copy link
Member

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


@Whisht Did you migrate from another sso?

I'm the same log, and the log display is recognized as admin. I do use the admin administrator account to log in to update other users, but the users updated by me are normal users. So does lobe only recognize the current login user of the casdoor system rather than the actual user being modified.

@Whisht
Copy link
Author

Whisht commented Feb 17, 2025

@Whisht 你是从别的 sso 迁移过来的吗?

不是,空的环境。

@cy948
Copy link
Contributor

cy948 commented Feb 17, 2025

试了一下,这个问题 casdoor webhook 返回的拓展用户字段是管理员的账户,有可能是 Bug,这个功能先别使用吧。

@lobehubbot
Copy link
Member

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


I tried this problem. The extended user field returned by casdoor webhook is the administrator's account. It may be a bug. Don't use this function for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 files 上传文件/知识库 released
Projects
Status: Done
8 participants