aws-toolkit-azure-devops icon indicating copy to clipboard operation
aws-toolkit-azure-devops copied to clipboard

Create/Update Stack task error

Open Norticaranda opened this issue 4 years ago • 2 comments

Hi

I encountered a problem when I run the Create / Update Stack task of Cloud Formation from a build agent.

I have no problems running the command to create the stack with the same credentials from AWS cli, but from the build agent it generates the following error:

/etc/myagent/_work/_tasks/CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99/1.4.0/CloudFormationCreateOrUpdateStack.js:13 /var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(a,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function n(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){e.done?a(e.value):new r(function(t){t(e.value)}).then(o,n)}u((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const a=r(7);function s(e,r,i){r!==t.defaultTimeoutInMins&&console.log(a.loc("SettingCustomTimeout",r));const s={StackName:e,$waiter:{maxAttempts:Math.round(60r/30)}};return i&&(s.ChangeSetName=i),s}t.defaultTimeoutInMins=60,t.captureStackOutputs=function(e,t,r,s){return i(this,void 0,void 0,function*(){const i=yield e.describeStacks({StackName:t}).promise();try{const e=i.Stacks[0];if(r){console.log(a.loc("ProcessingStackOutputsToJsonBlobBuildVariable"));const r=JSON.stringify(e.Outputs),i=${t}Outputs;console.log(a.loc("CreatingSta

SyntaxError: Unexpected token = at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:146:18) at node.js:404:3

I have no more information, because the execution log does not provide more data, even in system.debug mode

I can run other task from aws-vsts-tools, but no create/update stack

What could be happening?

I have tested on Windows and Linux agents and in all I have the same problem

My Environment TFS Server On Premise 2017: Versión 15.112.26307.0 Linux TFS Build Agent AWS Tools Versión: 1.4.0

Thanks Best regards

Norticaranda avatar Oct 02 '19 07:10 Norticaranda

Can you try updating to 1.5?

hunterwerlla avatar Oct 15 '19 19:10 hunterwerlla

Hi @hunterwerlla I use 1.5 versión and have the same error

Task : AWS CloudFormation Create/Update Stack Description : Creates a new AWS CloudFormation stack or updates the stack if it exists. Version : 1.5.0 Author : Amazon Web Services Help : Please refer to AWS CloudFormation User Guide for more details on working with AWS CloudFormation.

The task may also require permissions to upload your application template to the specified Amazon S3 bucket.

/etc/myagent/_work/_tasks/CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99/1.5.0/CloudFormationCreateOrUpdateStack.js:13 /var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(a,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function n(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){e.done?a(e.value):new r(function(t){t(e.value)}).then(o,n)}u((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const a=r(6);function s(e,r,i){r!==t.defaultTimeoutInMins&&console.log(a.loc("SettingCustomTimeout",r));const s={StackName:e,$waiter:{maxAttempts:Math.round(60r/30)}};return i&&(s.ChangeSetName=i),s}t.defaultTimeoutInMins=60,t.captureStackOutputs=function(e,t,r,s){return i(this,void 0,void 0,function*(){const i=yield e.describeStacks({StackName:t}).promise();try{if(!i.Stacks)throw new Error("No stacks in response");const e=i.Stacks[0];if(r){console.log(a.loc("ProcessingStackOutputsToJsonBlobBuildVariable"));const r=JSON.stringify(e.O

SyntaxError: Unexpected token = at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:146:18) at node.js:404:3 Exit code 1 returned from process: file name '/etc/myagent/externals/node/bin/node', arguments '"/etc/myagent/_work/_tasks/CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99/1.5.0/CloudFormationCreateOrUpdateStack.js"'. Microsoft.VisualStudio.Services.Agent.ProcessExitCodeException: Exit code 1 returned from process: file name '/etc/myagent/externals/node/bin/node', arguments '"/etc/myagent/_work/_tasks/CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99/1.5.0/CloudFormationCreateOrUpdateStack.js"'.

Thank's

Norticaranda avatar Oct 17 '19 09:10 Norticaranda