Back

Error 500 on latest 1.5.7

  • 0
  • Self Hosted
iStornZ
14 Jun, 2024, 10:06

Hello all, I restored from backup my server and now I have an error 500 when trying to access:

Here is the logs from appwrite container

TypeScript
[Error] Timestamp: 2024-06-14T10:04:21+00:00
[Error] Method: GET
[Error] URL: /v1/account/prefs
[Error] Type: TypeError
[Error] Message: Utopia\Database\Document::__construct(): Argument #1 ($input) must be of type array, Utopia\Database\Document given, called in /usr/src/code/app/controllers/api/account.php on line 2409
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Document.php
[Error] Line: 27
TL;DR
Developers experiencing Error 500 after restoring backup on server. Attempt database deletion/restoration & exercise caution with important data. Manually editing DB might be an option. The issue seems related to a TypeError involving a database document. Ensure backup and restoration scripts are used correctly. The error was likely generated due to incorrect database restoration.
D5
14 Jun, 2024, 10:19

How did you have made and restored the backup?

D5
14 Jun, 2024, 10:19

At what version the backup was made? Do you have upgraded the server or similar prior to restoring the backup?

iStornZ
14 Jun, 2024, 10:44

I used theses script to backup & restore:

https://gist.github.com/stnguyen90/fee636ff652b8ecbf761935b2aa254fb/

The backup was made on version 1.5.7 No upgrade has been made. The restoration was working great instead I restarted the server.

D5
14 Jun, 2024, 10:46

What are the logs for docker compose logs appwrite ?

iStornZ
14 Jun, 2024, 10:46
TypeScript
[...]
appwrite  | [Error] Timestamp: 2024-06-14T10:07:18+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/account/prefs
appwrite  | [Error] Type: TypeError
appwrite  | [Error] Message: Utopia\Database\Document::__construct(): Argument #1 ($input) must be of type array, Utopia\Database\Document given, called in /usr/src/code/app/controllers/api/account.php on line 2409
appwrite  | [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Document.php
appwrite  | [Error] Line: 27
appwrite  | [Error] Timestamp: 2024-06-14T10:40:54+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/account/prefs
appwrite  | [Error] Type: TypeError
appwrite  | [Error] Message: Utopia\Database\Document::__construct(): Argument #1 ($input) must be of type array, Utopia\Database\Document given, called in /usr/src/code/app/controllers/api/account.php on line 2409
appwrite  | [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Document.php
appwrite  | [Error] Line: 27
appwrite  | [Error] Timestamp: 2024-06-14T10:40:54+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/account/prefs
appwrite  | [Error] Type: TypeError
appwrite  | [Error] Message: Utopia\Database\Document::__construct(): Argument #1 ($input) must be of type array, Utopia\Database\Document given, called in /usr/src/code/app/controllers/api/account.php on line 2409
appwrite  | [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Document.php
appwrite  | [Error] Line: 27
D5
14 Jun, 2024, 10:48

It seems that there's something wrong with the DB so restore fails

iStornZ
14 Jun, 2024, 10:49

Maybe is it possible to edit the DB manually to search what is going wrong?

D5
14 Jun, 2024, 10:50

Yeah, of course. You can as any other MariaDB database

D5
14 Jun, 2024, 10:50

I think that you will need to delete the existing DB volume (make a backup of the volume and make sure to not overwrite or delete accidentally the backup that you have with the Steven script) (In oter words, a separated backup of that). And then restore the backup with the restore script.

D5
14 Jun, 2024, 10:52

(Make also sure that you know how to do all the process correctly) (Testing on a test environment is very recommended)

iStornZ
14 Jun, 2024, 10:52

You mean to delete the actuall broken restored & restore again?

D5
14 Jun, 2024, 10:54

Basically deleting the actual broken database data and then restoring the backup. Be careful with all that as mentioned, mainly if it contains important data. You will loss all the data posterior to backup.

iStornZ
14 Jun, 2024, 10:55

Okay I would try again thanks πŸ™‚ I'm working on a test env so it should be fine, thanks for the warning πŸ™‚

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