
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
- Any example for using Appwrite with Verc...
Can not find an example on this.
- Sites deployments don't auto start after...
Hey, I recently found out that when our docker service restarts (for whatever reason, usually me poking around in config) each site deployment need to be manual...
- Hello guys
First of all thank you very much for so good application. I have self-hosted AppWrite instance on my VPS. It is working on http protocol 90 and https 543. These...
