Skip to content

Commit

Permalink
📝 docs: add troubleshooting for logto (#5114)
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryYuki authored Dec 21, 2024
1 parent 9159ab3 commit decd129
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
24 changes: 23 additions & 1 deletion docs/self-hosting/advanced/auth/next-auth/logto.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,32 @@ When deploying LobeChat, you need to configure the following environment variabl

<Callout type={'tip'}>
Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#logto) for details on related variables.

</Callout>
</Steps>

### Troubleshooting

If you encounter issues during the Logto deployment process, refer to the following common problems:

- `Only roles with the xxx attribute may create roles`:
Check your database user's permissions and ensure that the user in your Logto database has the `admin` role to create roles.

- Error executing `logto db seed` on third-party databases like `Neon`:
Try using the `logto db seed --encrypt-base-role` command.

- Database seeding failed:
Try skipping the seeding process with the `--skip-seed` parameter.

- `Error: role xxx already exists`:
Delete the existing role in the database.

- Database migration failed after a version upgrade:
Try using the command `npx @logto/cli db alteration deploy $version` (e.g., `npx @logto/cli db alteration deploy 1.22.0`).

- I am using Docker deployment and want a one-click upgrade:
Execute the custom command in the container: `sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start`

<Callout type={'info'}>
After successful deployment, users will be able to authenticate via Logto and use LobeChat.
</Callout>
24 changes: 23 additions & 1 deletion docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,30 @@ tags:

<Callout type={'tip'}>
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#logto) 可查阅相关变量详情。

</Callout>
</Steps>

### 故障排除

若你在部署 Logto 过程中遇到问题,可以参考以下常见问题:

- `Only roles with the xxx attribute may create roles`
请检查你的数据库用户权限,确保你的 Logto 数据库中的用户具有 `admin` 角色,以便创建角色。

- 在第三方数据库例如 `Neon` 上执行`logto db seed`出错:
尝试使用`logto db seed --encrypt-base-role`命令。

- 数据库播种失败:
请尝试使用`--skip-seed`参数跳过播种。

- `Error: role xxx already exists`
在数据库中删除已存在的角色即可。

- 版本升级后,数据库迁移失败:
请尝试使用` npx @logto/cli db alteration deploy $version`命令(例如`npx @logto/cli db alteration deploy 1.22.0`)

- 我使用 docker 部署 希望一键升级:
在容器中执行自定义命令:`sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start`

<Callout type={'info'}>部署成功后,用户将可以通过 Logto 身份认证并使用 LobeChat。</Callout>

0 comments on commit decd129

Please sign in to comment.