Back

Execution error: general_argument_invalid

  • 0
  • Self Hosted
  • Functions
Lucas Reis
5 Jan, 2024, 05:17

I am not sure what's going on. If I understood it right, I should be able to call my function through the domain I have set to it, but It doesn't work. I am always getting the error above.

No idea of what I am supposed to do, may you help me pls?

TL;DR
User is experiencing an "Execution error: general_argument_invalid" when trying to call a function through the domain. They are unsure of what to do. They also noticed that when deploying a new version of a function, the execute access roles are lost. User sets execution access to any role and the function responds as expected. User then runs `docker-compose down` and `docker-compose up -d` but the issue persists. It is discovered that the _APP_DOMAIN_FUNCTIONS environment variable is empty. Fixed by setting the env _APP_DOMAIN_FUNCTIONS=*.mydomain.com. Another user is experiencing the same issue on a Ubuntu 22.04
Drake
5 Jan, 2024, 05:20

What did you pass for the body?

Drake
5 Jan, 2024, 20:16

that env var should not match your custom function domain

Drake
5 Jan, 2024, 20:21

can you try running this on your server where your docker-compose.yml file is?

TypeScript
CONTAINER=appwrite-mariadb

docker exec -it $CONTAINER sh -c 'mysql -uroot -p$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE -e "select projectId as \"Project ID\", domain as \"Domain\", resourceType as \"Resource\", resourceId as \"Resource ID\" from _console_rules;"'
Lucas Reis
5 Jan, 2024, 20:23
Drake
5 Jan, 2024, 20:30

hmm that's all correct

Drake
5 Jan, 2024, 20:31

do you have a reverse proxy in front of appwrite?

Lucas Reis
5 Jan, 2024, 20:33

no

Lucas Reis
5 Jan, 2024, 20:33

there's only appwrite running on a Ubuntu 22.04 server

SenZi
6 Jan, 2024, 08:04

Having the same issue here

SenZi
6 Jan, 2024, 08:09

Nvm, Fixed it by setting the env _APP_DOMAIN_FUNCTIONS=*.mydomain.com

Drake
6 Jan, 2024, 17:20

@Lucas Reis, what's the domain functions env var if you run docker compose exec appwrite vars?

Lucas Reis
7 Jan, 2024, 03:16

interesting, it's empty even though I have it set in my .env file

Drake
7 Jan, 2024, 03:17

Did you run docker compose up -d to apply the changes?

Lucas Reis
7 Jan, 2024, 03:17

docker-compose restart

Lucas Reis
7 Jan, 2024, 03:19

so now I run docker-compose down and then docker-compose up -d

Drake
7 Jan, 2024, 03:19

This won't apply changes

Drake
7 Jan, 2024, 03:19

This does

Lucas Reis
7 Jan, 2024, 03:19

now I see it set as _APP_DOMAIN_FUNCTIONS=*.appwrite.ssw.lol

Lucas Reis
7 Jan, 2024, 03:19

lemme make a request to see what happens

Lucas Reis
7 Jan, 2024, 03:24

awesome, now I have got "Execution error: No permissions provided for action 'execute'", and as expected after I set execution access to any role it responded as expected πŸ˜„

Lucas Reis
8 Jan, 2024, 04:09

I just noticed when I deploy a new version of a function it loses the execute access roles. Is it the expected behaviour?

Drake
8 Jan, 2024, 04:27

Are you deploying with the CLI like appwrite deploy function?

Lucas Reis
8 Jan, 2024, 05:42

yes

Lucas Reis
8 Jan, 2024, 05:43

I see, it's about this option right?

"execute": [],

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