microsoft / azure-pipelines-extensions

Collection of all RM and deployment extensions
http://www.visualstudio.com/explore/release-management-vs
MIT License
276 stars 423 forks source link

RangeError: Maximum call stack size exceeded #734

Open koenverburg opened 4 years ago

koenverburg commented 4 years ago

Hi, I'm trying to get my DevOps extention to work but it's failing on a maximum call stack size exceeded. I can't find anything about this on the internet or other issues.

My extention is node based and I'm running chrome-launcher. Thanks.

_warning(_loc('LIB_ResourceFileNotSet', key));
               ^
RangeError: Maximum call stack size exceeded

image

chshrikh commented 4 years ago

@koenverburg can you please point to the task / task code

russellseymour commented 3 years ago

I know this is an old issue, but I am having the same issue and seeing as this it is still Open I thought I would add to it.

I am seeing this error:

image

I have been trying to figure this out all day but to no avail.

The code can be seen here - https://github.com/chef-partners/azuredevops-chef-extension/blob/master/src/common/utils.ts#L67

(There is a lot of code commented out as I am trying to debug what the problem is here).

Even when I uncomment the code so that I have a try / catch block around it, it does not get to the catch block to output the error. I am not sure why it exits with the specified code but I do not see from my console.log but from (what I assume) is the tool runner.

I thought this might have been down to the task not being able to find its resourceFile for messages, hence the error, but when I try to set this using:

let resourceFile = pathJoin(__dirname, "task.json");

__dirname always returns null, so the task attempts to set the resoure file to /task.json which is obviously incorrect.

The extension has three tasks, which call reusable functions in the common dir of the repo.

Interestingly if I correct this error (by setting the environment variable to accept the Chef license) the task will run chef-client correctly, but I will see still the error about the LIB_ResourceFile.

So the things I need to fix here are:

  1. Why does the tool runner seem to abort on the exit code rather than waiting and putting the value into code.
  2. How can I suppress the LIB_ResourceFile error when I cannot specify the path to the task.json file as the __dirname does not have the correct value.

Thank you

russellseymour commented 3 years ago

This only started happening when I updated the extension so it used exec as well as execSync

russellseymour commented 3 years ago

I realised that after updating this issue, it was the wrong place

I have now logged an issue on the task library itself - https://github.com/microsoft/azure-pipelines-task-lib/issues/667

cima commented 3 years ago

The issue at azure-pipelines-task-lib was automatically closed. Can we nudge them to reopen it? I did the math and find the bug and suggested a fix. But Honestly I am lazy to do the pull request agenda 😇. It is purely azure-pipelines-task-lib's fault and azure-pipelines-extensions has no guilt in this bug.