Conspyre
Conspyre
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
I'll try that! I surely will 🙂
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
What would you do. You have 30K LOC on your desk and it's exhibiting this bizarre behavior. What do you do next?
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
So what I'm looking for is a strategy. My theory is that one of my data structures is messed up in a way that triggers this. It's just a theory but testing it would lead me to cutting out all of the code in the project until I converge on what the issue is. Realistically that's probably the only way.
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
All my Docker problems are non-wasp specific, firewalls and apache and other issues, and none of my changes for the last 10 build are running and I don't know who's holding the stale code. When I solve it I'll drop a deploying Wasp on Ubuntu guide 🙂 I took a look at this again, and I don't even know how to characterize it. When I switch the import back to wasp/server/operations, the build breaks in ways that don't give you information. Usually it's imports like "../foo" stop working, to fix them, make them "/here/is/foo" and you can spend all day fixing imports and you do not fix the problem. So sharing which import is breaking will not help. To be clear, if file A is where my import of this one goofy subtractCredits function is, file D will break and if you fix that then file G has an error, then P, Z, R, B, ... in no discernible pattern or rhyme or reason or any way that makes sense. 🙂
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
Wasp version is 0.14.0. Other code is using 'wasp/server/operations' so it's not global in scope, but if I do this one import, we get a breaking build that has no useful info. I'd rather not share the entire project, but, I have wasted enough hours on this that I wouldn't mind helping you find this, as it's also a problem in my code 🙂 What steps would you take to debug this? It's in the "subtractCredits" method, and in main.wasp that's using a [User] entity, so, start whacking stuff off of that tree until it doesn't break, look for clues through a rough binary-search-of-whacking-code? 🙂 Other strategies welcome. Side note: Currently debugging my docker deploy and why the expletive deleted it keeps redeploying the same old code over and over. If you have a good RTFM link, sure would appreciate it 🙂
40 replies
WWasp-lang
Created by Conspyre on 9/16/2024 in #🙋questions
Issues with deploying to baremetal
I found an issue which gets us closer to a solution @kapa.ai - the docker container was firewalled, as it's "bridge address" is different from the box it is running on. So: sudo ufw allow from <put docker bridge IP address here> to any port 5432 proto tcp sudo ufw reload After doing so, now when I try to sign up from the /signup URL, there is a momentary delay which is about the same as running in the dev environment (the "catch-all" route failure mode is instant). Looking in the server logs, we see that the call was successful (200) and that /api/auth/me is also able to be called: Catch-all route hit: GET /api/auth/me GET /api/auth/me 304 1.234 ms - - Catch-all route hit: POST /api/auth/email/signup POST /api/auth/email/signup 200 1.669 ms - 29 However, no e-mail is received, and checking the Sendgrid "Activity" tab reveals that none were sent. The sendgrid API key being passed to the docker container is the same as in the development environment. What could be the issue?
35 replies
WWasp-lang
Created by Conspyre on 9/16/2024 in #🙋questions
Issues with deploying to baremetal
@kapa.ai I removed my "catch-all" route entirely, from main.wasp, delete the code, and redeployed. Situation remains unchanged. - wasp-lang provided "catch-all" intercepts /api/auth/me and /api/auth/email/signup - my API "test" route works What else can we check?
35 replies
WWasp-lang
Created by Conspyre on 9/16/2024 in #🙋questions
Issues with deploying to baremetal
@kapa.ai To get more info, I've added a api route my main.wasp, since the failing route is /api/auth/email/signup, I've added "/api/test" like so: api testRoute { fn: import { testHandler } from "@src/testHandler", httpRoute: (GET, "/api/test") } After building and starting the docker image, a curl off localhost responds: curl http://localhost:3001/api/test {"message":"Test route works"} If I do a curl off of the deployed server, we can see that it is being routed correctly: curl https://mysite.com/api/test {"message":"Test route works"} However the /api/auth/email/signup which is (apparently) declared/handled internal to the wasp framework is not. Server console: -----
server@0.0.0 start npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js
server@0.0.0 validate-env node -r dotenv/config ./scripts/validate-env.mjs
🔍 Validating environment variables... 🚀 "Email and password" auth initialized stripeMiddlewareFn is called Starting pg-boss... pg-boss started! Server listening on port 3001 Catch-all route hit: GET /api/auth/me GET /api/auth/me 304 1.365 ms - - Catch-all route hit: POST /api/auth/email/signup POST /api/auth/email/signup 200 29.131 ms - 29 Test route hit GET /api/test 200 1.170 ms - 30 I'm building the docker image like so: sudo docker run -d \ --name backend-container \ -p 3001:3001 \ -e DATABASE_URL='postgresql://secret@99.99.99.99:5432/databasename' \ -e WASP_WEB_CLIENT_URL='https://mysite.com' \ -e WASP_SERVER_URL='https://mysite.com' \ -e JWT_SECRET='BIG_LONG_SECRET_STRING' \ backend And when we build the front end it is being given the REACT_APP_API_URL in the form "https://mysite.com"
35 replies
WWasp-lang
Created by Conspyre on 9/16/2024 in #🙋questions
Issues with deploying to baremetal
How about the format of the two URLs we pass in to the docker command building the server? Are those expected to be both the same? I have WASP_WEB_CLIENT_URL='https://mysite.com' and WASP_SERVER_URL='https://mysite.com' so no trailing '/' and no trailing '/api'. Does this look correct @kapa.ai
35 replies
WWasp-lang
Created by Conspyre on 9/16/2024 in #🙋questions
Issues with deploying to baremetal
Hi @miho deploying web apps is somewhat new for me. What I know is "it works on dev" and I'm following pretty closely to the published docs. If I dig around inside of .wasp/out/build/server/src/index.ts and start drilling around, I can eventually find ./routes/auth/index.js from here, which seems to cover the /me route? I can't find anything in here that looks like it should handle the /api/auth/email/signup so it seems not to be surprising that the catch-all route hits it. I wrote a deploy script, it's basically: BUILD_DIR="$WASP_DIR/.wasp/build/web-app" APACHE_DIR="/var/www/html/truthcraft_mk2" rm -r .wasp wasp build cd "$BUILD_DIR" npm install REACT_APP_API_URL=https://mysite.com/api REACT_APP_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/... npm run build sudo rm -rf /var/www/html/mysite.com sudo mkdir -p /var/www/html/mysite.com sudo mv "$BUILD_DIR/build"/* "$APACHE_DIR/" sudo chown -R www-data:www-data "$APACHE_DIR" sudo chmod -R 755 "$APACHE_DIR" sudo systemctl reload apache2 @kapa.ai does this look correct, specifically the REACT_APP_API_URL ending with /api - is this correct?
35 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
I think I'd prefer to use the Action, however something about that action causes the entire project to fall down if, in server code, I import that action from "wasp/server/operations". Doing so causes relative imports to fail and have to be converted to absolute path or something.
40 replies
WWasp-lang
Created by Conspyre on 9/16/2024 in #🙋questions
Issues with deploying to baremetal
@kapa.ai the server indeed shows why email are not being sent. But why is the catch-all route being hit? It is at the end of the main.wasp file. POST /api/auth/email/signup 200 1.403 ms - 29 Catch-all route hit: POST /api/auth/email/signup
35 replies
WWasp-lang
Created by Conspyre on 9/16/2024 in #🙋questions
Issues with deploying to baremetal
I've resolved the errors with deployment and have the server running via docker and client deployed via apache. Issue was solved by reviewing the find documentation, thanks. 🙂 Howver, the deployment isn't fully functional. I am setting the SENDGRID_API_KEY when running docker to deploy the server, and it is the same API key that was tested and working on development. When I try to go through the signup flow, no e-mail is being sent, and signup cannot continue. What could I have missed @kapa.ai
35 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
@sodic Yes. The problem is gone if I import that Action directly. If I import it from "wasp/server/operations", it still breaks. Sorry if I wasn't more clear, still learning. 🙂 How bad of trouble am I getting into by going around the Wasp system to commit rather vital things to the database?
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
That was me. 🙂 TL;dr I suspect something dumb or rulebreaking vis a vis schema changes, but no longer can get back to that state. @sodic
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
@kapa.ai update: I can change the import, pulling the function directly from the source file instead of from the wasp/server/operations wrapper, the build does not break, the birds resume singing, and the chemtrail fog clears from the skies. But we aren't using wasp actions framework any more. 😦
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
@kapa.ai I found the first user error, in the API declaration I had mistakenly put a .js extension for the file, which was itself a .ts file. Correcting this error did not fix the issue. Uncommenting the import of this action breaks the build. Are there any issues in the knowledge base or on Github regarding API actions and typescript files specifically?
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
Interesting re>that GitHub issue but it seems not to be relevant. If we remove that import / do not call that piece of code in that particular server function, the "relative import broken" issoe goes away entirely. Simply adding that one line - the import - is triggering the behavior. I just don't know how to distil this entire project down to a reproducible issue. @kapa.ai
40 replies
WWasp-lang
Created by Conspyre on 9/8/2024 in #🙋questions
P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
@kapa.ai in my read of the documentation, the docs correctly state to import from 'wasp/server/operations', and I am doing the same in my code. Believe you are hallucinating. Sorry my friend. 😦 The "broken relative imports" seems to be an internal bug, and some problem with my code may be triggering that bug, in my opinion, but I don't know. 😦 Will gather more data and report on Github.
40 replies
WWasp-lang
Created by Conspyre on 9/6/2024 in #🙋questions
How to implement file upload middleware for large video files in a Wasp app?
I have this semi-functional. I can upload to my wasabi bucket just fine. I don't need middleware to achieve it. The Prod setup is to use FUSE to mount the filesystem so we don't have to load GB of video into RAM. This works great. Two thumbs up. I'm trying to fake it on a dev setup, and because there appears not to be a viable FUSE for Mac OS, trying to jury rig it to upload to the local file system. I've tried numerous dead ends.. Any clues how to do something so hacky @kapa.ai?
23 replies