Back

Can function events be triggered when developing locally ?

  • 0
  • Self Hosted
  • Functions
  • Web
  • Storage
Vineet
28 Jan, 2025, 14:39

I am a developing an appwrite function locally. I am not sure how to add a trigger for bucket file creation events. I added in the appwrite.json into the events parameter

TypeScript
"functions": [
        {
            "$id": "67989f220010250ff712",
            "name": "trancode video ",
            "runtime": "python-3.9",
            "specification": "s-0.5vcpu-512mb",
            "execute": [
                "any"
            ],
            "events": ["buckets.*.files.*.create"],
            "scopes": [
                "users.read"
            ],
            "schedule": "",
            "timeout": 15,
            "enabled": true,
            "logging": true,
            "entrypoint": "src/main.py",
            "commands": "pip install -r requirements.txt",
            "path": "functions/trancode video "
        }

I upload the file in the bucket but the function does not seem to trigger.

I tried deploying the function by pushing it but getting the following error

TypeScript
appwrite push
? Which resources would you like to push? Functions (Deployment)
? Which functions would you like to push? trancode video  (67989f220010250ff712)
Info: Validating functions ...
Info: Checking for changes ...
Info: Pushing functions ...
Error        • trancode video  (67989f220010250ff712)   • Invalid `specification` param: Specification must be one of: 
Error: No functions were pushed.

Unsure of what is wrong.

CLI version

TypeScript
appwrite --version
6.2.0

Appwrite deployment version

TypeScript
1.6.0
TL;DR
Developers are trying to trigger function events when developing locally. They added a trigger for bucket file creation events in appwrite.json but the function does not seem to trigger after uploading a file. When trying to deploy the function, they are facing an error related to the 'specification' parameter being invalid. CLI version: 6.2.0 Appwrite deployment version: 1.6.0 **Solution:** The error is due to an invalid 'specification' parameter. Developers should ensure the specification matches one of the valid options.
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