ai-chatbot
ai-chatbot copied to clipboard
Failed to create account when deploying from vercel button
/register
Failed to get user from database
It seems that the path for db migrations is wrong, you need to change this in the migrate.ts file:
await migrate(db, { migrationsFolder: './lib/drizzle' });
To this:
await migrate(db, { migrationsFolder: './lib/db/migrations' });
Before running the app, make sure you execute the db:migrate command from package.json to prepare the DB tables.
In my case after that I still had the error, so I logged it and got this:
Failed to get user from database
[Error: Client network socket disconnected before secure TLS connection was established] {
code: 'ECONNRESET',
path: undefined,
host: undefined,
port: undefined,
localAddress: undefined
}
I am self hosting the chatbot app with a postgres db, and to fix it I removed the ssl=require option from the queries.ts file and now its working. That option should not be there as it should go in the POSTGRES_URL env var if needed.
i had the same problem and this solution didnt work. And the thing is that the app should work as it's offered by vercel. How's it possible that they make you create an app saying it's easy and it comes with a fatal bug that prevents any user from using it ?
Hey Here are some tps:
If you have configured the git repo follow the commands:
- npm i -g pnpm
- pnpm i
- pnpm drizzle-kit generate
- pnpm drizzle-kit migrate
- pnpm drizzle-kit push
Note: You don't need to change anything in migration file. After running all this commands it will automatically create migrations for you.
Setup:
- Please setup postgresql and provide url you can use supabase or neon db.
- After running the command on terminal it shows pulling content or database if that's the case you don't need to pull anything. You can use ctrl + c to close it it will work.
- Now you can use it but register first.
As I told you I have configured and created the pull request. So it works for me.
Hey guys, apologies about this! A recent change caused a misconfiguration in the migration script that prevented it from creating the tables when you go through the 1-click deploy flow.
Thanks @angelhodar for the quick solution – I went ahead and pushed the changes (#560) which should fix this for everyone!