Skip to content
This repository was archived by the owner on Mar 11, 2020. It is now read-only.
This repository was archived by the owner on Mar 11, 2020. It is now read-only.

Concurrency error when using wskdebug with IBM Cloud Functions #30

@upkarlidder

Description

@upkarlidder

Version

wskdebug --version
1.0.10

Description

I am trying to use wskdebug with IBM Cloud Functions.

Step 1: My action is very simple

function main(args) {
  if (args && args.name) {
    console.log(`hello ${args.name}`);
    return { msg: `hello ${args.name}` };
  } else {
    console.log(`hello world`);
    return { msg: `hello world` };
  }
}

Step 2: Created the action on IBM Cloud

ibmcloud fn action create hello-debug index.js

Step 3: started wskdebug

I get an error when it tried to create the temporary Agent action. I don’t need the LiveReload support.

Error

$ wskdebug hello-debug index.js -v
Starting debugger for /_/hello-debug
Starting local debug container wskdebug-hello-debug-1573772149542
docker run -d --name wskdebug-hello-debug-1573772149542 --rm -m 268435456 -p 8080 -p 9229:9229 -v "/Users/ulidder/Documents/icloud-documents/code-upkar/temp/openwhisk/simple:/code" ibmfunctions/action-nodejs-v10:1.13.0 node --expose-gc --inspect=0.0.0.0:9229 app.js
cf95f1d200e860c91aa179ef40f747c0065b998a2acbe1b914c18c33f4db36f9
Mounting sources onto local debug container: /Users/ulidder/Documents/icloud-documents/code-upkar/temp/openwhisk/simple/index.js
2019-11-14T22:55:50.728771670Z Debugger listening on ws://0.0.0.0:9229/5c06b464-72f7-45a4-b0f8-0c74fc9deaf2
2019-11-14T22:55:50.728824972Z For help, see: https://nodejs.org/en/docs/inspector
Installing agent in OpenWhisk (concurrency)...
Original action backed up at hello-debug_wskdebug_original.
{ OpenWhiskError: PUT https://us-south.functions.cloud.ibm.com/api/v1/namespaces/_/actions/hello-debug?overwrite=true Returned HTTP 400 (Bad Request) --> "The request content was malformed:
requirement failed: concurrency 200 exceeds allowed threshold of 1"
    at Client.handleErrors (/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/openwhisk/lib/client.js:216:11)
    at params.then.catch.err (/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/openwhisk/lib/client.js:147:58)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
  name: 'OpenWhiskError',
  message:
   'PUT https://us-south.functions.cloud.ibm.com/api/v1/namespaces/_/actions/hello-debug?overwrite=true Returned HTTP 400 (Bad Request) --> "The request content was malformed:\nrequirement failed: concurrency 200 exceeds allowed threshold of 1"',
  error:
   { code: 'df940ccf1d076f103c3743685c25d2b2',
     error:
      'The request content was malformed:\nrequirement failed: concurrency 200 exceeds allowed threshold of 1' },
  statusCode: 400 }

Restoring action

Workaround by @alexkli

It should normally automatically pick a different agent that does not require the concurrency feature, but I guess that detection is not perfect yet (it looks at the swagger api docs and maybe the ibm cloud has different information in there).
As alternative, you can try the ngrok option using --ngrok. It should just work - you don’t even need an ngrok.com account.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions