Back

Error 500 database with relational after upgrade

  • 1
  • Self Hosted
  • Databases
bluesky
28 Apr, 2023, 06:37

If update to 1.3.2 from 1.3.1 need to run migrate command?

TL;DR
User is experiencing an error 500 with a relational database after upgrading. There was a problem with the migration code in version 1.3.2 that caused the id of the relation to be null. Version 1.3.3 fixes the migration code. To fix the error, you need to restore from a backup or recreate your collections. You can downgrade to version 1.3.1 and then upgrade to 1.3.3 to fix the issue. If you can't see the data, you can't back it up. After backing up the database, delete the Relationship attribute and recreate it. Make sure to
Binyamin
28 Apr, 2023, 12:20

Actually you're correct. My bad, sorry for the mistake.

From my walking through the code it seems like no change will happened when migrating the same DB version.

Binyamin
28 Apr, 2023, 12:59

In the url can you add /settings to the end of it, and let us know what Document Security settings are?

bluesky
28 Apr, 2023, 13:10

Yes, I can

Binyamin
28 Apr, 2023, 13:14

After you've done the backup you can try to delete Relationship attribute and recreate it.

Be sure again to backup all your database before, so you'll be able to go back in any case.

bluesky
28 Apr, 2023, 13:28

I cant's see the data, so I cant backup

Binyamin
28 Apr, 2023, 13:31

I mean backing-up the database using Steven gist:

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

bluesky
28 Apr, 2023, 13:45

Okay, I’ll try it

Drake
28 Apr, 2023, 17:30

yes, you need to run the migrate command. did you not?

Binyamin
28 Apr, 2023, 17:31

Is it require to run migrate in Minor upgrades?

Drake
28 Apr, 2023, 17:31

typically, not, but this time it's required

hamed
28 Apr, 2023, 18:28

I have the same error too,

Drake
28 Apr, 2023, 18:31

😬

Drake
28 Apr, 2023, 18:54

@hamed @bluesky, I think y'all will have to restore from backup 😬

Drake
28 Apr, 2023, 19:08

and downgrade 😬

Drake
28 Apr, 2023, 20:40

There was a problem with the migration that messed up the relationships metadata. if you can restore to 1.3.1, you can upgrade to 1.3.3, instead, now (and run the migrate command)

bluesky
28 Apr, 2023, 22:07

So I must downgrade first to 1.3.1, and upgrade to 1.3.3? Or can just upgrade to 1.3.3 from 1.3.2?

Drake
28 Apr, 2023, 22:13

You would need to restore from backup or recreate your collections because your relationship attributes are screwed up already

bluesky
28 Apr, 2023, 22:14

It was fixing on 1.3.3?

bluesky
28 Apr, 2023, 22:15

Okay I need to know what is going happen?

Drake
28 Apr, 2023, 22:15

1.3.3 fixes the migration code (which you already ran)

Drake
28 Apr, 2023, 22:15

What do you mean?

bluesky
28 Apr, 2023, 22:16

The migrations on 1.3.2 make id of relation null?

Drake
28 Apr, 2023, 22:16

Sort of yes

bluesky
28 Apr, 2023, 22:19

I’ll try it, thanks @Steven

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