Registering Code Runner Issue

Hello, when I start to debug my cloud code using code runner, everything works fine until it tries to register the code runner on api.backendless.com. All I see is "Registering Code Runner on https://api.backendless.com. It never responds with an error or success. I have to manually terminate it.

My app Id is A391CEB9-8C46-C3E2-FFF9-51E251BCF100

I’ve tried several different versions of NodeJS and the Code Runner package but it’s been the same result.

Hello @Phil1!

Could you please provide more information and the entire log?
This will help us understand the issue more quickly.

Regards,
Alexander

Sure I execute the following code : \node_modules\backendless-coderunner\bin\coderunner debug

And here is the log from that execution:

Debugger attached.
11:24:06.466 [master] CodeRunner(tm) Backendless JavaScript CodeRunner v6.7.4
11:24:06.473 [master] Copyright(C) 2024 Backendless Corp. All rights reserved. 
11:24:06.542 [master] Initializing configs...
11:24:06.550 [master] Configs: {
  "managementHttpPort": null,
  "workers": {
    "lowPriorityThreshold": 0.8,
    "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": "cl.backendless.com",
      "port": 6379
    },
    "public": {
      "fileDownloadUrl": "http://localhost:9000",
      "publicAPIUrl": "http://localhost:9000",
      "internalAPIUrl": "https://api.backendless.com"
    },
    "apiUrl": "https://api.backendless.com",
    "repoPath": "/var/lib/backendless/repo/",
    "apiServer": "https://api.backendless.com"
  },
  "app": {
    "id": "A391CEB9-8C46-C3E2-FFF9-51E251BCF100",
    "apiKey": "[HIDDEN]",
    "exclude": [
      "+(git|.idea|lib|test|docs|bin|deploy)/**",
      "+(LICENSE|*.md|*.json|.*)",
      "node_modules/**",
      "examples/services/wsdl-proxy/**"
    ],
    "model": "default"
  },
  "sandbox": false,
  "verbose": false,
  "debug": false,
  "compression": {
    "debug": false,
    "prod": false,
    "threshold": 8192
  },
  "loggers": {
    "workers": true,
    "managementServer": false,
    "console": true,
    "file": false,
    "backendless": true,
    "maxTextLength": 5000,
    "levels": {
      "default": "info",
      "Status": "",
      "Server": ""
    }
  },
  "rateLimit": {
    "default": 10,
    "enabled": false,
    "overrides": {}
  }
}
logger was created
11:24:07.541 [master] Starting Debug Code Runner...
11:24:07.541 [master] Building Model..
11:24:08.483 [master] ServerCode Model built in 942ms
11:24:08.483 [master] Custom Types (5):
11:24:08.484 [master]   EpilepsyDiscussionComment (models\EpilepsyDiscussionComment.js)
11:24:08.484 [master]   EpilepsyDocRating (models\EpilepsyDocRating.js)
11:24:08.485 [master]   EpilepsyDocReview (models\EpilepsyDocReview.js)
11:24:08.485 [master]   EpilepsyDiscussionCommentUpvote (models\EpilepsyDiscussionCommentUpvote.js)
11:24:08.486 [master]   EpilepsyDocReviewUpvote (models\EpilepsyDocReviewUpvote.js)
11:24:08.486 [master] Services (4):
11:24:08.487 [master]   EpilepsyAnalyticsWebService (services\EpilepsyAnalyticsWebService.js)
11:24:08.487 [master]   EpilepsyDatingWebService (services\EpilepsyDatingWebService.js)
11:24:08.487 [master]   EpilepsyJournalWebService (services\EpilepsyJournalWebService.js)
11:24:08.488 [master]   EpilepsyWebService (services\EpilepsyWebService.js)
11:24:08.488 [master] Connection to Redis...
11:24:08.596 [master] new client [Redis:setter] was connected in 106ms
11:24:08.602 [master] new client [Redis:subscriber] was connected in 112ms
11:24:08.603 [master] new client [Redis:getter_1] was connected in 113ms
11:24:08.604 [master] Connection with Redis has been established
11:24:08.605 [master] Registering Code Runner on https://api.backendless.com

After about 10 minutes it displays this:
`11:34:08.766 [master] Unable to register Runner.

504 Gateway Time-out

504 Gateway Time-out


nginx

Waiting for the debugger to disconnect…

Process finished with exit code 0

I just checked on my project, and CodeRunner started without any issues.

It might be related to the Node.js versions you’re attempting to use.
Which specific versions have you tried?

Also, I’d like to try running CodeRunner with your logic.
Would I be able to do that?

Regards,
Alexander

I found another thread on this forum where someone had a similar problem and they said to use Node v14 as a workaround. So I’m currently running Node 14.8.2. I’ve also tried 20.11.0 and 16.0.0. What version of Code Runner should I be using?

You can run Code Runner with my logic. How can you do that?

Thank you for provided information.

I just tested CodeRunner with your logic and also started successfully.
I used Node 18 and recommend you use it as well for running CodeRunner in the future.

The problem might be related to the version of CodeRunner.
Could you check which version you have installed (in node_modules)?

Regards,
Alexander

Thanks. Here is my new setup:

image

My new error is now this:

15:14:36.146 [master] Starting Debug Code Runner...
15:14:36.146 [master] Building Model..
15:14:36.987 [master] ServerCode Model built in 841ms
15:14:36.988 [master] Custom Types (5):
15:14:36.989 [master]   EpilepsyDiscussionComment (models\EpilepsyDiscussionComment.js)
15:14:36.989 [master]   EpilepsyDocRating (models\EpilepsyDocRating.js)
15:14:36.990 [master]   EpilepsyDocReview (models\EpilepsyDocReview.js)
15:14:36.990 [master]   EpilepsyDiscussionCommentUpvote (models\EpilepsyDiscussionCommentUpvote.js)
15:14:36.991 [master]   EpilepsyDocReviewUpvote (models\EpilepsyDocReviewUpvote.js)
15:14:36.991 [master] Services (4):
15:14:36.992 [master]   EpilepsyAnalyticsWebService (services\EpilepsyAnalyticsWebService.js)
15:14:36.992 [master]   EpilepsyDatingWebService (services\EpilepsyDatingWebService.js)
15:14:36.993 [master]   EpilepsyJournalWebService (services\EpilepsyJournalWebService.js)
15:14:36.993 [master]   EpilepsyWebService (services\EpilepsyWebService.js)
15:14:37.016 [master] Registering Code Runner on https://api.backendless.com
Debugger listening on ws://127
0.0.1:64254/b1fe7b67-4cd6-4359-8adc-7c9b3a7a04d3
For help, see: https://nodejs.org/en/docs/inspector
Debugger listening on ws://127.0.0.1:64256/9c3163b5-1a23-47fe-b48e-e279abecb0d5
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger listening on ws://127.0.0.1:64258/e321d315-a686-43c3-81c6-0100a83f6c7c
For help, see: https://nodejs.org/en/docs/inspector
Debugger listening on ws
//127.0.0.1:64259/7c3fe8bd-5112-480b-8b87-e78cdfd74b62
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger attached.
Debugger attached.
15:14:37.359 [master] [11692] Worker started in 357.765ms
15:14:37.362 [master] [20156] Worker started in 367.063ms
15:14:37.374 [master] [20656] Worker started in 368.523ms
15:14:37.375 [master] [18628] Worker started in 364.092ms
15:24:37.207 [master] Unable to register Runner. <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

15:24:37.208 [master] Wait until each worker finished processing its current task
15:24:37.209 [master] remains 0 busy workers
15:24:37.209 [master] pull of the busy workers is empty

Thank you, this is very useful information.
I need a bit more time to conduct some checks.
I’ll let you know as soon as I have more information.

Regards,
Alexander

I was finally able to reproduce the issue on my end and have created a ticket to resolve it.
We will update you with new information in this thread as soon as it becomes available.
We apologize for the inconvenience.

Regards,
Alexander

hello @Phil1

we have fixed the issue, could you check it please

Thank you. I see the debug service in the cloud code console, now, and I can make the call and step through my code. However, the console never seems to receive the response from my call. It constantly spins like this screenshot:

Hello, @Phil1.

All requests in our test application go through without problems. Please make sure there are no errors in your code.

Regards, Nikita.

Thank you. Everything seems to be working now.

1 Like