apache / openwhisk-wskdeploy

Apache OpenWhisk utility for deploying and managing OpenWhisk projects and packages
https://openwhisk.apache.org/
Apache License 2.0
77 stars 74 forks source link

Unable to deploy simple API with error msg_config_missing_apigw_access_token #1037

Open huksley opened 5 years ago

huksley commented 5 years ago

OS: Linux Ubuntu 18.04 OpenWhisk deployed to docker using devtools compose setup

I've tried using latest and 0.9.9 version of deploy

I've created simple manifest myservice.yaml

wskdeploy -m myservice.yaml -s -v
Info: deploy using deployment file []...

Info: Configuration:
      > ApiHost: []
      > Auth: []
      > Namespace: []
      > ApiVersion: []
      > CfgFile: [/home/user/.wskprops]
      > CliVersion: [0.9.9]
      > ProjectPath: [.]
      > DeploymentPath: []
      > ManifestPath: [myservice.yaml]
      > Preview: [false]
      > Strict: [true]
      > Key: []
      > Cert: []
      > Managed: [false]
      > ProjectName: []
      > ApigwAccessToken: []
      > Verbose: [true]
      > Trace: [false]
      > Sync: [false]
      > Report: [false]
      > Param: [[]]
      > ParamFile: []

Info: The API host is [https://10.6.3.137], from .wskprops.
Info: The auth key is set, from .wskprops.
Info: The namespace is [_], from .wskprops.
Info: Unmarshal OpenWhisk runtimes from local values.
Warning: open /home/travis/gopath/src/github.com/apache/incubator-openwhisk-wskdeploy/runtimes/runtimes.json: no such file or directory
Warning: [testapi1] is marked as public in manifest file, it will be visible and can be accessed by anyone
Error: manifestreader.go [113]: [ERROR_YAML_FILE_FORMAT_ERROR]: File: [myservice.yaml]: 
==> manifest_parser.go [1154]: [ERROR_WHISK_CLIENT_INVALID_CONFIG]: msg_config_missing_apigw_access_token
> user@machine:~$ cat .wskprops
AUTH=deadbeef:deadbeef
APIHOST=https://10.6.3.137
zach-herridge commented 5 years ago

I'm having the same problem no my digital ocean managed Kubernetes deployment.

mrutkows commented 5 years ago

@huksley @ZachHerridge There is not error in wskdeploy; it is merely reporting that your .wskprops appears to be missing a key/value for APIGW_ACCESS_TOKEN. Not sure what the devtools' Compose installation should set for this value. I would recommend asking in either the project's Slack channel (general, or apigateway) asking what value should be set and/or how apigw should be properly configured in wskprops. In the meantime, you could try using the Kube deployment which is preferred and current or try IBM Cloud Functions which should also work.

mrutkows commented 5 years ago

Seeing that your .wsprops file is very sparse... I would also ask if you have followed the CLI setup instructions: https://github.com/apache/openwhisk/blob/master/docs/cli.md

and also to see what server-side errors you might get... be sure to add a key APIGW_ACCESS_TOKEN to .wskprops if it does not exist (with a empty value if needed) so that wskdeploy will call the Whisk client which may produce further information (error or otherwise) and if it passes the call to the server, perhaps more (error) info.

mrutkows commented 5 years ago

@huksley @ZachHerridge For our testing (in Travis), we assume that the key APIGW_ACCESS_TOKEN is the default for the "guest" account and has a known value of "DUMMY TOKEN". This is NOT well documented and I intend to correct that (in multiple places). Typically, it is assumed that you have installed the CLI, performed a manual api list command and it (as a side effect) would generate the key/value for you in .wskprops...

See:https://github.com/apache/openwhisk-wskdeploy/blob/master/deployers/whiskclient.go

mrutkows commented 5 years ago

Additionally, I would note that the "sequence:" key is not supported under the "api:" key of the manifest.yaml file... it is assumed that you defined an action sequence elsewhere, name it and reference that name when creating your API endpoint (and I will fix that documentation). Please see the 2 integration tests for API gateway for definitive examples here: https://github.com/apache/openwhisk-wskdeploy/tree/master/tests/src/integration/apigateway

mrutkows commented 5 years ago

Please also see fix was merged to supply a "DUMMY TOKEN" with this PR: https://github.com/apache/openwhisk-wskdeploy/pull/1057

which was merged into the 1.0.0 release: https://github.com/apache/openwhisk-wskdeploy/releases/tag/1.0.0