spinnaker / roer

A thin Spinnaker CLI
Apache License 2.0
45 stars 45 forks source link

Exception when trying to unmarshal response for application creation #54

Closed Aaquiff closed 4 years ago

Aaquiff commented 5 years ago

When creating an application, the task succeeds but there is an exception when trying to unmarshal the response. Following is the exception message thrown and note where it says json: cannot unmarshal number 1556520132734 into Go struct field ExecutionResponse.buildTime of type int. The field with that value is the build time.

time="2019-04-29T06:42:12Z" level=warning msg="HTTP client not configured with TLS transport" time="2019-04-29T06:42:12Z" level=info msg="Sending create app task" time="2019-04-29T06:42:12Z" level=info msg="Waiting for task to complete..." refURL="/tasks/01D9KX8R3YPMT8Z3RBVPM59ZRH" {"application":"app8","buildTime":1556520132734,"endTime":1556520132847,"execution":{"application":"app8","authentication":{"allowedAccounts":["dockerhub","default"],"user":"anonymous"},"buildTime":1556520132734,"canceled":false,"description":"Create Application: app8","endTime":1556520132847,"id":"01D9KX8R3YPMT8Z3RBVPM59ZRH","initialConfig":{},"keepWaitingPipelines":false,"limitConcurrent":false,"notifications":[],"origin":"api","stages":[{"context":{"application":{"email":"testapp.yml","name":"app8"},"application.name":"app8","newState":{"email":"testapp.yml","name":"app8"},"notification.type":"upsertapplication","parameters":{},"previousState":{"createTs":"1556519970817","email":"testapp.yml","lastModifiedBy":"anonymous","name":"APP8","trafficGuards":[],"updateTs":"1556520110000"},"refId":"0","requisiteStageRefIds":[]},"endTime":1556520132833,"id":"01D9KX8R3Y8VG87KRXGGX6YHCN","name":"createApplication","outputs":{},"refId":"0","requisiteStageRefIds":[],"startTime":1556520132757,"status":"SUCCEEDED","tasks":[{"endTime":1556520132822,"id":"1","implementingClass":"com.netflix.spinnaker.orca.applications.tasks.UpsertApplicationTask","loopEnd":false,"loopStart":false,"name":"createApplication","stageEnd":true,"stageStart":true,"startTime":1556520132761,"status":"SUCCEEDED"}],"type":"createApplication"}],"startTime":1556520132743,"status":"SUCCEEDED","systemNotifications":[],"trigger":{"artifacts":[],"dryRun":false,"notifications":[],"parameters":{},"rebake":false,"resolvedExpectedArtifacts":[],"strategy":false,"type":"manual","user":"anonymous"},"type":"ORCHESTRATION"},"id":"01D9KX8R3YPMT8Z3RBVPM59ZRH","name":"Create Application: app8","startTime":1556520132743,"status":"SUCCEEDED","steps":[{"endTime":1556520132822,"id":"1","implementingClass":"com.netflix.spinnaker.orca.applications.tasks.UpsertApplicationTask","loopEnd":false,"loopStart":false,"name":"createApplication","stageEnd":true,"stageStart":true,"startTime":1556520132761,"status":"SUCCEEDED"}],"variables":[{"key":"notification.type","value":"upsertapplication"},{"key":"requisiteStageRefIds","value":[]},{"key":"application","value":{"email":"testapp.yml","name":"app8"}},{"key":"refId","value":"0"},{"key":"parameters","value":{}},{"key":"newState","value":{"email":"testapp.yml","name":"app8"}},{"key":"application.name","value":"app8"},{"key":"previousState","value":{"createTs":"1556519970817","email":"testapp.yml","lastModifiedBy":"anonymous","name":"APP8","trafficGuards":[],"updateTs":"1556520110000"}}]} json: cannot unmarshal number 1556520132734 into Go struct field ExecutionResponse.buildTime of type int failed unmarshaling task status response github.com/spinnaker/roer/spinnaker.(client).GetTask /Users/rzienert/go/src/github.com/spinnaker/roer/spinnaker/client.go:281 github.com/spinnaker/roer/spinnaker.(client).PollTaskStatus /Users/rzienert/go/src/github.com/spinnaker/roer/spinnaker/client.go:295 github.com/spinnaker/roer.AppCreateAction.func1 /Users/rzienert/go/src/github.com/spinnaker/roer/actions.go:96 github.com/spinnaker/roer/vendor/github.com/urfave/cli.HandleAction /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:483 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:193 github.com/spinnaker/roer/vendor/github.com/urfave/cli.(App).RunAsSubcommand /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:374 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.startApp /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:280 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:79 github.com/spinnaker/roer/vendor/github.com/urfave/cli.(App).Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:250 main.main /Users/rzienert/go/src/github.com/spinnaker/roer/cmd/roer/main.go:25 runtime.main /usr/local/Cellar/go/1.8.3/libexec/src/runtime/proc.go:185 runtime.goexit /usr/local/Cellar/go/1.8.3/libexec/src/runtime/asm_386.s:1629 failed polling task status github.com/spinnaker/roer/spinnaker.(client).PollTaskStatus /Users/rzienert/go/src/github.com/spinnaker/roer/spinnaker/client.go:297 github.com/spinnaker/roer.AppCreateAction.func1 /Users/rzienert/go/src/github.com/spinnaker/roer/actions.go:96 github.com/spinnaker/roer/vendor/github.com/urfave/cli.HandleAction /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:483 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:193 github.com/spinnaker/roer/vendor/github.com/urfave/cli.(App).RunAsSubcommand /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:374 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.startApp /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:280 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:79 github.com/spinnaker/roer/vendor/github.com/urfave/cli.(App).Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:250 main.main /Users/rzienert/go/src/github.com/spinnaker/roer/cmd/roer/main.go:25 runtime.main /usr/local/Cellar/go/1.8.3/libexec/src/runtime/proc.go:185 runtime.goexit /usr/local/Cellar/go/1.8.3/libexec/src/runtime/asm_386.s:1629 poll create app status github.com/spinnaker/roer.AppCreateAction.func1 /Users/rzienert/go/src/github.com/spinnaker/roer/actions.go:98 github.com/spinnaker/roer/vendor/github.com/urfave/cli.HandleAction /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:483 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:193 github.com/spinnaker/roer/vendor/github.com/urfave/cli.(App).RunAsSubcommand /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:374 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.startApp /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:280 github.com/spinnaker/roer/vendor/github.com/urfave/cli.Command.Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/command.go:79 github.com/spinnaker/roer/vendor/github.com/urfave/cli.(*App).Run /Users/rzienert/go/src/github.com/spinnaker/roer/vendor/github.com/urfave/cli/app.go:250 main.main /Users/rzienert/go/src/github.com/spinnaker/roer/cmd/roer/main.go:25 runtime.main /usr/local/Cellar/go/1.8.3/libexec/src/runtime/proc.go:185 runtime.goexit /usr/local/Cellar/go/1.8.3/libexec/src/runtime/asm_386.s:1629