If forge manifest is too large it causes deployment to fail with ambiguous error at "Release CaaS manifest" step

XMLWordPrintable

    • Severity 3 - Minor
    • Scale & Infra

      Issue Summary:

      During deployment of a Forge app it goes though enrichment/conversation process. If converted manifest is exceeds the size limit of 257634 bytes, deployment fails at the step  "Release CaaS manifest" with 500 Internal server error.

      This can happen, especially, if the manifest has lots of functions defined (approx. 40 functions)

      Steps to Reproduce

      1. Create a Forge application and define many functions in the manifest - at least 40
      2. deploy the forge application with "forge deploy --verbose" command

      Expected Results

      The deployment should be successful, or a proper error message should be returned explaining that the manifest size is too large.

      Actual Results

      The below exception is thrown in the cli response:

      Step: "Release CaaS manifest"
      Status: FAILED
      Error: App environment update failed
      Validation errors: {
      "extensions": {
      "errorType": "INTERNAL_SERVER_ERROR",
      "statusCode": 500
      }
      } 

      Workaround

      The workaround is to reduce the converted manifest size. In the case of many functions, we can reduce the function count in manifest by re-using them. For example, we can have one function for many rovo:action

       

      modules:
        action:
          - key: create-issue-action
            function: sharedActionHandler  # Shared function
          - key: update-issue-action
            function: sharedActionHandler  # Same function reused
        function:
          - key: sharedActionHandler
            handler: index.run 

      Then the run method can check moduleKey and run separate logic for each, like this 

      export function run(payload) {
          const { moduleKey } = payload.context;
          // Check which action was invoked
          switch(moduleKey) {
              case 'create-issue-action':
                  return handleCreateIssue(payload);
              case 'update-issue-action':
                  return handleUpdateIssue(payload);
              default:
                  return `Unknown action: ${moduleKey}`;
          }
      } 

       

              Assignee:
              Vihaan Kaura (Inactive)
              Reporter:
              Nashid Farhad
              Votes:
              7 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: