2020-01-16 09:59:06 UTC - Victor Lombardi: It worked but it's in unicode https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579168746138400?thread_ts=1579093865.136800&cid=C3TPCAQG1 ---- 2020-01-16 09:59:40 UTC - Victor Lombardi: It's not possible to do like that : *return response* where response is the binary file returned from the API https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579168780138600?thread_ts=1579093865.136800&cid=C3TPCAQG1 ---- 2020-01-16 11:17:55 UTC - Victor Lombardi: I got this error : https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579173475138800?thread_ts=1579093865.136800&cid=C3TPCAQG1 ---- 2020-01-16 11:17:57 UTC - Victor Lombardi: Response type in header did not match generated content type. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579173477139000?thread_ts=1579093865.136800&cid=C3TPCAQG1 ---- 2020-01-16 15:17:41 UTC - Bilal: Looks to me like your code is returning the _response object_ which wouldn't work. You need to return a dictionary/json.
If you're using the requests module you can call `response.json()` but if you are getting raw binary/bytes from your API, then you should just be able to return the bytes string. `{'data': bytes_string}` If you are trying to return a file, then you need to encode it as a string, maybe base64. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579187861139400?thread_ts=1579093865.136800&cid=C3TPCAQG1 ---- 2020-01-16 15:39:52 UTC - Bilal: So when setting up something on openwhisk to consume incoming webhooks according to this <https://github.com/apache/openwhisk/issues/3558> my options are to either 1. Tell the webhook provider my openwhisk auth (which doesn't work for many/seems like it could expose auth needlessly) 2. Create a web-action that fires a trigger (using auth) passing payload to business logic action 3. Create a web-action that async calls my business logic web action Am I missing an option? Reasoning is that webhook providers want a quick callback, like a 202 accepted. I was initially trying to make a trigger public. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579189192140500 ---- 2020-01-16 16:29:11 UTC - Tom Barber: Alrighty https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192151141000 ---- 2020-01-16 16:29:15 UTC - Tom Barber: day of random questions https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192155141300 ---- 2020-01-16 16:29:24 UTC - Tom Barber: that I should probably know the answer to.... https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192164141700 ---- 2020-01-16 16:29:25 UTC - Tom Barber: first up https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192165141900 ---- 2020-01-16 16:29:28 UTC - Tom Barber: ```Activation: 'pixlize-serverless-dev-testShort' (d686213c4b834c2686213c4b832c2638) [ "2020-01-16T16:28:05.837Z stderr: The action did not initialize or run as expected. Log data might be missing." ]``` https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192168142100?thread_ts=1579192168.142100&cid=C3TPCAQG1 ---- 2020-01-16 16:29:39 UTC - Tom Barber: OW on k8s https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192179142400 ---- 2020-01-16 16:29:52 UTC - Tom Barber: what can I do to find out more about why it didn't initialize or run https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192192142900 ---- 2020-01-16 16:29:55 UTC - Tom Barber: ? https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579192195143100 ---- 2020-01-16 16:43:43 UTC - Tom Barber: second question: just checking my pattern for non-blocking calls: ```def shortAction(params): action = 'pixlize-serverless-dev-testLong' host = os.environ.get('__OW_API_HOST') ns = os.environ.get('__OW_NAMESPACE') key = os.environ.get('__OW_API_KEY') url = host + '/api/v1/namespaces/' + ns + '/actions/' + action p = {} response = <http://requests.post|requests.post>(url, json=p, verify=False, params={'blocking': 'false'}, auth=(key.split(':')[0], key.split(':')[1])) return {"greeting": response.text} def longAction(params): time.sleep(10) return {"long greeting": "helllllooooo there"}``` does that look about right? It runs, just checking its sane https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579193023144000?thread_ts=1579193023.144000&cid=C3TPCAQG1 ---- 2020-01-16 16:46:44 UTC - giusdp: Hey there, is there a way for the invoker to know the IP or name of the node where it was launched on? https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579193204145300 ---- 2020-01-16 17:17:09 UTC - Bilal: I'm newish to Openwhisk but you might check the logs of the invoker. But anytime I encountered that error it was of type "developer error" aka I wrote some bad code. :sweat_smile: I f that's the only message you are getting, then probably has to do with inputs/return value. Make sure you are inputting JSON/dict and are producing JSON/dict. I'm using the default of openwhisk-deploy-kube repo, and it might be useful to look at invoker logs. `kubectl -n openwhisk logs owdev-invoker-0` https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195029145400?thread_ts=1579192168.142100&cid=C3TPCAQG1 ---- 2020-01-16 17:20:17 UTC - Bilal: Runs locally or on openwhisk? As far as I know trying to access env variables in an action doesn't go so well. You can pass default params as a way of passing in secrets/auth. Or manifest.yaml via wskdeploy can read env variables and set those as default params <https://github.com/apache/openwhisk-wskdeploy/blob/master/docs/wskdeploy_action_env_var_parms.md#actions> https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195217145600?thread_ts=1579193023.144000&cid=C3TPCAQG1 ---- 2020-01-16 17:20:59 UTC - Tom Barber: Thanks @Bilal it was the json output that was at fault. Just wondered if there was a more useful error somewhere :slightly_smiling_face: I'll look in those logs as well.. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195259145800?thread_ts=1579192168.142100&cid=C3TPCAQG1 ---- 2020-01-16 17:22:19 UTC - Bilal: Glad to help! I have gotten that error _many *many*_ times while messing around with openwhisk and that was almost always the issue. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195339146000?thread_ts=1579192168.142100&cid=C3TPCAQG1 ---- 2020-01-16 17:24:07 UTC - Bilal: also, calling `wsk -i activation result <activation_id>` or use the `--last` flag instead of activation_id, it'll say something like "action did not return a dictionary" https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195447146200?thread_ts=1579192168.142100&cid=C3TPCAQG1 ---- 2020-01-16 17:24:56 UTC - Tom Barber: oooh https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195496146400?thread_ts=1579192168.142100&cid=C3TPCAQG1 ---- 2020-01-16 17:30:13 UTC - Tom Barber: It runs fine in openwhisk. Me and @Rodric Rabbah we're discussing blocking vs non blocking actions a couple of months ago. So shortAction calls longAction and returns an ID which you can then look up to see its progress on another API call. those env vars seem fine, and it calls the other action. I was just checking for sanity reasons :slightly_smiling_face: https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195813146600?thread_ts=1579193023.144000&cid=C3TPCAQG1 ---- 2020-01-16 17:31:29 UTC - Bilal: Nice, how did you pass those env vars to openwhisk? https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579195889146800?thread_ts=1579193023.144000&cid=C3TPCAQG1 ---- 2020-01-16 17:34:14 UTC - Tom Barber: I think they're just magic vars that exist https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579196054147000?thread_ts=1579193023.144000&cid=C3TPCAQG1 ---- 2020-01-16 18:03:55 UTC - Bilal: Neat, I just did a quick test and looks like there's quite a few env vars. All the ports to internal stuff like: kube, couchDB, nginx, redis, Also contains __OW_ACTIVATION_ID too https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579197835147200?thread_ts=1579193023.144000&cid=C3TPCAQG1 ---- 2020-01-16 18:23:19 UTC - Tom Barber: Woop, custom Docker action running..... someone said a few months ago, you could actually use a Private Docker Repo... has anyone got any details on that because on the action page it says it has to be public on dockerhub https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579198999148100?thread_ts=1579198999.148100&cid=C3TPCAQG1 ---- 2020-01-16 18:34:13 UTC - Bilal: I too am also interested in using a private docker registry. Mostly I use the docker images when I have multiple actions that all need a similar/same set of python packages. Seemed easier than renaming all my actionsn to `__main__.py` and zipping each one individually. So not too big of a deal to have that up on dockerhub. <https://github.com/apache/openwhisk/issues/3024> Still open but no activity. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579199653148200?thread_ts=1579198999.148100&cid=C3TPCAQG1 ---- 2020-01-16 18:36:43 UTC - Tom Barber: Oh I did get sent a reply to my question... says you can set the configs in: <https://github.com/apache/openwhisk/blob/master/ansible/roles/invoker/tasks/deploy.yml#L245-L246> for ansible. Just gotta figure out how to port that to helm or something I guess https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579199803148500?thread_ts=1579198999.148100&cid=C3TPCAQG1 ---- 2020-01-16 18:57:39 UTC - Bilal: <https://github.com/apache/openwhisk/pull/4791> <https://github.com/apache/openwhisk-deploy-kube/issues/528> Did some poking around b/c I'm interested in both private docker and deploying on kube. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579201059148700?thread_ts=1579198999.148100&cid=C3TPCAQG1 ---- 2020-01-16 19:07:01 UTC - Tom Barber: hmm yeah, not straightforward yet then. Shame you can't provide an imageSecret manually or something then have it appended to the PodSpec https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1579201621148900?thread_ts=1579198999.148100&cid=C3TPCAQG1 ----