W
Wasp-langโ€ข4w ago
samim

Trouble deploying opensaas on fly.io, get a site not found after using authentication

I deployed my project on fly.io and did everything exactly according to the documentation. However, trying to click on google authentication I will get a site not found (https://mycoolap-server.fly.dev/auth/google/login) and when trying to sign up by mail I get network error (using the console also shows me, that the same link is trying to be opened) What am I missing here?
28 Replies
kapa.ai
kapa.aiโ€ข4w ago
Hi @samim. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It seems like you're experiencing issues with your deployment on Fly.io, specifically with Google authentication and email sign-up. Here are a few things you could check: 1. Environment Variables: Ensure that you've set all the necessary environment variables correctly. This includes the Google Client ID, SendGrid API, and any other keys required for your application. If you're using an external authentication method like Google, make sure to set the necessary environment variables required by these methods. You can check if you've added your secrets correctly by running flyctl secrets list in the terminal (source (https://wasp-lang.dev/docs/advanced/deployment/manually#set-up-a-flyio-app)). 2. Network Tab: Open the developer tools in your browser and check the "Network" tab. Look for any requests that are taking a long time or failing. This could indicate a problem with the server not responding (source (https://discord.com/channels/686873244791210014/1217941277979574315)). 3. Fly.io Dashboard: Check your Fly.io dashboard for any errors or issues. Look at the server logs and see if there are any errors being reported or if the server is receiving requests from the client (source (https://discord.com/channels/686873244791210014/1217941277979574315)). 4. Redeploy: Sometimes, redeploying the app can resolve the issue. A community member reported that their login tab started showing up after redeploying the app (source (https://discord.com/channels/686873244791210014/1217941277979574315)). If you're still experiencing issues after checking these things, it might be helpful to share more details about your setup or any error messages you're seeing. This could help identify the problem more accurately. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @samim, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
samim
samimโ€ข4w ago
Did all that ๐Ÿ˜ฆ
miho
mihoโ€ข4w ago
Ok, let me get a few infos from you.
I deployed my project on fly.io and did everything exactly according to the documentation.
Did you follow the Wasp Lang docs? Did you use the wasp deploy fly ... command?
However, trying to click on google authentication I will get a site not found (https://mycoolap-server.fly.dev/auth/google/login)
What are your app names on Fly? fly apps list will answer that. Maybe you used an existing name and then Fly adds some random chars to the end of the name. Wasp doesn't handle this (yet) and this might have happened to you.
when trying to sign up by mail I get network error (using the console also shows me, that the same link is trying to be opened)
Is CORS mentioned in the browser error? And lastly, did you set all the needed env vars for Google auth and stuff like server url and client url?
samim
samimโ€ข4w ago
I did the wasp deploy fly deploy command. My app names are NAME OWNER STATUS LATEST DEPLOY build-summer-silence-3967 personal suspended 21h27m ago
etal personal suspended 1h26m ago
etaldb personal deployed
fly-builder-spring-wave-6590 personal suspended actually the app wasn't exisiting, I deployed newly to fly. Cors is not mentioned in the browser error. Google auth is setup correctly, as it worked on local.
miho
mihoโ€ข4w ago
I did the wasp deploy fly deploy command
It looks to me by looking at the Fly app names, that you didn't deploy the apps with wasp deploy fly launch ... Wasp names your apps like <app-name>-server, <app-name>-client and <app-name>-db. I'd suggest the following - delete the Fly apps you have now. Delete the local TOML files. Run the wasp deploy fly launch etal <some-region> and see what happens ๐Ÿ˜„ This command will set up the env vars with proper URLs for you and you'll get a working deployment ๐Ÿคž
samim
samimโ€ข4w ago
ok, well I started a new project and did everything as you described. It looked better since it created all the three apps -server, -client and -db but I got the same problem
miho
mihoโ€ข4w ago
I have a feeling you didn't set the GOOGLE_ env vars on Fly? Check the live logs of the server app in the Fly dashboard
samim
samimโ€ข4w ago
in the documentation I have this wasp deploy fly launch my-wasp-app mia --server-secret GOOGLE_CLIENT_ID=<...> --server-secret GOOGLE_CLIENT_SECRET=<...> But it always gives me this error: ๐Ÿš€ You already have Fly toml files. The launch command is intended to be run one time on a new Fly project. Please try a different command.
MEE6
MEE6โ€ข4w ago
Wohooo @samim, you just became a Waspeteer level 4!
miho
mihoโ€ข4w ago
Yes, you should use wasp deploy fly cmd to set the variables. https://wasp-lang.dev/docs/advanced/deployment/cli#environment-variables-1
Deploying with the Wasp CLI | Wasp
Wasp CLI can deploy your full-stack application with only a single command.
samim
samimโ€ข4w ago
OK, I did, thanks. Now the site is just loading... white site and for email authentication I still get the network error
miho
mihoโ€ข4w ago
What are the error you get? Please post the erorrs you mention, I'll be able to help you better then ๐Ÿ˜„
samim
samimโ€ข4w ago
ok, so this is the error in the console I get when trying to signup with email authentication
No description
samim
samimโ€ข4w ago
and that's what I get by clicking on the Google button
No description
miho
mihoโ€ข4w ago
This is the next piece of the puzzle, since you are using a custom domain - you need to adjust your env vars: https://wasp-lang.dev/docs/advanced/deployment/cli#using-a-custom-domain-for-your-app
Deploying with the Wasp CLI | Wasp
Wasp CLI can deploy your full-stack application with only a single command.
samim
samimโ€ข4w ago
ok thanks, I did all that. I can reach my app via the custom domain. However, the authentication is still not working. I added the A and AAAA records for the etal-client IPs. did the cert thingy as well
miho
mihoโ€ข4w ago
However, the authentication is still not working.
What does this mean? What do you see? What kind of errors do you get? ๐Ÿ˜„ It really pays off if you share as many details a possible ๐Ÿ˜„
samim
samimโ€ข4w ago
ok, I am trying to give as much as I can see. The Site is calling https://etal-server.fly.dev/auth/google/login but I don't get any result page (screen stays white, see screenshot)
No description
miho
mihoโ€ข4w ago
Go to live logs of the server app and see if you get any errors there? Go into the Fly Dashboard to see the Live Logs
samim
samimโ€ข4w ago
So, you helped me alot. I haven't had set up the env variables for stripe, I guess that was the error. I got the authentication working now ๐Ÿ˜„ thanks a lot! But now encountered another problem with sending verification emails, eventhough I set the env variables for mailgun. see error message from live log: ams [info] POST /auth/email/signup 200 49.615 ms - 16 2024-09-24T14:08:13.943 app[32871356a40598] ams [info] Failed to send email Error: Forbidden 2024-09-24T14:08:13.943 app[32871356a40598] ams [info] at IncomingMessage.<anonymous> (/app/node_modules/mailgun-js/lib/request.js:327:17) 2024-09-24T14:08:13.943 app[32871356a40598] ams [info] at IncomingMessage.emit (node:events:529:35) 2024-09-24T14:08:13.943 app[32871356a40598] ams [info] at endReadableNT (node:internal/streams/readable:1368:12) 2024-09-24T14:08:13.943 app[32871356a40598] ams [info] at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 2024-09-24T14:08:13.943 app[32871356a40598] ams [info] statusCode: 401 2024-09-24T14:08:13.943 app[32871356a40598] ams [info] } 2024-09-24T14:08:46.748 app[32871356a40598] ams [info] GET /auth/me 304 8.865 ms - -
miho
mihoโ€ข4w ago
Are you using the Mailgun EU region?
samim
samimโ€ข4w ago
yes
miho
mihoโ€ข4w ago
That's a Wasp bug that we fixed and we'll release a new version in ~10 days with the fix. I hope you can wait for that. Could I ask you to try using the SMTP email sender with Mailgun SMTP setup? I haven't tried that workaround, but it should work ๐Ÿ˜„ Or you could use SendGrid in the meantime if you don't care about using Mailgun ๐Ÿ™‚
samim
samimโ€ข4w ago
can you tell me how I can switch to Mailgun SMTP? never mind, I figured out. and it works good.
miho
mihoโ€ข4w ago
Nice man! I'm glad it worked out for you ๐Ÿ™‚
ArDev
ArDevโ€ข2d ago
did you guys fix the bug with the latest release?
martinsos
martinsosโ€ข14h ago
Yes!
martinsos
martinsosโ€ข14h ago
GitHub
Release v0.15.0 ยท wasp-lang/wasp
0.15.0 ๐ŸŽ‰ New Features and improvements Write your app config in TypeScript (preview feature) Wasp 0.15.0 ships a preview feature that lets you define your app in main.wasp.ts using TypeScript inste...
Want results from more Discord servers?
Add your server