-
Hello, I’m encountering a strange bug. When I make a PATCH request to update a record, I receive a 404 error. Despite this error, the record is successfully updated. Here are the details: I have tried everything I can think of but I’m stuck. How can I debug or find the reason for getting a 404 error for my update request even though the data is updated? Thank you HTTP response {
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
} PB Log {
"id": "6kjq6xaogdojjpp",
"created": "2024-05-20 14:06:29.859Z",
"updated": "2024-05-20 14:06:29.859Z",
"data": {
"auth": "guest",
"details": "sql: no rows in result set",
"error": "The requested resource wasn't found.",
"execTime": 2.27089,
"method": "PATCH",
"referer": "",
"remoteIp": "192.168.0.2",
"status": 404,
"type": "request",
"url": "/api/collections/XXX/records/000000000000010",
"userAgent": "python-requests/2.31.0",
"userIp": "xx.xx.xx.xx"
},
"message": "PATCH /api/collections/XXX/records/000000000000010",
"level": 8
} Collection details
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'm not able to reproduce the issue with the provided collection. Double check that you are sending the request to the correct collection (I'm not sure if it is just the example but in the logs the collection is If you are able to update the record from the Admin UI then most likely there is something wrong with your PATCH request but without details how you are actually sending it there is no much I can help with. |
Beta Was this translation helpful? Give feedback.
-
@ganigeorgiev Yes, the request was from that collection. I redacted the collection name, which is why there was a discrepancy between XXX and testbase. I managed to fix the issue by updating the index rule from the relate table/base. My index rule looks like this this: CREATE UNIQUE INDEX `idx_m8K0jwS` ON `events` (
`date`,
`type`,
`unknowns`,
`testbase`
) I toggled the UNIQUE index on and off, and suddenly it started working. I’m not sure why this happened or how it fixed the issue, but since the problem is resolved and not reproducible, I wanted to share this for the record. Sorry for taking your time @ganigeorgiev |
Beta Was this translation helpful? Give feedback.
@ganigeorgiev Yes, the request was from that collection. I redacted the collection name, which is why there was a discrepancy between XXX and testbase.
I managed to fix the issue by updating the index rule from the relate table/base.
My index rule looks like this this:
I toggled the UNIQUE index on and off, and suddenly it started working. I’m not sure why this happened or how it fixed the issue, but since the problem is resolved and not reproducible, I wanted to share this for the record.
Sorry for taking your time @ganigeorgiev