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] 打开应用设置和更改AI Provider出错 #6404

Closed
R3pl4c3r opened this issue Feb 22, 2025 · 6 comments
Closed

[Bug] 打开应用设置和更改AI Provider出错 #6404

R3pl4c3r opened this issue Feb 22, 2025 · 6 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@R3pl4c3r
Copy link

R3pl4c3r commented Feb 22, 2025

📦 Platform

Vercel

📦 Deploymenet mode

server db(lobe-chat-database image)

📌 Version

1.62.7

💻 Operating System

macOS

🌐 Browser

Chrome

🐛 Bug Description

将Clerk从Development Mode切换为Production Mode后使用同样的用户名登录
进入通用设置修改语言:

insert or update on table "user_settings" violates foreign key constraint "user_settings_id_users_id_fk"

进入AI服务商页面:

duplicate key value violates unique constraint "users_username_unique"

访问或开关某个AI Provider:

insert or update on table "ai_providers" violates foreign key constraint "ai_providers_user_id_users_id_fk"

📷 Recurrence Steps

将Clerk从Development Mode切换为Production Mode后使用同样的用户名登录
进入通用设置修改语言:

insert or update on table "user_settings" violates foreign key constraint "user_settings_id_users_id_fk"

进入AI服务商页面:

duplicate key value violates unique constraint "users_username_unique"

访问或开关某个AI Provider:

insert or update on table "ai_providers" violates foreign key constraint "ai_providers_user_id_users_id_fk"

🚦 Expected Behavior

没有报错提示

📝 Additional Information

No response

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

👀 @R3pl4c3r

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

@lobehubbot
Copy link
Member

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


📦 Platform

Vercel

📦 Deploymenet mode

server db(lobe-chat-database image)

📌 Version

1.62.7

💻 Operating System

macOS

🌐 Browser

Chrome

🐛 Bug Description

Enter the common settings to modify the language:

insert or update on table "user_settings" violates foreign key constraint "user_settings_id_users_id_fk"

Enter the AI ​​service provider page:

duplicate key value violates unique constraint "users_username_unique"

Access or switch an AI Provider:

insert or update on table "ai_providers" violates foreign key constraint "ai_providers_user_id_users_id_fk"

📷 Recurrence Steps

Enter the common settings to modify the language:

insert or update on table "user_settings" violates foreign key constraint "user_settings_id_users_id_fk"

Enter the AI ​​service provider page:

duplicate key value violates unique constraint "users_username_unique"

Access or switch an AI Provider:

insert or update on table "ai_providers" violates foreign key constraint "ai_providers_user_id_users_id_fk"

🚦 Expected Behavior

No error message

📝 Additional Information

No response

Copy link

dosubot bot commented Feb 22, 2025

Hey @R3pl4c3r! I'm here to help you with any bugs or questions you have. I can also assist you in becoming a contributor. Let's squash those bugs together! 🐞

The errors you're encountering are related to database constraints:

  1. Foreign Key Constraint Violation on user_settings: This error occurs when trying to insert or update a record in the user_settings table without a corresponding entry in the users table. Ensure that the user ID exists in the users table before making changes to user_settings [1].

  2. Duplicate Key Value on users Table: This error is triggered by attempting to insert or update a record with a "username" that already exists in the users table. The "username" column has a unique constraint, so each username must be unique [1].

  3. Foreign Key Constraint Violation on ai_providers: This error occurs when trying to insert or update a record in the ai_providers table without a corresponding user ID in the users table. Ensure that the user ID exists in the users table before making changes to ai_providers [2].

To resolve these issues, verify that all user-related operations are performed with valid and existing user IDs, and ensure that usernames are unique when creating or updating user records.

To continue talking to Dosu, mention @dosu.


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

@R3pl4c3r
Copy link
Author

解决方案:把数据库里面的同名用户相关数据删除,clerk用户也删除。重新在lobechat中创建用户

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

@R3pl4c3r

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

@lobehubbot
Copy link
Member

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


Solution: Delete the data related to the user of the same name in the database, and delete the clerk user. Recreate user in lobechat

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
Status: Done
Development

No branches or pull requests

2 participants