William Jin
William Jin
WWasp
Created by William Jin on 12/18/2024 in #🙋questions
Getting CORS issue when using Wasp CLI to deploy
@kapa.ai postgres=# SELECT * FROM _prisma_migrations ORDER BY started_at DESC LIMIT 5; ERROR: relation "_prisma_migrations" does not exist
43 replies
WWasp
Created by William Jin on 12/18/2024 in #🙋questions
Getting CORS issue when using Wasp CLI to deploy
@kapa.ai In fact I didn't change my db schema recently. How do I check what cause the db migration filed and how should I fix it?
The `20240726163858_` migration started at 2024-12-21 08:51:13.198206 UTC failed
The `20240726163858_` migration started at 2024-12-21 08:51:13.198206 UTC failed
I also opened db studio to connect to my production database and didn't find anything wrong.
43 replies
WWasp
Created by William Jin on 12/18/2024 in #🙋questions
Getting CORS issue when using Wasp CLI to deploy
@kapa.ai still having the issue. how to fix the migration issues in my production database?
43 replies
WWasp
Created by William Jin on 12/18/2024 in #🙋questions
Getting CORS issue when using Wasp CLI to deploy
@kapa.ai I encountered the issue again after a few more deployments… I'm pretty sure I didn't mess up server configs (I changed my client URL to admin.skyblaze.app yesterday and it worked, so the WASP_WEB_CLIENT_URL should be fine.) However when I deploy again today, I got
[error] [PC01] instance refused connection. is your app listening on 0.0.0.0:80? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)

2024-12-21T10:37:45.623 proxy[4d8952eb462638] hkg [error] [PR04] could not find a good candidate within 21 attempts at load balancing

2024-12-21T10:38:08.958 app[6830d4ec7560e8] sjc [info] Datasource "db": PostgreSQL database "skyblaze_server", schema "public" at "skyblaze-db.flycast:5432"

2024-12-21T10:38:12.638 app[6830d4ec7560e8] sjc [info] 22 migrations found in prisma/migrations

2024-12-21T10:38:13.846 app[6830d4ec7560e8] sjc [info] Error: P3009

2024-12-21T10:38:13.846 app[6830d4ec7560e8] sjc [info] migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

2024-12-21T10:38:13.846 app[6830d4ec7560e8] sjc [info] The `20240726163858_` migration started at 2024-12-21 08:51:13.198206 UTC failed
[error] [PC01] instance refused connection. is your app listening on 0.0.0.0:80? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)

2024-12-21T10:37:45.623 proxy[4d8952eb462638] hkg [error] [PR04] could not find a good candidate within 21 attempts at load balancing

2024-12-21T10:38:08.958 app[6830d4ec7560e8] sjc [info] Datasource "db": PostgreSQL database "skyblaze_server", schema "public" at "skyblaze-db.flycast:5432"

2024-12-21T10:38:12.638 app[6830d4ec7560e8] sjc [info] 22 migrations found in prisma/migrations

2024-12-21T10:38:13.846 app[6830d4ec7560e8] sjc [info] Error: P3009

2024-12-21T10:38:13.846 app[6830d4ec7560e8] sjc [info] migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

2024-12-21T10:38:13.846 app[6830d4ec7560e8] sjc [info] The `20240726163858_` migration started at 2024-12-21 08:51:13.198206 UTC failed
43 replies
WWasp
Created by William Jin on 12/19/2024 in #🙋questions
Manipulating production database with fly.io and wasp db studio
@kapa.ai Thanks kapa! Seems I didn't use the correct OPERATOR_PASSWORD. I put in the correct password and killed my local wasp db (which ran on port 5432) and the wasp db studio worked successfully.
16 replies
WWasp
Created by William Jin on 12/19/2024 in #🙋questions
Manipulating production database with fly.io and wasp db studio
@kapa.ai Tried with your URL, DATABASE_URL=postgres://postgres:<credential>@localhost:5432/skyblaze_server?sslmode=disable but still got the same error:
❌ --- [Error] Can not connect to database: ---------------------------------------

The database needs to be running in order to execute this command. You can easily start a managed dev database with `wasp start db`.
❌ --- [Error] Can not connect to database: ---------------------------------------

The database needs to be running in order to execute this command. You can easily start a managed dev database with `wasp start db`.
16 replies
WWasp
Created by William Jin on 12/18/2024 in #🙋questions
Getting CORS issue when using Wasp CLI to deploy
Thanks, I tried again and added PORT=80 and the issue seems to be fixed 🙂
43 replies
WWasp
Created by William Jin on 12/18/2024 in #🙋questions
Getting CORS issue when using Wasp CLI to deploy
@kapa.ai Client still show CORS error even after I removed all the middleware codes. Maybe not CORS problem? When I check server logs on Fly.io, it says “ [PC01] instance refused connection. is your app listening on 0.0.0.0:80? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)”
43 replies
WWasp
Created by William Jin on 12/18/2024 in #🙋questions
Getting CORS issue when using Wasp CLI to deploy
@kapa.ai Changed my serverSetup.ts to your code:
import bodyParser from 'body-parser';
import { type MiddlewareConfigFn } from 'wasp/server';

export default function setup() {
console.log('Server setup running...');
}

export const serverMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => {
middlewareConfig.set('express.json', bodyParser.json({ limit: '10mb' }));
return middlewareConfig;
};

import bodyParser from 'body-parser';
import { type MiddlewareConfigFn } from 'wasp/server';

export default function setup() {
console.log('Server setup running...');
}

export const serverMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => {
middlewareConfig.set('express.json', bodyParser.json({ limit: '10mb' }));
return middlewareConfig;
};

But didn't work. Still got CORS error.
43 replies