-
Notifications
You must be signed in to change notification settings - Fork 656
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
[Bug] Version 5.10 is causing "SyntaxError: Unexpected end of JSON input" error #3081
Comments
We are having the same issue on Azure DevOps (using https://github.com/GitTools/actions/issues).
|
A revert to gitversion 5.9 as described here seems to fix the issue for us: https://github.com/GitTools/actions/blob/main/docs/examples/azure/gitversion/setup/usage-examples.md |
While that might fix the issue now, it doesn't really work in the long run. Don't really feel like going through all our pipeline files to revert back for the time being and then having to undo all those changes once the bug is fixed. |
To understand the problem and have a fix we need to know how to reproduce the issue. Is it a public repo that we can run and debug against? |
Unfortunatly our pipeline is not public. Maybe someone with a public one can share some details with you I think it has something to do with getting the correct branch name. |
@ebbz, are you in a position to try to debug on your repo locally the code of GitVersion and see exactly where it's the issue? |
Same issue here. It's working when you trigger to feature branch. But It's failing when Azure triggers the pipeline for PRs |
Unfortunately our repo is also closed source. |
This is my main suspect right now, pr build branches start with "refs/heads/": |
@ThomasPiskol do you mind checking this? |
I need to get my repo's PR branch locally. I don't know how to do that... |
@ebbz these are the git commands used by Azure Pipelines: |
I would recommend to pin the version number always to avoid this type of 'surprises'. So for now I would recommend to pin to version 5.9.0 and when we find some time/will have more details, we will fix this issue. |
Note that with 5.9.0 the
But with 5.10.0 the
|
🎉 This issue has been resolved in version 5.10.1 🎉 Your GitReleaseManager bot 📦🚀 |
@ebbz @cheesi @jopabe @muhammetkaya @wattsSamuel @orionstudt please confirm it's working for you with version 5.10.1 |
@arturcic I can confirm it's working again, thnx! |
@arturcic I can also confirm it's working, thank you so much! |
@arturcic Can confirm working now, thank you |
People are still hitting this sort of |
Yea it appears to be a common error that is obscuring the real error, so it shows up for a number of different issues. Would be nice if it was updated and caught to expose the real underlying error message. |
Describe the bug

Version 5.10 is causing "SyntaxError: Unexpected end of JSON input" error
Failing build:


Normal working build:
Expected Behavior
No errors
Actual Behavior
I believe this is because since version 5.10 the variable 'Branch from build environment: ' is not being set.
Possible Fix
Make sure the variable is set again
Steps to Reproduce
Context
We always use the newest version fi gitvesion, since the update a few hours ago, our builds stopped working.
Your Environment
Azure DevOps (private environment)
Agent name: 'Azure Pipelines 2'
Agent machine name: 'WIN-MGDD5L23JQP'
Current agent version: '2.202.0'
Operating System
Virtual Environment
Virtual Environment Provisioner
Current image version: '20220330.1'
Agent running as: 'VssAdministrator'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: gitversion/setup (0.9.13)
Downloading task: gitversion/execute (0.9.13)
Downloading task: NodeTool (0.200.0)
Downloading task: Npm (1.198.0)
Downloading task: DotNetCoreCLI (2.198.0)
Downloading task: reportgenerator (5.1.4)
Downloading task: PublishCodeCoverageResults (1.200.0)
Downloading task: Gitleaks (2.2.16)
Downloading task: PublishBuildArtifacts (1.200.0)
The text was updated successfully, but these errors were encountered: