Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blobs list view failure when database is empty #495

Open
PabloCastellano opened this issue Aug 7, 2024 · 2 comments
Open

Blobs list view failure when database is empty #495

PabloCastellano opened this issue Aug 7, 2024 · 2 comments
Assignees
Labels
🐛bug Something isn't working

Comments

@PabloCastellano
Copy link
Member

Browsing to http://localhost:3000/blobs?p=0&ps=50 will fail when the database is empty and there are no blobs yet.

2024-08-07 16:39:05 ERROR app: 
Invalid `prisma.blobsOnTransactions.findMany()` invocation:


Error in query graph construction: AssertionError("Invalid value for skip argument: Value can only be positive, found: -50")
PrismaClientUnknownRequestError: 
Invalid `prisma.blobsOnTransactions.findMany()` invocation:


Error in query graph construction: AssertionError("Invalid value for skip argument: Value can only be positive, found: -50")
    at _n.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7939)
    ... 8 lines matching cause stack trace ...
    at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:451:32) {
  code: 'INTERNAL_SERVER_ERROR',
  name: 'TRPCError',
  [cause]: PrismaClientUnknownRequestError: 
  Invalid `prisma.blobsOnTransactions.findMany()` invocation:
  
  
  Error in query graph construction: AssertionError("Invalid value for skip argument: Value can only be positive, found: -50")
      at _n.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7939)
      at _n.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7057)
      at _n.request (/app/node_modules/@prisma/client/runtime/library.js:121:6741)
      at async l (/app/node_modules/@prisma/client/runtime/library.js:130:9355)
      at async Promise.all (index 0)
      at async /app/apps/web/.next/server/chunks/682.js:1:13392
      at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/index.mjs:421:30)
      at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:451:32)
      at async outputMiddleware (file:///app/node_modules/@trpc/server/dist/index.mjs:302:24)
      at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:451:32) {
    clientVersion: '5.17.0'
  }
}
@PabloCastellano PabloCastellano added the 🐛bug Something isn't working label Aug 7, 2024
@luis-herasme
Copy link
Member

The problem is not that the database is empty but that the query parameters are invalid. This issue can occur even when the database has data. In the URL you provided /blobs?p=0&ps=50, the p (page) value should always be equal to or greater than 1.

Did you manually modify the query parameters? If not, the root cause of the issue may be how the invalid URL was generated.

@luis-herasme luis-herasme self-assigned this Aug 19, 2024
@PabloCastellano
Copy link
Member Author

@luis-herasme I didn't modify the query parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants