#Can not start function locally. Getting Error: connect ECONNREFUSED 127.0.0.1:3000

4 messages Β· Page 1 of 1 (latest)

shell parrot
#
➜  appwrite git:(main) βœ— appwrite run function --with-variables --no-reload
? Which function would you like to develop locally? scrape-user-data (scrape-user-data)
                                                                                                               
  runtime   β”‚ entrypoint                              β”‚ path                              β”‚ commands β”‚ scopes  
 ───────────┼─────────────────────────────────────────┼───────────────────────────────────┼──────────┼──────── 
  node-18.0 β”‚ appwrite-functions-scrape-user-data.mjs β”‚ functions/scrape-user-data/output β”‚          β”‚ []      
                                                                                                               
β„Ή Info: If you wish to change your local settings, update the appwrite.json file and rerun the 'appwrite run' command.
β™₯ Hint: Permissions, events, CRON and timeouts dont apply when running locally.
β„Ή Info: Verifying Docker image ...
β„Ή Info: Building function using Docker ...
Preparing for build ...

Building ...

sh: undefined: not found

β„Ή Info: Starting function using Docker ...
β™₯ Hint: Function automatically restarts when you edit your code.
Preparing for start ...
tar: invalid magic
tar: short read
βœ— Error: connect ECONNREFUSED 127.0.0.1:3000

Your guide to creating, testing, and maintaining Appwrite functions locally.

shell parrot
#

appwrite.json being (shortened):

{
    "projectId": "partner-portal",
    "projectName": "Partner Portal",
    "functions": [
        {
            "$id": "create-user",
            "name": "create-user",
            "runtime": "node-18.0",
            "execute": ["any"],
            "events": [],
            "schedule": "",
            "timeout": 15,
            "enabled": true,
            "logging": true,
            "entrypoint": "appwrite-functions-create-user.mjs",
            "ignore": ["node_modules", ".npm"],
            "path": "functions/create-user/output"
        },
        {
            "$id": "handle-user-deleted",
            "name": "handle-user-deleted",
            "runtime": "node-18.0",
            "execute": [],
            "events": ["users.*.delete"],
            "schedule": "",
            "timeout": 15,
            "enabled": true,
            "logging": true,
            "entrypoint": "appwrite-functions-handle-user-deleted.mjs",
            "ignore": ["node_modules", ".npm"],
            "path": "functions/handle-user-deleted/output"
        },
        {
            "$id": "scrape-user-data",
            "name": "scrape-user-data",
            "runtime": "node-18.0",
            "execute": ["users"],
            "events": [],
            "schedule": "",
            "timeout": 900,
            "enabled": true,
            "logging": true,
            "entrypoint": "appwrite-functions-scrape-user-data.mjs",
            "ignore": ["node_modules", ".npm"],
            "path": "functions/scrape-user-data/output"
        }

...