Back

[SOLVED] 500 Internal error when I try to access the function settings page

  • 0
  • Functions
Roberto_From_Brescia
9 May, 2023, 07:55

Nothing...

TL;DR
There was a 500 Internal error when trying to access the function settings page. The issue was solved by running a previous migration command `docker compose exec appwrite migrate version=1.0.3`.
Roberto_From_Brescia
9 May, 2023, 07:55
TypeScript
+--------------------+------------------+------+-----+---------+----------------+
| Field              | Type             | Null | Key | Default | Extra          |
+--------------------+------------------+------+-----+---------+----------------+
| _id                | int(11) unsigned | NO   | PRI | NULL    | auto_increment |
| _uid               | char(255)        | NO   | UNI | NULL    |                |
| _createdAt         | datetime(3)      | YES  | MUL | NULL    |                |
| _updatedAt         | datetime(3)      | YES  | MUL | NULL    |                |
| _permissions       | mediumtext       | YES  |     | NULL    |                |
| functionInternalId | varchar(255)     | YES  | MUL | NULL    |                |
| functionId         | varchar(255)     | YES  |     | NULL    |                |
| key                | varchar(255)     | YES  | MUL | NULL    |                |
| value              | varchar(8192)    | YES  |     | NULL    |                |
| search             | text             | YES  | MUL | NULL    |                |
+--------------------+------------------+------+-----+---------+----------------+
Drake
9 May, 2023, 14:33

ok that looks fine. How about:

TypeScript
#!/bin/sh
CONTAINER=appwrite-mariadb
PROJECT=<YOUR PROJECT>

docker exec -it $CONTAINER sh -c 'mysql -uroot -p$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE -e "select _permissions, documentSecurity, attributes FROM _$1__metadata where _uid = \"variables\";"' -- $PROJECT
Drake
9 May, 2023, 14:40

and then the last thing to check is your cache:

TypeScript
CONTAINER=appwrite-redis
PROJECT=<YOUR INTERNAL PROJECT ID>
FUNCTION=<YOUR FUNCTION ID IN APPWRITE>

docker exec -it $CONTAINER redis-cli get "cache-_$PROJECT:functions:$FUNCTION:*"
Roberto_From_Brescia
10 May, 2023, 11:10
TypeScript
| _permissions        | documentSecurity | attributes                                                                                                                                                                                                                                                                                                                 
| ["create(\"any\")"] |                1 | [{"$id":"functionInternalId","type":"string","size":255,"required":false,"signed":true,"array":false,"filters":[]},{"$id":"functionId","type":"string","size":255,"required":false,"signed":true,"array":false,"filters":[]},{"$id":"key","type":"string","size":255,"required":false,"signed":true,"array":false,"filters":[]},{"$id":"value","type":"string","size":8192,"required":true,"signed":true,"array":false,"filters":["encrypt"]},{"$id":"search","type":"string","size":16384,"required":false,"signed":true,"array":false,"filters":[]}] |
Roberto_From_Brescia
10 May, 2023, 11:13

"{\"time\":1683717111,\"data\":{\"execute\":[\"team:6267a31756342200796f\"],\"name\":\"NodeMailer\",\"dateCreated\":null,\"dateUpdated\":null,\"runtime\":\"node-16.0\",\"deployment\":\"642d748d604f5729eeba\",\"vars\":null,\"events\":[],\"schedule\":\"\",\"schedulePrevious\":null,\"scheduleNext\":null,\"timeout\":15,\"search\":\"642d4aa17a6fe52bd45d NodeMailer node-16.0\",\"scheduleUpdatedAt\":\"2023-04-05T13:15:57.322+00:00\",\"enabled\":true,\"$id\":\"642d4aa17a6fe52bd45d\",\"$internalId\":\"13\",\"$createdAt\":\"2023-04-05T10:17:05.501+00:00\",\"$updatedAt\":\"2023-04-05T13:16:09.044+00:00\",\"$permissions\":[],\"$collection\":\"functions\"}}"

Roberto_From_Brescia
10 May, 2023, 13:04

@Steven I think I found the error: in redis vars it has null value but must be an empty array

Roberto_From_Brescia
10 May, 2023, 13:05
Roberto_From_Brescia
10 May, 2023, 13:09

But if I delete the redis data, the value of vars returns null when it is inserted again in redis

Drake
10 May, 2023, 16:20

Awesome! This is a step forward! Now...let me see how/why it's going in as null. It should be going in as an empty array...

Drake
10 May, 2023, 16:21

Are you just viewing the function and then the data gets inserted into redis?

Drake
10 May, 2023, 16:26

actually...this looks a little different for me...mine looks like this for the attributes:

TypeScript
[
  {
    "$id": "functionInternalId",
    "type": "string",
    "size": 255,
    "required": false,
    "signed": true,
    "array": false,
    "filters": [],
    "default": null,
    "format": ""
  },
  {
    "$id": "functionId",
    "type": "string",
    "size": 255,
    "required": false,
    "signed": true,
    "array": false,
    "filters": [],
    "default": null,
    "format": ""
  },
  {
    "$id": "key",
    "type": "string",
    "size": 255,
    "required": false,
    "signed": true,
    "array": false,
    "filters": [],
    "default": null,
    "format": ""
  },
  {
    "$id": "value",
    "type": "string",
    "size": 8192,
    "required": true,
    "signed": true,
    "array": false,
    "filters": ["encrypt"],
    "default": null,
    "format": ""
  },
  {
    "$id": "search",
    "type": "string",
    "size": 16384,
    "required": false,
    "signed": true,
    "array": false,
    "filters": [],
    "default": null,
    "format": ""
  }
]
Drake
10 May, 2023, 16:30

What's this output for you?

TypeScript
#!/bin/sh
CONTAINER=appwrite-mariadb
PROJECT=<YOUR PROJECT>

docker exec -it $CONTAINER sh -c 'mysql -uroot -p$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE -e "select _permissions, documentSecurity, attributes FROM _$1__metadata where _uid = \"functions\";"' -- $PROJECT
Roberto_From_Brescia
11 May, 2023, 08:43

Yes!

Roberto_From_Brescia
11 May, 2023, 08:50
Drake
11 May, 2023, 14:53

what the heck? that looks really weird...this is probably the problem...the filters for vars is also incorrect...

Roberto_From_Brescia
11 May, 2023, 15:15

Uhm... How i fix this?

Drake
11 May, 2023, 15:38

so you might be able to fix this by running a previous migration. make sure to take a backup first just in case. then you can run:

TypeScript
docker compose exec appwrite migrate version=1.0.3
Roberto_From_Brescia
11 May, 2023, 15:53

It wokrs! Thank you for your time and patience!

Drake
11 May, 2023, 15:53

HUZZAHH! 🎉

Roberto_From_Brescia
11 May, 2023, 15:53

[SOLVED] 500 Internal error when I try to access the function settings page

Roberto_From_Brescia
8 Sep, 2023, 15:53

For reminder and to help other users to fix:

  • upgrade from Appwrite 1.3.1 to Appwrite 1.3.4
  • run migration command (docker compose exec appwrite migrate)
  • run migration command (docker compose exec appwrite migrate version=1.0.3)
  • enjoy Appwrite!
xpediter
15 Sep, 2023, 10:48

Hi everyone, I'm sure there is already documentation but unfortunately I can't find it. How can I access my mariaDB in my appwrite docker container via MySQLWorkbench or tabelPlus tool or similar SQL tools? THX

xpediter
15 Sep, 2023, 12:13

i got the answer above:

#!/bin/sh CONTAINER=appwrite-mariadb PROJECT=<YOUR PROJECT>

docker exec -it $CONTAINER sh -c 'mysql -uroot -p$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE -e "select _permissions, documentSecurity, attributes FROM _$1__metadata where _uid = functions;"' -- $PROJECT

What is the root password and whats the database-name? Is project important?

Drake
15 Sep, 2023, 17:43

please create a new post instead of posting in an old thread

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