Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse JSON file in (JSON variable substitution) #4884

Closed
etbuilder opened this issue Jul 27, 2017 · 16 comments
Closed

Unable to parse JSON file in (JSON variable substitution) #4884

etbuilder opened this issue Jul 27, 2017 · 16 comments
Assignees
Labels
Area: AzureAppService Label to monitor Azure App Service issues Area: Release enhancement

Comments

@etbuilder
Copy link

The task will fail with error ##[error]Error: Unable to parse JSON file: PATH . Error: SyntaxError: Unexpected token / in JSON at position 63

We resolved the issue by removing comments from the JSON file any // was removed to fix the issue, the task should remove any comments before parsing.

@bryanmacfarlane
Copy link
Contributor

Which task? This issue has a few characters from a log with no context.

@etbuilder
Copy link
Author

Oh sorry, here is detais.

Task Deploy Azure App Service v3.0*

When using File Transforms & Variable Substitution Options --> JSON variable substitution with a json file that contains any inline comments (ie //bla bla bla)

The task will fail with ##[error]Error: Unable to parse JSON file: PATH . Error: SyntaxError: Unexpected token / in JSON at position 63

@elvirdolic
Copy link

elvirdolic commented Aug 1, 2017

We have the same issue with a comment in json file

@vincent1173
Copy link
Contributor

@etharreef , @elvirdolic thanks for your feedback.
Currently the fix is in progress and update you once it's completed.

@ericbrunner
Copy link

When will that work in VSTS ?

@vincent1173
Copy link
Contributor

@ericbrunner , we have the story in our backlog and will be taken based on the priority.
Will be updating the thread once the fix is deployed.

@shibinchandra
Copy link

is the fix implemented ?

@aleccaputo
Copy link

aleccaputo commented Oct 5, 2017

@shibinchandra it is not fixed. We just ran into this today.

@SunnyOswal
Copy link

not fixed :(

@rswe
Copy link

rswe commented Jan 7, 2018

Getting same issue today e.g. // style comments break VSTS Build (using Task Azure Resource Group Deployment, rather than Appservice - please comment if I should raise a new separate incident?)
The ARM templates are fairly unreadable for others if no comments are possible so will hold off using VSTS build pipeline for now:

2018-01-07T22:13:06.4942880Z Resource Group created successfully.
2018-01-07T22:13:06.4946213Z Creating deployment parameters.
2018-01-07T22:13:06.5091189Z The detected encoding for file 'd:\a\1\s\mainTemplate.json' is 'utf-8'
2018-01-07T22:13:06.5365371Z ##[error]Error: Ensure the Template file ( 'd:\a\1\s\mainTemplate.json' ) is valid. Task failed while parsing with following error: Unexpected token / in JSON at position 49230

@vincent1173
Copy link
Contributor

@rswe , please open a separate thread for this issue.

@sachinma
Copy link
Member

sachinma commented Jan 8, 2018

@rswe can you specify the version of the Azure Resource Group Deployment task where you are seeing this behavior?

@rswe
Copy link

rswe commented Jan 8, 2018

@sachinma @vincentdass Azure Resource Group Deployment task version 2.*
Raised in #6158

@vincent1173
Copy link
Contributor

The Issue is resolved and the fix will be available in upcoming deployment.

@Talegen
Copy link

Talegen commented Mar 30, 2018

Just ran into this on VSTS as of 3/30/2018. I had a comment in my appsettings.json. removed and now it works.

offending comment was a line that was removed from appsettings.json
...
// [ some config stuff ]
...

2018-03-30T17:40:37.7647836Z ##[section]Starting: IIS Web App Deploy
2018-03-30T17:40:37.7647836Z ==============================================================================
2018-03-30T17:40:37.7647836Z Task : IIS Web App Deploy
2018-03-30T17:40:37.7647836Z Description : Deploy a Website or Web Application using WebDeploy
2018-03-30T17:40:37.7647836Z Version : 0.0.34
2018-03-30T17:40:37.7647836Z Author : Microsoft Corporation
2018-03-30T17:40:37.7647836Z Help : More Information
2018-03-30T17:40:37.7647836Z ==============================================================================
2018-03-30T17:40:39.8585344Z XML variable substitution applied successfully.
2018-03-30T17:40:39.8897824Z ##[error]Error: Unable to parse JSON file: C:...\appsettings.json. Error: SyntaxError: Unexpected token ] in JSON at position 1448
2018-03-30T17:40:39.9054101Z ##[section]Finishing: IIS Web App Deploy

@ongun23
Copy link

ongun23 commented Jun 17, 2020

Having the same issiue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: AzureAppService Label to monitor Azure App Service issues Area: Release enhancement
Projects
None yet
Development

No branches or pull requests