pulumi / pulumi-az-pipelines-task

Azure Pipelines task extension for running Pulumi apps.
https://marketplace.visualstudio.com/publishers/pulumi
Apache License 2.0
27 stars 19 forks source link

Axios error #160

Open Rockyogesh opened 5 months ago

Rockyogesh commented 5 months ago

Describe the bug

create release pipeline with command as version getting below error

2024-06-12T10:24:34.9553157Z ##[section]Starting: Run pulumi version 2024-06-12T10:24:34.9574618Z ============================================================================== 2024-06-12T10:24:34.9575351Z Task : Pulumi Azure Pipelines Task 2024-06-12T10:24:34.9576020Z Description : Azure Pipelines task extension for running Pulumi apps. 2024-06-12T10:24:34.9576632Z Version : 1.1.4 2024-06-12T10:24:34.9577316Z Author : Pulumi 2024-06-12T10:24:34.9579053Z Help : Join us on Slack at https://slack.pulumi.com. 2024-06-12T10:24:34.9579833Z ============================================================================== 2024-06-12T10:24:39.0180028Z ##[error]Unhandled: Unexpected identifier 2024-06-12T10:24:39.0221270Z ##[error]/app1/azureagent/agent23/_work/_tasks/Pulumi_66148448-e174-4167-91a4-0ac63f4a10ca/1.1.4/node_modules/axios/index.js:1 import axios from './lib/axios.js'; ^^^^^ SyntaxError: Unexpected identifier at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/app1/azureagent/agent23/_work/_tasks/Pulumi_66148448-e174-4167-91a4-0ac63f4a10ca/1.1.4/version.js:32:28) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 2024-06-12T10:24:39.0271435Z ##[section]Finishing: Run pulumi version

To Reproduce Steps to reproduce the behavior:

node version on agent v14.17.6

image

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

baoduy commented 5 months ago

We also got the same error after the extension got upgraded automatically on 25 May. Please help as all pipeline got impacted.

Starting: Pulumi Up Stack List
==============================================================================
Task         : Pulumi Azure Pipelines Task
Description  : Azure Pipelines task extension for running Pulumi apps.
Version      : 1.1.4
Author       : Pulumi
Help         : Join us on Slack at https://slack.pulumi.com./
==============================================================================
##[error]Unhandled: Unexpected identifier
##[error]/home/ts-ado-admin-RYaU/agent2/_work/_tasks/Pulumi_66148448-e174-4167-91a4-0ac63f4a10ca/1.1.4/node_modules/axios/index.js:1
import axios from './lib/axios.js';
       ^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/ts-ado-admin-RYaU/agent2/_work/_tasks/Pulumi_66148448-e174-4167-91a4-0ac63f4a10ca/1.1.4/version.js:32:28)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
Finishing: Pulumi Up Stack List
justinvp commented 5 months ago

Sorry for the trouble! Thanks for opening the issue.

node version on agent v14.17.6

@Rockyogesh, would it be possible to upgrade to a more recent version of Node? We have tests that are running successfully with node 16.20.2. Though, both 14 and 16 are no longer supported according to https://nodejs.org/en/about/previous-releases

@baoduy, what version of node is installed on the agent?

Rockyogesh commented 1 month ago

@justinvp I got this working by updating vsts agent version to latest that uses node16 on the agent. earlier we had vsts agent with node version 10.
@justinvp looks like node10 should be removed from this file as it is no longer supported.. https://github.com/pulumi/pulumi-az-pipelines-task/blob/master/buildAndReleaseTask/task.json#L128C1-L130C10

just for reference: For running any azure pipeline task node installed on agent does not get used. VSTS package is shipped with node binaries. only this binaries will be used while running azure task code(not application code eg. pulumi deployment scripts). For application code user installed node will be used.