azure-devopsazure-pipelinesazure-pipelines-yamldynatrace

Azure pipelines errors out in Download Artifacts task


I am creating a pipeline in Azure DevOps pipelines that deploys out to an environment. It works in other VMs that I have just one specific VM it errors out in the javascript for the downloading artifact.

Here is the current code, I removed the actual deployment step but I still get the same error

  displayName: Deploy Test Environment
  jobs:
    - deployment: deploy_test
      displayName: Deploy Test
      condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/Test'))
      environment: 
        name: msptst
        resourceType: virtualMachine
      strategy:
        runOnce:
          deploy:
            steps:
              - template: templates\azure-test-deployment-template.yml

This is from the pipeline yaml, the next one is from the template in the deployment step

  - task: ExtractFiles@1
    inputs:
      archiveFilePatterns: '$(PIPELINE.WORKSPACE)/**/*.zip'
      destinationFolder: '$(PIPELINE.WORKSPACE)/ExtractedArtifact'
      cleanDestinationFolder: false
      overwriteExistingFiles: true
  - script: DIR "$(PIPELINE.WORKSPACE)" /S
    continueOnError: true

Here is the error that I am getting.

C:\PROGRA~2\DYNATR~1\oneagent\agent\bin\125121~1.202\any\nodejs\nodejsagent.js:2611
  const e = Buffer.allocUnsafe(8), d = 2 ** 32;
                                          ^

SyntaxError: Unexpected token *
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at module.js:676:12
    at Array.forEach (native)
##[error]Exit code 1 returned from process: file name 'E:\azagent\A1\externals\node\bin\node.exe', arguments '"E:\azagent\A1\_work\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.178.0\main.js"'.
Finishing: Download Artifact

Solution

  • The issue is the new agent of Dynatrace, we also got this error. the DownloadArtirfacts task using very old node version (6) and the Dynatrace agent doesn't like it.

    To resolve it you have 2 options:

    1. Go to the agent folder C:\azagent\1\externals and copy from node10 folder the node.exe (in bin folder) to the node folder (or rename both folders).

    2. Update DownloadArtirfacts task to use node10 folder, you need to get the task source code (exist in C:\azagent\1\_work\_tasks), change it in the task.json & task.loc.json and push it back with tfx-cli.