Cannot neither DEBUG nor DEPLOY cloud code

Even though I have my coderunner.json set up, it tries connecting to localhost?

Console log on npm run debug:

asjustis@Justinass-MBP FaceGenius-Backendless % npm run debug

> FaceGeniusDev-coderunner-project-template@1.0.0 debug
> coderunner debug

17:28:34.092 [master] CodeRunner(tm) Backendless JavaScript CodeRunner v6.7.3
17:28:34.095 [master] Copyright(C) 2023 Backendless Corp. All rights reserved. 
17:28:34.117 [master] Initializing configs...
17:28:34.120 [master] Configs: {
  "workers": {
    "cache": false,
    "concurrent": 4,
    "minIdle": 4,
    "cachedIdleTTL": 60,
    "heartbeat": {
      "interval": 5,
      "timeout": 10,
      "codeInspectionTimeout": 60
    }
  },
  "redis": {
    "analytics": {
      "host": "localhost",
      "port": 6379
    }
  },
  "deploy": {
    "progressInterval": 500
  },
  "backendless": {
    "forwardableHeaders": {},
    "msgBroker": {
      "host": "localhost",
      "port": 6379
    },
    "public": {
      "fileDownloadUrl": "http://localhost:9000",
      "publicAPIUrl": "http://localhost:9000",
      "internalAPIUrl": "https://api.backendless.com"
    },
    "apiServer": "https://api.backendless.com",
    "apiUrl": "https://api.backendless.com",
    "repoPath": "/var/lib/backendless/repo/"
  },
  "app": {
    "id": "F2FE78BB-5D08-44FE-B074-6E7C29B49B03",
    "apiKey": "xxxxx-my-key",
    "exclude": [
      "package.json",
      "coderunner.json",
      "README.md",
      "servercode.iml",
      "servercode.ipr",
      "servercode.iws"
    ],
    "model": "default"
  },
  "sandbox": false,
  "verbose": false,
  "compression": {
    "debug": false,
    "prod": false,
    "threshold": 8192
  },
  "loggers": {
    "console": true,
    "file": false,
    "backendless": true,
    "maxTextLength": 5000,
    "levels": {
      "default": "info",
      "Status": "",
      "Server": ""
    }
  },
  "rateLimit": {
    "default": 10,
    "enabled": false,
    "overrides": {}
  },
  "debug": false
}
logger was created
17:28:34.215 [master] Starting Debug Code Runner...
17:28:34.216 [master] Building Model..
17:28:34.426 [master] ServerCode Model built in 210ms
17:28:34.426 [master] Event handlers (1):
17:28:34.427 [master]   user.afterUpdate (async) (handlers/user/afterUpdate.js)
17:28:34.427 [master] Services (3):
17:28:34.427 [master]   Custom (services/Custom.js)
17:28:34.427 [master]   Stripe (services/Stripe.js)
17:28:34.427 [master]   User (services/User.js)
17:28:34.428 [master] Connection to Redis...
17:28:34.437 [master] Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
  errno: -61,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}

And here is my coderunner.json which worked fine with backendless-coderunner: ^6.1.1 version, but failed on npm run deploy:

{
  "backendless": {
    "apiServer": "https://api.backendless.com",
    "msgBroker": {
      "host": "cl.backendless.com",
      "port": 6379
    }
  },
  "app": {
    "id": "F2FE78BB-5D08-44FE-B074-6E7C29B49B03",
    "apiKey": "xxxx-my-key",
    "exclude": [
      "package.json",
      "coderunner.json",
      "README.md",
      "servercode.iml",
      "servercode.ipr",
      "servercode.iws"
    ]
  }
}

How do I deploy my code?? :slight_smile:

Thanks,
Justinas

Hi @Justinas_Grazulis

I just download an app from the my app in the cloud and it works well for me

Vladimirs-MacBook-Pro:aa11aa__JS_MyConfig_coding vladimirupirov$ npm run debug

> aa11aa-servercode@1.0.0 debug /Users/vladimirupirov/Downloads/aa11aa__JS_MyConfig_coding
> coderunner debug

18:08:12.238 [master] CodeRunner(tm) Backendless JavaScript CodeRunner v6.7.3
18:08:12.243 [master] Copyright(C) 2023 Backendless Corp. All rights reserved. 
18:08:12.273 [master] Initializing configs...
18:08:12.276 [master] Configs: {
  "workers": {
    "cache": false,
    "concurrent": 4,
    "minIdle": 4,
    "cachedIdleTTL": 60,
    "heartbeat": {
      "interval": 5,
      "timeout": 10,
      "codeInspectionTimeout": 60
    }
  },
  "redis": {
    "analytics": {
      "host": "localhost",
      "port": 6379
    }
  },
  "deploy": {
    "progressInterval": 500
  },
  "backendless": {
    "forwardableHeaders": {},
    "msgBroker": {
      "host": "localhost",
      "port": 6379
    },
    "public": {
      "fileDownloadUrl": "http://localhost:9000",
      "publicAPIUrl": "http://localhost:9000",
      "internalAPIUrl": "https://api.backendless.com"
    },
    "apiServer": "https://api.backendless.com",
    "apiUrl": "https://api.backendless.com",
    "repoPath": "/var/lib/backendless/repo/"
  },
  "app": {
    "id": "xxxxxx",
    "apiKey": "xxxxxxx",
    "exclude": [
      "package.json",
      "coderunner.json",
      "README.md",
      "servercode.iml",
      "servercode.ipr",
      "servercode.iws"
    ],
    "model": "MyConfig"
  },
  "sandbox": false,
  "verbose": false,
  "compression": {
    "debug": false,
    "prod": false,
    "threshold": 8192
  },
  "loggers": {
    "console": true,
    "file": false,
    "backendless": true,
    "maxTextLength": 5000,
    "levels": {
      "default": "info",
      "Status": "",
      "Server": ""
    }
  },
  "rateLimit": {
    "default": 10,
    "enabled": false,
    "overrides": {}
  },
  "debug": false
}
logger was created
18:08:12.387 [master] Starting Debug Code Runner...
18:08:12.387 [master] Building Model..
18:08:12.503 [master] ServerCode Model built in 116ms
18:08:12.503 [master] Services (1):
18:08:12.503 [master]   MyConfig (services/config.js)
18:08:12.503 [master] Connection to Redis...
18:08:12.518 [master] new client [Redis:setter] was connected in 13ms
18:08:12.519 [master] new client [Redis:subscriber] was connected in 14ms
18:08:12.519 [master] new client [Redis:getter_1] was connected in 14ms
18:08:12.519 [master] Connection with Redis has been established
18:08:12.519 [master] Registering Code Runner on https://api.backendless.com
18:08:13.102 [master] Runner successfully registered.
18:08:13.103 [master] Registering Model on https://api.backendless.com
18:08:13.735 [master] Model successfully registered
18:08:13.736 [master] Waiting for Server Code tasks..

coderunner.json

{
  "backendless": {
    "apiServer": "https://api.backendless.com",

    "msgBroker": {
      "host": "cl.backendless.com",
      "port": 6379
    }
  },

  "app": {
    "id": "xxxxx",
    "apiKey": "xxxx",
    "model": "MyConfig",
    "exclude": [
        "package.json",
        "coderunner.json",
        "README.md",
        "servercode.iml",
        "servercode.ipr",
        "servercode.iws"
    ]
  }
}

could you please share a screenshot of your files structure

Not sure how it can help, but here it is:

In the meantime, I reverted back to v6.6.4 and node@16 (which seem to fix the problem from the other posts in forum)

I was able to reproduce the issue, we will fix it asap

1 Like

try to upgrade the backendless-coderunner module to the latest version 6.7.4 and then try to run one more time

npm run debug

or

npm run deploy

Hi @vladimir-upirov, this worked. I used node@16, not sure about the node@19 I use usually.

Thanks for a quick turnaround!

1 Like