apache / openwhisk-package-pushnotifications

OpenWhisk Package for Bluemix Push Notifications Service
Apache License 2.0
10 stars 17 forks source link

Calling the push action from the UI produces error #53

Closed nwspeete-ibm closed 7 years ago

nwspeete-ibm commented 7 years ago

From a whisk UI user: "From the Develop Console I hit Browse Public Packages, hit the Mobile Push tile, clicked the + New Binding hexagon on the left, added my push credentials from Bluemix and saved the config, then selected the binding and hit run this action, added my values (text message content and appId) and hit run with this value." Result: "The action did not produce a valid response and exited unexpectedly."

Then from CLI the user sees: ""version": "0.0.34", "response": { "result": { "error": "Internal system error: container not ready." }, "success": false, "status": "action developer error" },". I reproduced this same error with their credentials.

nwspeete-ibm commented 7 years ago

From the UI I see : 2016-11-14T20:36:17.014800028Z stdout: No target set, broadcasting message to all registered devices 2016-11-14T20:36:17.180700833Z stderr: undefined:1 2016-11-14T20:36:17.180726811Z stderr: Error 401: Requires a valid appSecret header 2016-11-14T20:36:17.180735431Z stderr: ^ 2016-11-14T20:36:17.180742081Z stderr: 2016-11-14T20:36:17.180748893Z stderr: SyntaxError: Unexpected token E in JSON at position 0 2016-11-14T20:36:17.180755903Z stderr: at Object.parse (native) 2016-11-14T20:36:17.180762967Z stderr: at Request.eval [as _callback](eval at %28/nodejsAction/runner.js:79:29%29, :330:22) 2016-11-14T20:36:17.180772941Z stderr: at Request.self.callback (/nodejsAction/node_modules/request/request.js:200:22) 2016-11-14T20:36:17.180780422Z stderr: at emitTwo (events.js:106:13) 2016-11-14T20:36:17.180788378Z stderr: at Request.emit (events.js:191:7) 2016-11-14T20:36:17.180795608Z stderr: at Request. (/nodejsAction/node_modules/request/request.js:1067:10) 2016-11-14T20:36:17.180802871Z stderr: at emitOne (events.js:101:20) 2016-11-14T20:36:17.180809657Z stderr: at Request.emit (events.js:188:7) 2016-11-14T20:36:17.180816614Z stderr: at IncomingMessage. (/nodejsAction/node_modules/request/request.js:988:12) 2016-11-14T20:36:17.18082385Z stderr: at emitNone (events.js:91:20).

Not sure if that is a UI only issue or if it occurs in the CLI as well. Users report some success and sometimes failures from the CLI. My thought is that the Error 401: Requires a valid appSecret header is the issue. Maybe need to parse this correctly from the UI for the push package action code?

AnanthaKrish commented 7 years ago

Please provide a valid AppSecret . I have tried both UI and CLI and not able to reproduce the issue .

For CLI I followed this method,

  1. wsk package bind /whisk.system/pushnotifications myPushAction -p appId "myappID" -p appSecret "myappSecret"
  2. wsk action invoke /IMF_Push_kgspace/myPushAction/sendMessage --blocking --result -p url https://example.com -p text "this is my message"