Timeouts on Cloud Code

Hi Mark, & Others,

We are having a timeout issue (Taking more than 5 seconds) to complete a codeless workflow.
Backendless ID: daringstation.backendless.app
Application ID: 95A7052A-F382-C6E0-FFE0-42956AFC8300
The workflow can be accessed via https://daringstation.backendless.app/api/services/NEW_Campaign/PUT_QuestionListQuestion

We are having timeout issues with the above API call.

Here is the log dump

7:25:39.626 | SERVER_CODE | INFO | [94003] Building ServerCode Model for path (/opt/backendless/repo/95a7052a-f382-c6e0-ffe0-42956afc8300/files/servercode/CODELESS/NEW_Campaign/PRODUCTION)
7:25:39.628 | SERVER_CODE | INFO | [94003] ServerCode Model built in 9ms
7:25:39.632 | SERVER_CODE | INFO | [94003] [09B27AC2-2B7B-9ED6-FF9D-50CE19AE1100] [INVOKE SERVICE] services.NEW_Campaign.POST_NACE_Codes
7:25:39.637 | SERVER_CODE | INFO | [94003] get current NACE codes
7:25:39.747 | SERVER_CODE | INFO | [94003] split list into actual list type
7:25:39.748 | SERVER_CODE | INFO | [94003] check each NACE code
7:25:39.748 | SERVER_CODE | INFO | [94003] NACE code does exist so we add relation
7:25:39.749 | SERVER_CODE | INFO | [94003] Processing finished in 139.266ms
7:25:38.998 | SERVER_CODE | INFO | [94693] Building ServerCode Model for path (/opt/backendless/repo/95a7052a-f382-c6e0-ffe0-42956afc8300/files/servercode/CODELESS/NEW_Campaign/PRODUCTION)
7:25:38.999 | SERVER_CODE | INFO | [94693] ServerCode Model built in 7ms
7:25:39.4 | SERVER_CODE | INFO | [94693] [DF82D779-1755-8EE3-FF32-14CD2EF58D00] [INVOKE SERVICE] services.NEW_Campaign.POST_Campaign
7:25:39.10 | SERVER_CODE | INFO | [94693] START POST_CAMPAIGN
7:25:39.10 | SERVER_CODE | INFO | [94693] Create a Campaign
7:25:39.130 | SERVER_CODE | INFO | [94693] Relations Campaign <> Fund
7:25:39.233 | SERVER_CODE | INFO | [94693] Relations Campaign <> Company
7:25:39.414 | SERVER_CODE | INFO | [94693] Relations Campaign <> Partner
7:25:39.575 | SERVER_CODE | INFO | [94693] Run NACE Codes
7:25:39.751 | SERVER_CODE | INFO | [94693] Create Questionnaire
7:25:39.919 | SERVER_CODE | INFO | [94174] Building ServerCode Model for path (/opt/backendless/repo/95a7052a-f382-c6e0-ffe0-42956afc8300/files/servercode/CODELESS/NEW_Campaign/PRODUCTION)
7:25:39.921 | SERVER_CODE | INFO | [94174] ServerCode Model built in 7ms
7:25:39.925 | SERVER_CODE | INFO | [94174] [3648219F-D872-2E1C-FFC0-57600F110100] [INVOKE SERVICE] services.NEW_Campaign.PUT_CampaignQuestionnaire
7:25:39.928 | SERVER_CODE | INFO | [94174] START PUT_CAMPAIGNQUESTIONIONNAIRE
7:25:40.25 | SERVER_CODE | INFO | [94174] Campaign <> Questionnaire
7:25:40.91 | SERVER_CODE | INFO | [94174] Questionnaire <> Campaign
7:25:40.91 | SERVER_CODE | INFO | [94174] Processing finished in 188.600ms
7:25:40.490 | SERVER_CODE | INFO | [94185] Building ServerCode Model for path (/opt/backendless/repo/95a7052a-f382-c6e0-ffe0-42956afc8300/files/servercode/CODELESS/NEW_Campaign/PRODUCTION)
7:25:40.492 | SERVER_CODE | INFO | [94185] ServerCode Model built in 7ms
7:25:40.494 | SERVER_CODE | INFO | [94185] [483D0178-3B7B-B350-FF86-7FC9D6C18700] [INVOKE SERVICE] services.NEW_Campaign.GET_Question
7:25:40.498 | SERVER_CODE | INFO | [94185] START GET_QUESTION
7:25:40.607 | SERVER_CODE | INFO | [94185] 100
7:25:40.608 | SERVER_CODE | INFO | [94185] Processing finished in 132.197ms
7:25:39.790 | SERVER_CODE | INFO | [94704] Building ServerCode Model for path (/opt/backendless/repo/95a7052a-f382-c6e0-ffe0-42956afc8300/files/servercode/CODELESS/NEW_Campaign/PRODUCTION)
7:25:39.792 | SERVER_CODE | INFO | [94704] ServerCode Model built in 7ms
7:25:39.794 | SERVER_CODE | INFO | [94704] [32A60A01-6150-3EDA-FF58-537B04C55600] [INVOKE SERVICE] services.NEW_Campaign.POST_Questionnaire
7:25:39.798 | SERVER_CODE | INFO | [94704] START POST_QUESTIONNAIRE
7:25:39.879 | SERVER_CODE | INFO | [94704] Questionnaire Created
7:25:39.879 | SERVER_CODE | INFO | [94704] CampaignQuestionnaireRelations
7:25:40.94 | SERVER_CODE | INFO | [94704] CreateQuestionList
7:25:40.165 | SERVER_CODE | INFO | [94014] Building ServerCode Model for path (/opt/backendless/repo/95a7052a-f382-c6e0-ffe0-42956afc8300/files/servercode/CODELESS/NEW_Campaign/PRODUCTION)
7:25:40.167 | SERVER_CODE | INFO | [94014] ServerCode Model built in 7ms
7:25:40.170 | SERVER_CODE | INFO | [94014] [3023A2A5-495C-BAB5-FF7D-E64C822FDE00] [INVOKE SERVICE] services.NEW_Campaign.POST_QuestionList
7:25:40.175 | SERVER_CODE | INFO | [94014] START POST_QUESTIONLIST
7:25:40.431 | SERVER_CODE | INFO | [94715] Building ServerCode Model for path (/opt/backendless/repo/95a7052a-f382-c6e0-ffe0-42956afc8300/files/servercode/CODELESS/NEW_Campaign/PRODUCTION)
7:25:40.433 | SERVER_CODE | INFO | [94715] ServerCode Model built in 7ms
7:25:40.435 | SERVER_CODE | INFO | [94715] [97FD0F48-59E1-FF2F-FF11-017B764D8800] [INVOKE SERVICE] services.NEW_Campaign.PUT_QuestionListQuestion
7:25:40.439 | SERVER_CODE | INFO | [94715] START PUT_QUESTIONLISTQUESTION
7:25:44.8 | SERVER_CODE | ERROR | [94693] Task execution is aborted due to timeout
7:25:44.8 | SERVER_CODE | INFO | [94693] Processing finished in 5025.627ms
7:25:44.796 | SERVER_CODE | ERROR | [94704] Task execution is aborted due to timeout
7:25:44.797 | SERVER_CODE | INFO | [94704] Processing finished in 5018.754ms
7:25:45.171 | SERVER_CODE | ERROR | [94014] Task execution is aborted due to timeout
7:25:45.172 | SERVER_CODE | INFO | [94014] Processing finished in 5020.348ms
7:25:45.435 | SERVER_CODE | ERROR | [94715] Task execution is aborted due to timeout
7:25:45.436 | SERVER_CODE | INFO | [94715] Processing finished in 5137.444ms

Please let us know what we are doing wrong and how we can fix this issue going forward. i was hoping the scale plan would be the solution but think i still need to optimze the DB.

Thanks!

1 Like

Hi @Invited4

The problem is related to the script/code execution time limit, which is 5 sec for Cloud 9 plan. Logic takes more time to execute, so an error occurs when the limit is reached:

Task execution is aborted due to timeout

I can suggest the following:

  • Reduce the logic so that it executes in 5 sec.
  • Increase the logic execution limit by purchasing the “Enhanced Script/Code Execution Time (20 sec)” package from the marketplace.

Regards,
Marina