Skip to content
Back

Function settings doesn't work on self-hosted 1.9.5

  • 0
  • 7
  • Self Hosted
  • Functions
2 Jul, 2026, 05:39

When a function setting is changed (like for example the function name) the servers returns a 500.

The "appwrite" containers print the following error:

TypeScript
appwrite  | http.request · 169.5ms · 50a9ce27
appwrite  | 
appwrite  |   level              error
appwrite  |   http.method        PUT
appwrite  |   http.path          /v1/functions/:functionId
appwrite  |   http.response.code 500
appwrite  | 
appwrite  |   Utopia\Database\Exception\Structure: Invalid document structure: Unknown attribute: "providerBranches"
appwrite  |     at /usr/src/code/vendor/utopia-php/database/src/Database/Database.php:6346
appwrite  |     at /usr/src/code/vendor/utopia-php/database/src/Database/Adapter.php:432
appwrite  |     at /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/Pool.php:169
appwrite  |     at /usr/src/code/vendor/utopia-php/pools/src/Pools/Pool.php:229
appwrite  |     ... 10 more
appwrite  | 
appwrite  | ────────────────────────────────────────────────────────────
TL;DR
Issue with function settings on self-hosted 1.9.5 version. Error persists even after running script and flushing redis. Encountered different error "Invalid document structure: Unknown attribute: 'owner'". Suggested running verification script, which confirmed missing provider keys and potential corruption. Advised to consider using a backup due to unusual error. User recommended running migrate command with backup to resolve.createTime: 1h
2 Jul, 2026, 07:31

<@262572967358234634> try running

docker compose exec redis redis-cli FLUSHALL docker compose restart appwrite appwrite-worker-deletes appwrite-worker-databases

2 Jul, 2026, 07:55

Nothing changed

2 Jul, 2026, 07:56

did command run successfully?

2 Jul, 2026, 08:02

its likely there is a _APP_REDIS_HOST mistmatch?

2 Jul, 2026, 09:04

Commands were success full, redis host is redis

2 Jul, 2026, 09:11

can u confirm the attribute exists in db schema?

2 Jul, 2026, 11:05

while testing 1.9.5 for myself, i also went into the issue after upgrading from 1.9.0 (not fresh 1.9.5 install, there is no issue with fresh installs)

the migrations process shows this on first run :

2 Jul, 2026, 11:07

small question, when updating the mariadb, do you do one UPDATE/INSERT for all the attributes or is it one per attribute ?

for example in 1.9.0 i think deploymentRetention already exists as i was using it, and so the command might fail since that deploymentRetention exists but not providerBranches ? which result in a missing providerBranches at the end ?

2 Jul, 2026, 11:32

also to anwser this, no providerBranches doesn't exist in the db for me

2 Jul, 2026, 11:33

also providerPaths doesn't too

2 Jul, 2026, 11:38

Can you share the command you used to check if the attribute is there please? I tried a few, returned nothing, could be an indication that it is missing

2 Jul, 2026, 11:38

you can check with :

TypeScript
-- Verification (adjust prefix _1_ if you have multiple projects)
SELECT name,
       JSON_SEARCH(attributes, 'one', 'providerBranches', NULL, '$[*]."$id"') AS provider_branches_attr,
       JSON_SEARCH(attributes, 'one', 'providerPaths', NULL, '$[*]."$id"') AS provider_paths_attr
FROM _1__metadata
WHERE name IN ('functions', 'sites');

SHOW COLUMNS FROM _1_functions LIKE 'provider%';
SHOW COLUMNS FROM _1_sites LIKE 'provider%';

and also here is a script that should fix everything :

2 Jul, 2026, 11:42

also example on how to run it inside the mariadb container : mariadb -u<user> -p<password> <db_name> < scripts/repair-1.9.5-migration.sql (replace the <...> with your values, the username and password don't have space between the key and the value)

2 Jul, 2026, 11:46

also forgot to say but you need to flush the redis cache after the script

1
2 Jul, 2026, 11:49

did it work for you <@145890130496847872> ? since i saw your reaction ?

2 Jul, 2026, 11:50

Haven't tried it yet, currently having lunch

2 Jul, 2026, 11:50

oh ok ok

2 Jul, 2026, 11:50

good lunch then 😉

2 Jul, 2026, 11:50

Thanks!

2 Jul, 2026, 13:29

other thing, it also afect sites, not only functions, the script fix both, but still worth mentioning

2 Jul, 2026, 14:52

It worked, told claude code to do all of it because I didn't have time, but after running the script and doing the redis flush and restart of the containers I succesfully managed to create a site from the web

2 Jul, 2026, 14:53

Big thanks <@493852865907916800> ❤️

2 Jul, 2026, 14:55

nice, happy that it worked 🙂

3 Jul, 2026, 00:47

tysm, it also worked for me

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