本地自托管Appflowy踩坑实录

按照官方教程部署完docker环境后,从localhost后台管理界面死活登录不进去。

  • 怀疑是数据库配置问题,创建了另一个管理员账号,还是无法登录。而且最开始的管理员账号在数据库里提示已经成功登录过。

  • 网页端开发者工具检查确实已经成功登录(返回200),但是还是提示密码/邮箱错误。docker端端log也提示已经成功登录,但是就是不跳转界面。

  • 再怀疑是.env文件夹配置错误,仔细检查每一行,没有任何问题。

  • 再怀疑可能是浏览器跨域拦截或者localhost缓存残留,更换浏览器和尝试无痕模式,还是不行。

  •  使用docker compose logs -f admin_frontend 仔细查看log,终于找到蛛丝马迹,然后成功破案。

 
    

    [01:28:01] 🚨 [ServerFetch] [CRITICAL] Server fetch failed: {
        admin_frontend-1  |   name: 'AppFlowy verify user',
        admin_frontend-1  |   url: 'http://localhost/api/user/verify/[redacted]',
        admin_frontend-1  |   method: 'GET',
        admin_frontend-1  |   error: {
        admin_frontend-1  |     name: 'TypeError',
        admin_frontend-1  |     message: 'fetch failed',
        admin_frontend-1  |     stack: 'TypeError: fetch failed\n' +
        admin_frontend-1  |       '    at node:internal/deps/undici/undici:14976:13\n' +
        admin_frontend-1  |       '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
        admin_frontend-1  |       '    at async m (/app/apps/super/.next/server/chunks/7319.js:1:1216)\n' +
        admin_frontend-1  |       '    at async t (/app/apps/super/.next/server/chunks/7319.js:1:3760)\n' +
        admin_frontend-1  |       '    at async u (/app/apps/super/.next/server/chunks/7319.js:1:4726)\n' +
        admin_frontend-1  |       '    at async t4 (/app/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:2454)\n' +
        admin_frontend-1  |       '    at async /app/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:1271\n' +
        admin_frontend-1  |       '    at async t2 (/app/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:14:14859)\n' +
        admin_frontend-1  |       '    at async nQ (/app/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:23704)\n' +
        admin_frontend-1  |       '    at async m (/app/apps/super/.next/server/app/login/page.js:1:8124)',
        admin_frontend-1  |     cause: {
        admin_frontend-1  |       name: 'AggregateError',
        admin_frontend-1  |       message: '',
        admin_frontend-1  |       stack: 'AggregateError: \n' +
        admin_frontend-1  |         '    at internalConnectMultiple (node:net:1122:18)\n' +
        admin_frontend-1  |         '    at afterConnectMultiple (node:net:1689:7)\n' +
        admin_frontend-1  |         '    at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)'
        admin_frontend-1  |     }
        admin_frontend-1  |   }
        admin_frontend-1  | }
    

解决方案
一切都是源于万恶的docker容器的网络隔离,之前也是因为同样的原因配置Open WebUI的时候死活连不上本地模型的API。这里只需要修改.env文件里的FQDN为本机局域网ip,然后通过ip/console即可正常登录。

✍️ 作者:𝓜.𝓦𝓱𝓲𝓽𝓮

📄 共享协议: CC 4.0协议

🔗 原文链接: https://allomaker.com/archives/ben-di-zi-tuo-guan-appflowycai-keng-shi-lu

评论