Closed vijaypatnana closed 2 years ago
The task cannot find the specified file. By default it will look for it in the working directory. Is it not there you can specify an absolute path using variables.
For example if it is a downloaded artifact it might be in $(Pipeline.Workspace)
so you could use $(Pipeline.Workspace)/application.yml
as input. Note that I am not sure this is the right path for you, it depends where your file actually is but this is the idea.
My artifacts and application.yml are located here - /home/vpatnana/myagent/_work/r1/a/_Aplus/
. I guess the substitute task is looking at here - /home/vpatnana/myagent/_work/temp
. What is the default location of this extension?
As you suggested, I have tried this - $(Pipeline.Workspace)/application.yml
as input and getting the same error.
Fixed the path issue, Now the task found my application.yml file, but I am seeing different error now.
2022-02-11T17:23:51.8813853Z ##[debug]files=/home/vpatnana/myagent/_work/r1/a/_Aplus/drop/application.yml 2022-02-11T17:23:51.8820820Z Substituting variables in /home/vpatnana/myagent/_work/r1/a/_Aplus/drop/application.yml 2022-02-11T17:23:51.8897680Z { Error: Line 5: Unexpected token ILLEGAL 2022-02-11T17:23:51.8899712Z ##[debug]File could not be parsed as JSON: Line 5: Unexpected token ILLEGAL 2022-02-11T17:23:51.8906467Z at ErrorHandler.constructError (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:5012:22) 2022-02-11T17:23:51.8909228Z at ErrorHandler.createError (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:5028:27) 2022-02-11T17:23:51.8911086Z at ErrorHandler.throwError (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:5035:21) 2022-02-11T17:23:51.8912452Z at Scanner.throwUnexpectedToken (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:5164:35) 2022-02-11T17:23:51.8913718Z at Scanner.scanNumericLiteral (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:5837:19) 2022-02-11T17:23:51.8915115Z at Scanner.lex (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:6251:26) 2022-02-11T17:23:51.8917866Z at Tokenizer.getNextToken (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:6675:84) 2022-02-11T17:23:51.8920526Z at Object.tokenize (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/esprima/dist/esprima.js:154:36) 2022-02-11T17:23:51.8922644Z at Object.parseRegEx (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/decomment/lib/utils.js:37:13) 2022-02-11T17:23:51.8924235Z at parser (/home/vpatnana/myagent/_work/_tasks/SubstituteVariables_8472daf1-88bc-49e1-9bd6-d1591c8d20dc/1.2.1/node_modules/decomment/lib/parser.js:36:27) 2022-02-11T17:23:51.8925414Z index: 121, 2022-02-11T17:23:51.8926011Z lineNumber: 5, 2022-02-11T17:23:51.8927254Z description: 'Unexpected token ILLEGAL' }
Glad you fixed the path issue.
There was a regression in the last version that caused this error to show up in the logs when using YAML files. The task still worked as expected though. I published version 1.2.2 to fix that. Now the logs should be clean even for YAML files.
Hello,
I have the application configuration yaml file as published artifact. I have this substitute variable task right after the download artifacts, I am not sure why it is not picking up the file as input. Please advise. Thanks in advance!
here is the complete error details -