Skip to content
Back

Server Error 500 if invalid data argument passed for Creating Child Doc in Relationship

  • 1
  • Self Hosted
  • Databases
Vedsaga
18 Jul, 2023, 17:32

I am self hosted verison, 1.3.7.

Document Structure,

TypeScript
Level 1
 - Level 2

Level 2 contain many Level 1 doc

Now, while creating Level 2 document if you pass list of Level 1 doc and for testing purpose, if you pass wrong data type for any of the artibute for example let's say Level 1 doc have attribute phone-number -> as interger and if you pass phoneNumber attrubute key as String "12345" . It return error 500 in the response in the clinet side.

Instead it should return normal 4xx error.

TL;DR
Users are experiencing a server error 500 when creating a child document with an invalid data argument in a relationship. This error occurs randomly and seems to occur more frequently as the database size increases. Some users have also encountered errors when deleting or updating documents with relationships. One user suggests that creating a demo internal project with many relationships could help identify and fix these issues. The user suggests creating a GitHub issue and providing screenshots to facilitate problem-solving. Another user reports the same issue on two projects and finds it very annoying. The user clarifies that the issue arises when creating a document with an invalid attribute and then appending it to another document as a relation
42Tom
18 Jul, 2023, 17:40

I have the same issue on 2 projects and it's very annoying. To clarify, my issue is that I can create a doc with invalid attribute (for example, a string longer than its attribute size), but then it breaks everything when appended to another doc as a relation. It should be impossible to create a document with a wrong attribute in the first place.

D5
18 Jul, 2023, 22:38

Could you please then create a GitHub issue describing the problem? If you add screenshots, etc it would be really useful to make it easier for maintainers finding and solving the issue 😄

42Tom
18 Jul, 2023, 22:47

Unfortunately this error seems quite inconsistant and is not appearing everytime. I think it could be very good for the core team to create a demo internal project involving a lot of relationhips, there are a lot of unhandled 500 happening randomly while deleting or updating documents. A strange bug that also happened to me today is that I needed to update all relationship fields when updating a single string field, otherwise it yielded a 500 error. Lots of small random errors that are very hard to reproduce.

42Tom
18 Jul, 2023, 22:48
42Tom
18 Jul, 2023, 22:49

A pattern I noticed in these errors is that they tend to happen once the project starts getting big. Playing with only a few level of relationship and a few documents is generally fine. Once the database starts getting bigger these random 500 starts to happen.

Vedsaga
19 Jul, 2023, 04:38

the core team to create a demo internal project involving a lot of relationhips

I second this, this will people help contribute and tend to slowly cover all edge cases one by one...

Vedsaga
19 Jul, 2023, 04:40

have even posted in the idea section long back

Vedsaga
19 Jul, 2023, 04:41
TypeScript
appwrite  | [Error] Timestamp: 2023-07-18T17:21:29+00:00
appwrite  | [Error] Method: POST
appwrite  | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents
appwrite  | [Error] Type: PDOException
appwrite  | [Error] Message: Out of range value for column 'phoneNumber' at row 1
appwrite  | [Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php
appwrite  | [Error] Line: 64

this was long for the error that return 500

Shmuel
5 Oct, 2023, 13:49

I tried to re-produce this error on 1.4.x and I get 400 Errors, Here https://github.com/appwrite/appwrite/issues/5851 Actually the '12345' was insert to age integer field

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