Back

error occurs intermittently when attempting to query appwrite for data EROR : AppwriteException

  • 1
  • Databases
  • Web
  • Cloud
Aditya
9 Mar, 2024, 13:00

This error occurs intermittently when attempting to query appwrite for data in nextjs server component Error: AppwriteException: request to https://cloud.appwrite.io/v1/databases/SECRET/collections/SECRET/documents?queries%5BB0%5D=equal("is_published"%2C+%5Btrue%5D)&queries%5B1%5D=select(%5B"title"%2C"summary"%2C"%24id"%2C"featured_image"%5D) failed, reason: socket connection timeout.

This is the query: const articles = (await appwriteDatabaseService.queryPackges({ collectionId: config.appwriteBlogCollectionId, filters: [ Query.equal("is_published", true), Query.select(["title", "summary", "$id", "featured_image"]), ], })))

TL;DR
Developers experiencing intermittent errors when querying data on Appwrite due to AppwriteException causing server error. Removing queries from the function solves the issue temporarily. Upgrading to version 14 or downgrading to 13.0.1 did not resolve the problem.
D5
9 Mar, 2024, 13:04

What's your appwrite SDK version?

Aditya
10 Mar, 2024, 08:50

^13.0.1

Aditya
10 Mar, 2024, 08:55

I tried upgrading it to 14 , issue remain same

Aditya
10 Mar, 2024, 08:59

AppwriteException: Server Error at AppwriteDatabaseService.queryPackges (webpack-internal:///(rsc)/./app/appwrite/databaseConfig.ts:47:19)

frankenstein
10 Mar, 2024, 09:02

This is a real problem. The function works when you remove queries but when you add queries. its a problem

Aditya
10 Mar, 2024, 09:03

yes

Aditya
10 Mar, 2024, 09:04

its occuring because of queries , I removed the query and it worked

Aditya
10 Mar, 2024, 09:04
TypeScript
    at Client.eval (webpack-internal:///(rsc)/./node_modules/appwrite/dist/esm/sdk.js:448:27)
    at Generator.next (<anonymous>)
    at fulfilled (webpack-internal:///(rsc)/./node_modules/appwrite/dist/esm/sdk.js:54:32)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 500,
  type: 'general_unknown',
  response: {
    message: 'Server Error',
    code: 500,
    type: 'general_unknown',
    version: '0.12.113'
  }
}```
Steven
10 Mar, 2024, 09:39

Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

frankenstein
10 Mar, 2024, 09:43

okay lets be patient. does downgrading help?

Steven
10 Mar, 2024, 13:07

Maybe. Not sure

Aditya
11 Mar, 2024, 08:14

Any update on this ? Am i doing anything wrong or is it a real problem ?

Steven
11 Mar, 2024, 08:45

What's your project id?

ray_pamber
11 Mar, 2024, 09:00

I have same problem 😦

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more