G35x
G35x
WWasp
Created by AC on 12/24/2024 in #🙋questions
Really struggling with deploy
Adding my 2 cents here.. I really prefer using GCP for my projects. Not the cheapest/easiest but it has advantages & it’s what I’m used to. Would love to see more love for GCP users. There is some documentation that TomD created for this, I can tell he’s experienced and am super appreciative of his contribution. Speaking candidly, experienced people sometimes aren’t the BEST teachers. One common pitfall, they can assume the audience has implicit information / contextual understandings which they might not. In other words, and with all due respect, there are some under documented steps, and some info missing. It could use a facelift! Was thinking to create a more detailed guide on deploying a wasp project from scratch using 100% google infrastructure but don’t want to step on any toes or take away from Tom’s contribution. Also not sure how in-demand support is for this ecosystem and it would take a few hours to put together.
38 replies
WWasp
Created by AC on 12/24/2024 in #🙋questions
Really struggling with deploy
Nice!! Congrats on the successful deployment
38 replies
WWasp
Created by AC on 12/24/2024 in #🙋questions
Really struggling with deploy
No problem! Looking forward to seeing what works to fix this. One more tip that helped me, if you aren’t already doing so, try to make as detailed as possible notes documenting all of your configurations, commands, strings etc used in your notes app while troubleshooting. The first week I was trying to deploy I was relying on my memory. I made way faster progress once I saved my “intellectual property” so I could wipe my environment, try new setups, and systematically test / compare which steps work, why, and how
38 replies
WWasp
Created by AC on 12/24/2024 in #🙋questions
Really struggling with deploy
What I’m thinking might have happened is while you were testing different environment configurations to diagnose earlier sequential issues in your build / deploy stages, you could have done something to change your config.json and that’s why this new issue is occurring in the final stage
38 replies
WWasp
Created by AC on 12/24/2024 in #🙋questions
Really struggling with deploy
Going back to the attempt prior to using sudo, Have you tried to verify the contents of your ~/.docker/config.json are correctly configured? Seeing that you’re running into more environment issues using Sudo makes me think an easier path would be to make the “docker-compose up —build” command work without requiring Sudo. A quick google search of the error code you got took me to a few different stack overflow threads. I didn’t see anything about using Sudo to resolve the “executable file not found at $PATH” I did see a lot of people mentioning steps to fix the configuration at ~/.docker/config.json specifically: “Check your ~/.docker/config.json and replace "credsStore" by "credStore" And “My config stopped working after I've installed Docker Desktop which apparently added "credsStore": "desktop" to my ~/.docker/config.json. Removing "credsStore": "desktop" fixed the issue as mentioned by various comments above”
38 replies
WWasp
Created by AC on 12/24/2024 in #🙋questions
Really struggling with deploy
Hey @AC, I work from a mac M1 pro and had a bunch of unexpected issues deploying. My stack is - firebase front end - Google cloud run server - Google postrgresql DB Took me two weeks to successfully deploy. I nearly gave up. Hang in there. regarding the error: LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 50) I'm not certain this will be a non-issue for heroku, but this was a total non-issue for me at any point in my build or deploy. I get that warning every time I docker build and it hasn't caused any issues. You're definitely headed in the right direction using: docker buildx build --platform linux/amd64 -t <app-name> . docker tag <app-name> registry.heroku.com/<app-name>/web docker push registry.heroku.com/<app-name>/web Do you get any other errors during the docker build stage? Are you able to share the complete sequence of commands you're using & what directory you're in when running those commands during the build & push?
38 replies
WWasp
Created by Kynetix on 10/18/2024 in #🙋questions
PayloadTooLargeError
Just wanted to let you guys know this fixed an issue for me & wanted to thank you both! you too kapa 😉 1) created a serverSetup.ts import express from 'express'; import bodyParser from 'body-parser'; export const serverSetup = () => { const app = express(); app.use(express.json({ limit: '50mb' })); app.use(express.urlencoded({ limit: '50mb', extended: true })); } export const serverMiddlewareFn = (middlewareConfig: any) => { middlewareConfig.set('express.json', bodyParser.json({ limit: '50mb' })); return middlewareConfig; } 2) added to my main.wasp: server: { middlewareConfigFn: import { serverMiddlewareFn } from "@src/server/serverSetup.js" }, and no more PayloadTooLargeError
28 replies
WWasp
Created by tomas.morales on 6/11/2024 in #🙋questions
manual deploy gcp
Access to XMLHttpRequest at 'https://backend-xxxxxxx.us-central1.run.app/operations/get-tables' from origin 'https://xxxxxx-xxxx.web.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
53 replies
WWasp
Created by tomas.morales on 6/11/2024 in #🙋questions
manual deploy gcp
No it wasn't a wasp issue, you're absolutely right. It was a few different issues related to docker build args & how my environment variables were being set, and the database issue I had was being caused by a VPC connector in GCP. Good news is, I finally was able to get the server deployed. Going to add more info than necessary in case it helps someone in the future. Regarding the docker build, I was using: docker build --no-cache --platform linux/amd64 -t backend-image . and I kept getting the following error: Dockerfile:40 -------------------- 38 | RUN npm install && cd .wasp/build/server && npm install 39 | COPY db/schema.prisma .wasp/build/db/ 40 | >>> RUN cd .wasp/build/server && npx prisma generate --schema='../db/schema.prisma' 41 | # Building the server should come after Prisma generation. 42 | RUN cd .wasp/build/server && npm run bundle -------------------- ERROR: failed to solve: process "/bin/sh -c cd .wasp/build/server && npx prisma generate --schema='../db/schema.prisma'" did not complete successfully: exit code: 1 I tried many different configurations of deployment methods and spent a couple of days tinkering with Gcloud builds submit to try to eliminate my environment from the docker build process to no avail. In the end I had to use this command locally: PRISMA_CLI_BINARY_TARGETS=linux-musl \ PRISMA_CLIENT_ENGINE_TYPE=library \ docker build --no-cache --platform linux/amd64 \ --build-arg PRISMA_CLI_BINARY_TARGETS=linux-musl \ --build-arg PRISMA_CLIENT_ENGINE_TYPE=library \ --build-arg NODE_ENV=production \ -t backend-image . Then eliminated the Google VPC connector since it wasn't playing nice with my RDS DB despite whitelisting the Google IPs. And finally I stopped using Google secret manager for my env variables.. and success! Bad news is. Now I'm getting some CORS issues, I think it might be a configuration issue. Wondering if you have any insights you can provide on how to fix this?
53 replies
WWasp
Created by tomas.morales on 6/11/2024 in #🙋questions
manual deploy gcp
with respect to logs yes absolutely I have the log files, I'm going to try to redeploy and get a fresh set
53 replies
WWasp
Created by tomas.morales on 6/11/2024 in #🙋questions
manual deploy gcp
No description
53 replies
WWasp
Created by tomas.morales on 6/11/2024 in #🙋questions
manual deploy gcp
Thanks Miho, I've got the env vars figured out, verified in console.cloud.google.com that they're properly being set in the cloud run dash, including the port but the issues I'm having seem to be related to connecting to the database & container calling exit. here's my deploy.sh which I made executable using chmod - it runs each command in sequence (wasp build, deploy to firebase, build, tag and push the docker image, gcloud deploy) It passes the specified env vars from .env.sever when executed (also validated in GCP secrets that it is successfully passing these) I’m using cloud SQL PostgreSQLin google cloud for my database. I’ve verified I’m setting the database url and configuring the username and password correctly, but still no luck. I tried also connecting through Unix sockets but can't seem to get this to work.. been 3 days of testing and failing at the cloud deploy stage https://cloud.google.com/sql/docs/postgres/connect-run#node.js
53 replies
WWasp
Created by tomas.morales on 6/11/2024 in #🙋questions
manual deploy gcp
No clue why, but I have followed your steps point for point and still can't get past: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable within the allocated timeout. when gcloud run deploy backend
53 replies
WWasp
Created by tomas.morales on 6/11/2024 in #🙋questions
manual deploy gcp
Tom, you still around 🤣 ?
53 replies