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β€’15mo 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
NinjaBrigadorβ€’15mo 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 dill@gmail.com πŸš€ 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] > server@0.0.0 postinstall [Server] > patch-package [Server] [Server] patch-package 6.5.1 [Server] Applying patches... [Server] oauth@0.9.15 βœ” [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β€’15mo ago
Wohooo @NinjaBrigador, you just became a Waspeteer level 1!
martinsos
martinsosβ€’15mo 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
NinjaBrigadorβ€’15mo 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β€’15mo 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
NinjaBrigadorβ€’15mo 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β€’15mo 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
NinjaBrigadorβ€’15mo 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:D2NzS595qpfyV2j@gpt-jobify-server-db.flycast: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β€’15mo 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
NinjaBrigadorβ€’15mo 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β€’15mo 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
NinjaBrigadorβ€’15mo 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β€’15mo 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!
Want results from more Discord servers?
Add your server