Blueprint environment variable missing

I have the following under envVars for my app

      name: app-db
      property: connectionString

When I deploy, I see the following:

Feb 18 07:26:31 PM  Prisma schema loaded from api/db/schema.prisma
Feb 18 07:26:32 PM  Error: Schema validation error - Error (query-engine-node-api library)
Feb 18 07:26:32 PM  Error code: P1012
Feb 18 07:26:32 PM  error: Environment variable not found: DATABASE_URL.
Feb 18 07:26:32 PM    -->  schema.prisma:3
Feb 18 07:26:32 PM     |
Feb 18 07:26:32 PM   2 |   provider = "postgresql"
Feb 18 07:26:32 PM   3 |   url      = env("DATABASE_URL")
Feb 18 07:26:32 PM     |

I don’t have the DATABASE_URL env var referenced anywhere else, but I would expect this to work as is. Is there anything obvious I could be missing, or is the expectation that I need to additionally set DATABASE_URL in the app environment?

When the blueprint is created the DATABASE_URL environment variable would be populated with the value at the initial deploy time, so it would be worth checking if the value is set on the service to what you expect it to be.

John B

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.