Missing data source leads to "Error: Get config index out of bounds: the len is 1 but the index is 1"
See original GitHub issueBug description
I’m following the guide at https://vercel.com/guides/nextjs-prisma-postgres and trying to setup prisma with postgres but after I install next auth and run npx prisma db push
I’m getting the error " Error: Get config index out of bounds: the len is 1 but the index is 1"
How to reproduce
Expected behavior
My Understanding is that you are required to proceed with the db being updated without any errors
Prisma information
// schema.prisma
model Post {
id Int @default(autoincrement()) @id
title String
content String?
published Boolean @default(false)
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}
model User {
id Int @default(autoincrement()) @id
name String?
email String? @unique
emailVerified DateTime? @map(name: "email_verified")
image String?
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @updatedAt @map(name: "updated_at")
posts Post[]
@@map(name: "users")
}
model Account {
id Int @default(autoincrement()) @id
compoundId String @unique @map(name: "compound_id")
userId Int @map(name: "user_id")
providerType String @map(name: "provider_type")
providerId String @map(name: "provider_id")
providerAccountId String @map(name: "provider_account_id")
refreshToken String? @map(name: "refresh_token")
accessToken String? @map(name: "access_token")
accessTokenExpires DateTime? @map(name: "access_token_expires")
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @default(now()) @map(name: "updated_at")
@@index([providerAccountId], name: "providerAccountId")
@@index([providerId], name: "providerId")
@@index([userId], name: "userId")
@@map(name: "accounts")
}
model Session {
id Int @default(autoincrement()) @id
userId Int @map(name: "user_id")
expires DateTime
sessionToken String @unique @map(name: "session_token")
accessToken String @unique @map(name: "access_token")
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @default(now()) @map(name: "updated_at")
@@map(name: "sessions")
}
Environment & setup
- OS: Pop OS 20.10
- Database: PostgreSQL
- Node.js version: v12.19.0
Prisma Version
2.23.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
thread '<unnamed>' panicked at 'index out of bounds: the len ...
It looks to me like something outside of hir_def is causing the problem. Almost as if the data interned in the salsa database...
Read more >Array index out of bounds error even though the indices are ...
But I'm getting ArrayIndexOutOfBoundsException . Index 49 out of bounds for length 10. My code: public class ...
Read more >Python IndexError: List Index Out of Range [Easy Fix] - Finxter
One frequent bug in Python is the IndexError: list index out of range . So, what does this error message mean?
Read more >CWE-787: Out-of-bounds Write (4.9)
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic...
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Remaining problem tracked in https://github.com/prisma/prisma/issues/7186
I can reproduce this with
prisma validate
for any schema missing thedatasource
block, e.g. an empty schema:Thanks for reporting this @giordifungula - this is a proper bug we should fix.
(And yes, we make the mistake with
prisma.schema
vs.schema.prisma
all the time ourselves 😆)