Non-interactive automated deployment option

I ran wasp deploy fly launch my-wasp-app mia, but I got the error prompt: non interactive. I can’t find what I need to add to the command.
26 Replies
martinsos
martinsosβ€’2y ago
Oh that is a bit weird, I was doing it these days and didn't have that error. Is that your exact command? I did have one command that required me to giev an answer, but actually warned me to just provide --yes and that made it work. But it wasn't this command, it was scaling-related command. Some suggestions: 1. Let us know the exact command and exact output. 2. What is your system? OS, shell, is it a VM or normal machine. 3. What have you done before? Have you already deployed to Fly, or is this your first attempt? At the end this sounds like a problem that is relevant to fly actually, so it will probably make sense to also ask them for help, but let's first explore the points from above to see if we can help / if it is on our side.
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
1. The command and output: (I wasn't sure if there was a better way to do this) dill@MSI:~/gpt-jobify$ wasp deploy fly launch gpt-jobify den $ flyctl version flyctl v0.1.52 linux/amd64 Commit: 9928dce858ee7d597f7af9068fca6e72893f3c56 BuildDate: 2023-07-07T23:18:26Z $ flyctl auth whoami [email protected] πŸš€ Launching your Wasp app to Fly.io! πŸš€ Setting up your Wasp app with Fly.io! πŸš€ Building your Wasp app... $ cd /home/dill/gpt-jobify/ $ /home/dill/.local/share/wasp-lang/0.11.0/wasp-bin build 🐝 --- Clearing the content of the .wasp/build directory... --- βœ… --- Successfully cleared the contents of the .wasp/build directory. --- 🐝 --- Building wasp project... --- 🐝 --- Starting npm install... --- ...Still installing npm dependencies! [Server] > [email protected] postinstall [Server] > patch-package [Server] [Server] patch-package 6.5.1 [Server] Applying patches... [Server] [email protected] βœ” [Server] [Server] added 479 packages, and audited 480 packages in 10s [Server] [Server] 114 packages are looking for funding [Server] run npm fund for details [Server] [Server] 4 moderate severity vulnerabilities [Server] [Server] To address all issues (including breaking changes), run: [Server] npm audit fix --force [Server] [Server] Run npm audit for details. [Client] added 469 packages, and audited 470 packages in 11s [Client] [Client] 107 packages are looking for funding [Client] run npm fund for details [Client] [Client] found 0 vulnerabilities [Db!] Error: P1012 [Db!] [Db!] error: Environment variable not found: DATABASE_URL. [Db!] --> schema.prisma:4 [Db!] | [Db!] 3 | provider = "postgresql" [Db!] 4 | url = env("DATABASE_URL") [Db!] [Db!] βœ… --- Successfully completed npm install. --- 🐝 --- Setting up database... --- [Server] Prisma schema loaded from ../db/schema.prisma [Server] [Server] added 2 packages, and audited 3 packages in 1s [Server] [Server] found 0 vulnerabilities [Server] [Server] added 2 packages, and audited 5 packages in 976ms [Server] [Server] found 0 vulnerabilities [Server] [Server] βœ” Installed the @prisma/client and prisma packages in your project [Server] [Server] βœ” Generated Prisma Client (4.12.0 | library) to ./node_modules/.prisma/client in 71ms [Server] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client [Server] [Server]
[Server] import { PrismaClient } from './node_modules/.prisma/client'
[Server] const prisma = new PrismaClient()
[Server]
[Server] import { PrismaClient } from './node_modules/.prisma/client'
[Server] const prisma = new PrismaClient()
[Server]
[Server!] β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” [Server!] β”‚ Update available 4.12.0 -> 4.16.2 β”‚ [Server!] β”‚ Run the following to update β”‚ [Server!] β”‚ npm i --save-dev prisma@latest β”‚ [Server!] β”‚ npm i @prisma/client@latest β”‚ [Server!] β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ [Client] Prisma schema loaded from ../db/schema.prisma [Client] [Client] βœ” Generated Prisma Client (4.12.0 | library) to ./../web-app/node_modules/.prisma/client in 67ms [Client] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client [Client] [Client]
[Client] import { PrismaClient } from '../web-app/node_modules/.prisma/client'
[Client] const prisma = new PrismaClient()
[Client]
[Client] import { PrismaClient } from '../web-app/node_modules/.prisma/client'
[Client] const prisma = new PrismaClient()
[Client]
βœ… --- Database successfully set up. --- βœ… --- Your wasp project has successfully compiled. --- βœ… --- Your wasp project has been successfully built! Check it out in the .wasp/build directory. --- πŸš€ Setting up server app with name gpt-jobify-server $ cd /home/dill/gpt-jobify/.wasp/build $ flyctl launch --no-deploy --name gpt-jobify-server --region den Creating app in /home/dill/gpt-jobify/.wasp/build Scanning source code Detected a Dockerfile app Error: prompt: non interactive πŸš€ There was an error running "wasp deploy fly setup <basename> <region>". Please review the error and try again (if appropriate). ❌ --- [Error] Deploy command failed: --- Deploy command failed with exit code: 1 2. This is done in a Linux VM 3. This is my first time doing this. I did get the local version to work just fine of the saas template.
MEE6
MEE6β€’2y ago
Wohooo @NinjaBrigador, you just became a Waspeteer level 1!
martinsos
martinsosβ€’2y ago
Hmmmm tricky. Could be that new flyctl version changed how it behaves and now that breaks the deployment. I will test it out as soon as I grab a bit of time -> in the meantime, what you can try to do is downgrade flyctl to 0.1.40 -> I have that on my machine and I can confirm it works. If that also doesn't help then we at least know problem is not in the version.
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
@martinsos Thanks for the help, but I got the same error after downloading flyctl to 0.1.40. I must be doing something else wrong.
martinsos
martinsosβ€’2y ago
Hm that is really weird. So the command you get an error for is flyctl launch --no-deploy --name gpt-jobify-server --region den. Would it be worth checking this out with the Fly team? I do wonder if problem might be in the fact that you are using Linux VM. What does it mean it is VM -> is it inside Docker, or is WSL, or something else? I opened an issue here on, Fly https://community.fly.io/t/error-prompt-non-interactive-what-is-causing-this-error-in-flyctl/14160 So let's see what they say! I am guessing that for some reason, Fly wants to ask you something, and then it can't because we are running it programmaticaly, so it concludes prompt is non-interactive and gives up. Just a theory One idea: try going to Fly dashboard and deleting any machines that Wasp might have created there so far. This might have happened if your wasp deploy fly launch command died in the middle of execution for some reason. So make sure all the apps that Wasp created for this app are deleted, and then try running wasp deploy fly launch again. That way we have fresh start and figure out if that was the issue. Of course you wouldn't do this if you have anything deployed, but from what I got you are trying to get it running for the first time, so this is a valid strategy.
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
I realized that I didn't do: flyctl launch --no-deploy --name gpt-jobify-server --region den. I was only running: wasp deploy fly launch --name gpt-jobify-server gpt-jobify --region den. It still resulted in the same error unfortunately.
martinsos
martinsosβ€’2y ago
No no that's fine, when you run wasp deploy fly launch --name gpt-jobify-server gpt-jobify --region den, it runs that other command for you. But how did you ever end up writing this command? Have you tried deleting stuff from Fly in order to start over and then just run wasp deploy fly launch gpt-jobify-server den? A yes sure you did, that is where you started from right? Maybe the problem is specifying organization hm hm hm. In that case you can just add --org <myorg>. So wasp deploy fly launch gpt-jobify-server den --org <myorg>.
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
[Db!] Error: P1012 [Db!] [Db!] error: Environment variable not found: DATABASE_[Db!] --> schema.prisma:4 [Db!] | [Db!] 3 | provider = "postgresql" [Db!] 4 | url = env("DATABASE_URL") [Db!] | [Db!] [Db!] The organization seemed to be the issue. Does this mean that I don't have to manually add DATABASE_URL? DATABASE_URL=postgres://gpt_jobify_server_server:[email protected]:5432/gpt_jobify_server_server?sslmode=disable src/ext-src/GptPage.tsx(70,19): error TS2322: Type 'string | FieldError | Merge<FieldError, FieldErrorsImpl<any>>' is not assignable to type 'ReactNode'. Type 'FieldError' is not assignable to type 'ReactNode'. Type 'FieldError' is missing the following properties from type 'ReactPortal': key, children, props src/ext-src/GptPage.tsx(93,56): error TS2322: Type 'string | FieldError | Merge<FieldError, FieldErrorsImpl<any>>' is not assignable to type 'ReactNode'. πŸš€ There was an error running "wasp deploy fly deploy". Please review the error and try again (if appropriate).
martinsos
martinsosβ€’2y ago
So adding organization helped? Ok great! I wonder why for me it worked without the organization. We will have to add this to docs / make our script produce nicer message or ask for org explicitely. No, you don't have to manually add DATABASE_URL -> that message is confusing, we have to remove it. This latest error you get is Typescript error -> some types don't match. Doesn't seem like Wasp thing to me, but instead React. It happens when project is being built for deployment -> typescript compiler is then run on it and this error happens. Souds like it expects ReactNode, but you gave it something that is string or FieldError or something else. I also just created an issue for this, so we will solve it in the upcoming months https://github.com/wasp-lang/wasp/issues/1320
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
I don't know how the code is structured, but I assume there is some sort of default for the organization. Yeah it would probably help to ask for it if it isn't specified somewhere else. In reference to the error, where could I find where this is happening because I looked and haven't found it so far.
martinsos
martinsosβ€’2y ago
So from the error above, it says it is happening in your src/client/GptPage.tsx, at the line 70, and also line 93! If you want, share those lines or the whole file here and we can give it a look.
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
Thanks I was confused from the ext-src part of the path in the error. Line 70: {formErrors.instructions && formErrors.instructions.message} Line 93: <span className='text-sm text-red-500'>{formErrors.command && formErrors.command.message}</span>
martinsos
martinsosβ€’2y ago
Sounds like formErrors.instructions.message is not of the type you think it is, or at least TypeScript is not sure it is of type it should be. TypeScript does say it can be String, which is fine, but it says it can also be this other stuff, which is not fine because at this position React can take only String or a Node (html or react fragment). Try doing formErrors.instructions.message.toString(), or some other method of ensuring you convert it to string. Btw I had no idea you can use JSX wtih spread operator to add attributes to the components, quite cool!
MEE6
MEE6β€’2y ago
Wohooo @NinjaBrigador, you just became a Waspeteer level 2!
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
I seem to be making progress. It looks like I need to update my env variables file:///app/server/dist/auth/providers/oauth/init.js:36
throw new Error(The ${provider.displayName} auth provider requires clientID provided via env variables.); ^
Error: The Google auth provider requires clientID provided via env variables.
at ensureValidConfig (file:///app/server/dist/auth/providers/oauth/init.js:36:15)
at init (file:///app/server/dist/auth/providers/oauth/init.js:18:9)
at async file:///app/server/dist/auth/providers/index.js:12:11
Node.js v18.16.1
INFO Main child exited normally with code: 1
INFO Starting clean up.
WARN hallpass exited, pid: 238, status: signal: 15 (SIGTERM)
2023/07/15 06:35:04 listening on [fdaa:2:65e:a7b:d826:a167:de0e:2]:22 (DNS: [fdaa::3]:53) [ 6.290347] reboot: Restarting system
Error: smoke checks for 3d8d115f220589 failed: the app appears to be crashing I have GOOGLE_CLIENT_ID in my .env.server already so do I need to add it somewhere else?
matijash
matijashβ€’2y ago
Hmm does google login work locally for you?
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
When I run it locally I get the following error: Error 400: redirect_uri_mismatch
matijash
matijashβ€’2y ago
ok then we need to fix it locally first. hmm do you have a gh repo with the code we can try it out?
martinsos
martinsosβ€’2y ago
To me this sounds like you don't have a correct configuration for it in your Google app! We have quite a nice tutorial docs about it: https://wasp-lang.dev/docs/integrations/google . There is a part with "authorized redirect URIs" -> Google will allow only those urls to access its auth. As you can see in the example, normally you will want to put one with localhost, for your local developmoent needs, and one with the actual domain (you can omit the one with the actual domain if you don't have it yet though). I am guessing this is not correctly configured for you?
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
That's very helpful. I'm using code from https://github.com/wasp-lang/SaaS-Template-GPT as a baseline, and I intend to change it up once I get the base code deployed.
GitHub
GitHub - wasp-lang/SaaS-Template-GPT
Contribute to wasp-lang/SaaS-Template-GPT development by creating an account on GitHub.
NinjaBrigador
NinjaBrigadorOPβ€’2y ago
Ok I got google authenticator working locally! I finally got it to deploy! It got deployed to https://gpt-jobify-client.fly.dev/, but I want it on https://gpt-jobify.com because I bought the domain and whatnot from GoDaddy.com. Also how can I change the code without redeploying it? I tried: flyctl secrets set WASP_WEB_CLIENT_URL=http://gpt-jobify.com/ -a gpt-jobify-client but the website didn't seem to be effected
martinsos
martinsosβ€’2y ago
Awesome! Well, if you want to change the code, you will of course need to redeploy, but it is as easy as doing wasp deploy fly deploy to deploy both frontend and backend, or you can do wasp deploy fly deploy --skip-server if you did changes only to the frontend code. As for the custom domain -> you will need to set up some stuff on the go-daddy side. basically you need to tell go daddy there that your domain will point to https://gpt-jobify-client.fly.dev/ . As for Wasp side, let me check with some team members that will know this better than me: @miho @Vinny (@Wasp) do you have good idea how to go about using a custom domain for a Fly-deployed Wasp app? What are the exact steps, especially on the Wasp side?
I made a SaaS App. Buy my stuff.
miho
mihoβ€’2y ago
I'll update the docs today since I see that the custom domains are not covered there. The straightforward process looks like this: 1. wasp deploy fly cmd --context client certs create <your domain> - it gives you instructions what to add to your DNS - usually it says something like this:
You can direct traffic to <your domain> by:

1: Adding an A record to your DNS service which reads

A @ 66.241.124.154

You can validate your ownership of <your domain> by:

2: Adding an AAAA record to your DNS service which reads:

AAAA @ 2a09:8280:1::1:ff40
You can direct traffic to <your domain> by:

1: Adding an A record to your DNS service which reads

A @ 66.241.124.154

You can validate your ownership of <your domain> by:

2: Adding an AAAA record to your DNS service which reads:

AAAA @ 2a09:8280:1::1:ff40
2. Next, you'll need to update the secrets as well so CORS still works: wasp deploy fly cmd --context server secrets set WASP_WEB_CLIENT_URL=https://<your domain>
martinsos
martinsosβ€’16mo ago
@miho just checking, did you get the opportunity to update the docs as you said? If you think we covered everything from here, feel free to mark this question with βœ… and mark it as "closed"!
Want results from more Discord servers?
Add your server