TIBCOSoftware / flogo-cli

Project Flogo Command Line Interface
http://flogo.io
BSD 3-Clause "New" or "Revised" License
57 stars 28 forks source link

flogo build fails #49

Closed mellistibco closed 7 years ago

mellistibco commented 7 years ago

System: macOS. go version go1.8.1 darwin/amd64

When running flogo build without -sp the following error occurs. The build succeeds when running with -sp.

Matts-MacBook-Pro:deviceinfo mellis$ flogo build panic: invalid argument

goroutine 1 [running]: github.com/TIBCOSoftware/flogo-cli/util.RenderTemplate(0x1498400, 0x0, 0x13538f1, 0x4d, 0x12ccfa0, 0xc420179c20) /Users/mellis/go/src/github.com/TIBCOSoftware/flogo-cli/util/text.go:36 +0x22d github.com/TIBCOSoftware/flogo-cli/app.createImportsGoFile(0xc420012ec0, 0x37, 0xc4201790a0, 0x4, 0x4) /Users/mellis/go/src/github.com/TIBCOSoftware/flogo-cli/app/files.go:133 +0x123 github.com/TIBCOSoftware/flogo-cli/app.PrepareApp(0x149ebe0, 0xc420018300, 0xc4200c65e0, 0x0, 0x0) /Users/mellis/go/src/github.com/TIBCOSoftware/flogo-cli/app/api.go:141 +0x306 github.com/TIBCOSoftware/flogo-cli/app.BuildApp(0x149ebe0, 0xc420018300, 0xc42004de10, 0xc420018300, 0x2) /Users/mellis/go/src/github.com/TIBCOSoftware/flogo-cli/app/api.go:166 +0x21d github.com/TIBCOSoftware/flogo-cli/app.(*cmdBuild).Exec(0xc420011110, 0xc42000c220, 0x0, 0x0, 0x0, 0x0) /Users/mellis/go/src/github.com/TIBCOSoftware/flogo-cli/app/build.go:58 +0xf2 github.com/TIBCOSoftware/flogo-cli/cli.ExecCommand(0xc4200182a0, 0x149be40, 0xc420011110, 0xc42000c220, 0x0, 0x0, 0x0, 0x13444e8) /Users/mellis/go/src/github.com/TIBCOSoftware/flogo-cli/cli/command.go:114 +0xa9 main.main() /Users/mellis/go/src/github.com/TIBCOSoftware/flogo-cli/cmd/flogo/main.go:42 +0x122

wnichols commented 7 years ago

I would like to comment that almost all my builds fail with this error. I pulled the latest docker image (flogo designer) and created a hello world app and exported it. The exported json pasted below. If I attempt to build it I get a panic; invalid argument. However apps built by hand or with the cli do build. If you would like me to track down the specific difference between these json files is, just ask. I will have some time on the weekend. I would also like the error in this panic to be a little more informative if possible (though I think the argument in question is nil hence the problem)

The app:

{ "name": "HelloWorld", "type": "flogo:app", "version": "0.0.1", "description": "", "triggers": [ { "name": "Timer", "ref": "github.com/TIBCOSoftware/flogo-contrib/trigger/timer", "description": "Simple Timer trigger", "settings": {}, "id": "timer", "handlers": [ { "settings": { "repeating": "true", "notImmediate": "false", "startDate": null, "hours": null, "minutes": null, "seconds": "5" }, "actionId": "hello" } ] } ], "actions": [ { "name": "Hello", "data": { "flow": { "type": 1, "attributes": [], "rootTask": { "id": 1, "type": 1, "tasks": [ { "id": 2, "name": "Log Message", "description": "Simple Log Activity", "type": 1, "activityType": "github-com-tibco-software-flogo-contrib-activity-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "mary had a little lamb", "required": false, "type": "string" }, { "name": "flowInfo", "value": "false", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "false", "required": false, "type": "boolean" } ] } ], "links": [], "attributes": [] }, "errorHandlerTask": { "id": 3, "type": 1, "tasks": [ { "id": 4, "name": "Log Message (2)", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "", "required": false, "type": "string" }, { "name": "flowInfo", "value": "false", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "false", "required": false, "type": "boolean" } ], "inputMappings": [ { "type": 1, "value": "{A2.message}", "mapTo": "message" } ] } ], "links": [], "attributes": [] } } }, "id": "hello", "ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow" } ] }

smanu commented 7 years ago

Cannot reproduce.