You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/07/20 22:20:28 UTC
[GitHub] mrutkows opened a new issue #297: supplying "type" key-value in Action in manifest causes Nil pointer exception
mrutkows opened a new issue #297: supplying "type" key-value in Action in manifest causes Nil pointer exception
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/297
Run the following wskdeploy use case, using this command:
```
go run main.go -m tests/usecases/alarmtrigger/manifest.yaml
```
you get this stacktrace:
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x100 pc=0x133e51e]
goroutine 1 [running]:
github.com/apache/incubator-openwhisk-wskdeploy/utils.GetEnvVar(0x0, 0x0, 0x100abc3, 0xc4200f9538)
/Users/Matt/go/src/github.com/apache/incubator-openwhisk-wskdeploy/utils/misc.go:136 +0x5e
github.com/apache/incubator-openwhisk-wskdeploy/parsers.ResolveParameter(0xc4200f95f8, 0xc42019c990, 0xc4200f9538)
/Users/Matt/go/src/github.com/apache/incubator-openwhisk-wskdeploy/parsers/manifest_parser.go:408 +0x3c
github.com/apache/incubator-openwhisk-wskdeploy/parsers.(*YAMLParser).ComposeActions(0xc420125480, 0xc4201ca000, 0x7fff5fbffb53, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/Matt/go/src/github.com/apache/incubator-openwhisk-wskdeploy/parsers/manifest_parser.go:287 +0x813
github.com/apache/incubator-openwhisk-wskdeploy/deployers.(*ManifestReader).HandleYaml(0xc4200f9980, 0xc4201583f0, 0xc420125480, 0xc4201ca000, 0x0, 0x0)
/Users/Matt/go/src/github.com/apache/incubator-openwhisk-wskdeploy/deployers/manifestreader.go:65 +0xb2
github.com/apache/incubator-openwhisk-wskdeploy/deployers.(*ServiceDeployer).ConstructDeploymentPlan(0xc4201583f0, 0x15, 0xc42012e9c0)
/Users/Matt/go/src/github.com/apache/incubator-openwhisk-wskdeploy/deployers/servicedeployer.go:131 +0x116
github.com/apache/incubator-openwhisk-wskdeploy/cmdImp.Deploy(0x0, 0x14f48d4, 0x1, 0x7fff5fbffb53, 0x29, 0xc42012e9c0, 0x52, 0x100, 0xc4201581b0, 0x14f5466)
/Users/Matt/go/src/github.com/apache/incubator-openwhisk-wskdeploy/cmdImp/rootImp.go:103 +0x842
github.com/apache/incubator-openwhisk-wskdeploy/cmd.RootCmdImp(0x173e980, 0xc420124ec0, 0x0, 0x2)
```
/Users/Matt/go/src/github.com/apache/incubator-openwhisk-wskdeploy/cmd/root.go:58 +0xe7
github.com/spf13/cobra.(*Command).execute(0x173e980, 0xc4200101f0, 0x2, 0x2, 0x173e980, 0xc4200101f0)
```
It appears that the parser does not like when an input parameter and its type is not defined on a single line:
For example, this version of the alarmtest manifest does not work (commented out all but failing grammar), which by default defines the "type" on a separate line:
```
package:
name: helloworldx
actions:
helloworld:
location: actions/hello.js
runtime: nodejs:6
inputs:
name:
type: string
# description: name of a person
# place: string
# type: string
#
# remainder of the manifest file commented out, showing the error is the Action's input section.
```
However, if we alter the manifest to instead provide the type value one one line, as follows it works!
```
package:
name: helloworldx
actions:
helloworld:
location: actions/hello.js
runtime: nodejs:6
inputs:
name: string
# type: string
# remained of manifest commented out
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services