0

I've deployed nodejs based IBM cloud function using manifest file. I'll have few other functions which may share some common codes. Here is the folder structure

manifest.yml
actions/
- myFunction1/
   -- index.js
   -- package.json
- myFunction2/
   -- index.js
   -- package.json
- common/
   -- utils.js

Here is my manifest.yml -

packages:
    myfunctions:
      version: 1.0
      license: Apache-2.0
      actions:
        myFunction1:
          function: actions/myFunction1
          runtime: nodejs:10
          include:
            - ["actions/common/*.js", "./common/"]          
        myFunction2:
          function: actions/myFunction2/index.js
          runtime: nodejs:10

I deployed the functions using following command from cmd-

ibmcloud fn deploy --manifest manifest.yml

The deployment went successful, both functions are created. Second function(myFunction2) executes properly but the first function throws error when try to execute. Here is the error message -

{
  "error": "Initialization has failed due to: There was an error uncompressing the action archive."
}

I even tried with the inclusion of the dependencies in manifest and codes but throws same error. I was following this article - https://medium.com/openwhisk/whisk-deploy-zip-actions-with-include-exclude-30ba6d96ad8b

Still struggling, appreciate any help.

Thanks Musa

data_henrik
  • 16,724
  • 2
  • 28
  • 49
Musa
  • 3,944
  • 4
  • 21
  • 27
  • How are the functions packed? If in a zip, show the output structure. – data_henrik May 22 '20 at 18:28
  • Hi Henrik, I didn't pack it explicitly but mentioned it in the manifest file. Openwhisk says - "When you specify a directory location in Whisk Deploy manifest file for function key under action, Whisk Deploy creates a zip file based on that directory and creates an action with that zip file for us so that we dont have to maintain a zip file in our file system." in this post - https://medium.com/openwhisk/whisk-deploy-zip-actions-abcc8c01ac4 – Musa May 22 '20 at 19:45

0 Answers0