[Bug] 「部署问题」Casdoor 配置与 NextAuth 认证错误 #4798
-
📦 EnvironmentDocker 📌 Version1.0 💻 Operating SystemUbuntu 🌐 BrowserChrome 🐛 Bug Description你好,在按照官方文档 https://lobehub.com/zh/docs/self-hosting/server-database/docker-compose 进行部署时遇到了问题。 当前进度: 已完成"发布到生产(IP 模式)"的配置步骤 登录时显示页面存在问题 ‘’‘
|
Beta Was this translation helpful? Give feedback.
Replies: 21 comments
-
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Beta Was this translation helpful? Give feedback.
-
@Shukino20001015 你好!我是Dosu,一个可以帮助解决错误、回答问题并成为贡献者的机器人。我会在这里帮助你等待人类维护者的过程中。 I found some similar discussions that might help with your issue:
Regarding your specific issue with Casdoor configuration not persisting across service restarts, I couldn't find a direct solution in the available data. However, ensuring that your Docker volumes are correctly set up to persist data might help. This typically involves checking your Docker Compose configuration to ensure that volumes are mapped correctly for Casdoor's data storage. For the NextAuth configuration error, make sure all required environment variables are correctly set. You can refer to the specific environment variables needed for NextAuth in the Lobe Chat setup [4][5][6]. If the Casdoor configuration reset is causing the authentication failure, ensuring persistent storage for Casdoor's configuration might resolve the issue. You might need to check if the Casdoor service is writing its configuration to a persistent volume. |
Beta Was this translation helpful? Give feedback.
-
配置似乎没有持久化,我想知道是不是这个原因导致我的用户注册失败的? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
用啥部署的?配置应该是有持久化储存的 |
Beta Was this translation helpful? Give feedback.
-
What was deployed using? Configuration should be persistently stored |
Beta Was this translation helpful? Give feedback.
-
现在我修改了外部的init_data.json,现在重启是可以看到配置了,提供商上传资源正常,但是lobe chat 界面登录还是存在问题,最终会得到”http://192.168.2.6:3210/api/auth/error?error=Configuration“这个结果。不理解为啥还是不能实现本地用户登录&注册? |
Beta Was this translation helpful? Give feedback.
-
你需要修改下载下来的 docker-compose.yml 文件,执行一次全文替换,将 localhost 替换为 your_server_ip。 |
Beta Was this translation helpful? Give feedback.
-
"sed -i 's/localhost/192.168.2.6/g' docker-compose.yml"替换了 |
Beta Was this translation helpful? Give feedback.
-
那配置应该没问题的啊,可以检查下docker-compose.yml文件,确认下是否成功替换了 |
Beta Was this translation helpful? Give feedback.
-
是啊,lobechat页面可以显示出来,但是登录注册跳转到casdoor失败,然后是log里有“[auth][error] TypeError: fetch failed |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
TypeError: fetch failed indicates that the request failed. Check whether the connectivity is normal. Make sure there is no wall or anything like that |
Beta Was this translation helpful? Give feedback.
-
有配置NEXTAUTH_URL吗? |
Beta Was this translation helpful? Give feedback.
-
Have you configured NEXTAUTH_URL? |
Beta Was this translation helpful? Give feedback.
-
[NextAuth] Error: { 看上去还是配置问题,你贴一下有关变量呢?我没有用官方教程里给的一键脚本or配置,手动配置后casdoor是正常的。 |
Beta Was this translation helpful? Give feedback.
-
[NextAuth] Error: { It looks like it's still a configuration issue. Can you post the relevant variables? I did not use the one-click script or configuration given in the official tutorial. Casdoor was normal after manual configuration. |
Beta Was this translation helpful? Give feedback.
-
解决了,发现是 数据库防火墙没有打开,其他开了 |
Beta Was this translation helpful? Give feedback.
-
Solved, I found that the database firewall was not turned on, and other things were turned on. |
Beta Was this translation helpful? Give feedback.
-
3q |
Beta Was this translation helpful? Give feedback.
-
3q |
Beta Was this translation helpful? Give feedback.
解决了,发现是 数据库防火墙没有打开,其他开了