question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prisma deploy error in production but no data in the log

See original GitHub issue

Today we deployed in production and we get an error

Error: P3009
migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
The `20220414162927_prisma_upgrade` migration started at 2022-04-16 16:28:01.302 UTC failed with the following logs:

When we checked the logs in _prisma_migrations, no issued was found and the migration was successfully applied.

image

It looks like the NPM warning triggered this wrong error message. (NPM 8.7.0 was released 2 days ago) https://www.npmjs.com/package/npm

Full Log:

Prisma schema loaded from prisma/schema.prisma
--
Datasource "db": MySQL database "na" at "db-prod-principal-database.us-west-2.rds.amazonaws.com:3306"
60 migrations found in prisma/migrations
Applying migration `20220414162927_prisma_upgrade`
Done in 72.52s.
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "na" at "db-prod-principal-database.us-west-2.rds.amazonaws.com:3306"
60 migrations found in prisma/migrations
Error: P3009
migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
The `20220414162927_prisma_upgrade` migration started at 2022-04-16 16:28:01.302 UTC failed with the following logs:
npm notice
npm notice New minor version of npm available! 8.5.5 -> 8.7.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.7.0>
npm notice Run `npm install -g npm@8.7.0` to update!
npm notice
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (3.12.0 \| library) to ./node_modules/@prisma/client in 3.13s
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

Type "Node" is missing a "__resolveType" resolver. Pass false into "resolverValidationOptions.requireResolversForResolveType" to disable this warning.
🚀 Server ready at http://localhost:4000/ - Env: production

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Apr 30, 2022

Not noise at all, we need to fix this! You should never end up in a situation where the CLI tells you with the following logs: and then nothing follows, it’s that easy. We’’ have to check how deploy is supposed to work and know the previous log output, and what we can do to fix that. (Also it seems we might benefit from making it clearer that an old migrate run failed, not the current one - I did definitely not catch that when reading the output you posted before.)

1reaction
tak1ncommented, Apr 30, 2022

No, obviously a failing migration should output the actual failure message. Do you still have the failing migration (SQL), and maybe the state of the tables (SQL) before that? It would be optimal for us if we can reproduce running the same migrate deploy that failed for you but did not output any information.

Great to hear that my expectations aren’t too off here. I will try to come up with a reproduction the next few days ✌️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration troubleshooting in production - Prisma
The following guide describes issues relating to Prisma Migrate that can occur in production, and how to resolve them. This guide does not...
Read more >
Error message reference - Prisma
Prisma Client throws a PrismaClientUnknownRequestError exception if the query engine returns an error related to a request that does not have an error...
Read more >
Migration troubleshooting in development - Prisma
This guide describes how to resolve issues with Prisma Migrate in a development environment, which often involves resetting your database.
Read more >
Troubleshooting database outages and connection issues
Learn about the possible reasons your database might be down or not connected and what you can do to fix it.
Read more >
Prisma deploy does not deploy and does not show any errors
Prisma deploy does not deploy the datamodel. It shows that the deployment is successful. But the new datamodel does not appear in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found