
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
[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

How did you have made and restored the backup?

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

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.

What are the logs for docker compose logs appwrite
?

[...]
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

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

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

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

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.

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

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

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.

Okay I would try again thanks 🙂 I'm working on a test env so it should be fine, thanks for the warning 🙂
Recommended threads
- 404 errors after 7 Days
Local hosted Appwrite via docker. Last version and current version. After exactly 7 days Appwrite stops working. I get 404 route not found, cannot access anyth...
- unable to modify attribute
please help: when I try to modify attribute size or key or anything, I am getting this errors: ``` Deprecated: strtolower(): Passing null to parameter #1 ($str...
- Error 1.7.4 console team no found
In console when i go to auth, select user, select a membership the url not work. Only work searching the team. It is by the region. project-default- and i get ...
