Azure-pipelines-tasks: Helm tool installer: Unexpected end of JSON input

Created on 2 Oct 2018  路  15Comments  路  Source: microsoft/azure-pipelines-tasks

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Environment

  • Server - Azure Pipelines

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number:

account name: scan2lead
team project name: scan2lead
build definition number: 13

  • Agent - Hosted or Private: both

Issue Description

The task "Helm tool installer" randomly fails during build and deployment with the error message

Unhandled: Unexpected end of JSON input
Unhandled: Unexpected end of JSON input

image

We still don't know why this problem exist but we guess it's about checking and downloading for the latest version of helm.

That's the setup of the task:

image

Task logs

This is the same build but with debug enabled with a big load of information.
15_Install Helm 2.8.2.txt

Error logs

2018-10-02T13:39:22.9502773Z ##[section]Starting: Install Helm 2.8.2
2018-10-02T13:39:22.9507904Z ==============================================================================
2018-10-02T13:39:22.9508274Z Task         : Helm tool installer
2018-10-02T13:39:22.9508457Z Description  : Install Helm and Kubernetes on agent machine.
2018-10-02T13:39:22.9508627Z Version      : 0.1.8
2018-10-02T13:39:22.9508771Z Author       : Microsoft Corporation
2018-10-02T13:39:22.9508963Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=851275)
2018-10-02T13:39:22.9509178Z ==============================================================================
2018-10-02T13:39:23.9530233Z ##[error]Unhandled: Unexpected end of JSON input
2018-10-02T13:39:23.9541727Z ##[error]Unhandled: Unexpected end of JSON input
2018-10-02T13:39:23.9600401Z ##[section]Finishing: Install Helm 2.8.2
Release

Most helpful comment

@SeriousM , I have verified.,fix deployed to your account region yesterday. You can see "Version : 0.1.10" Helm installer task logs. Can you try now and let us know if you faces same issue.

All 15 comments

Unchecking either "Check for latest version of Helm" or "Check for latest version of kubectl" reduces the 2 errorlines to one, so the possibility for it to be correlating with the version-check is high.

@SeriousM are you able to repro this consistently?
The JSON parsing of the response from api.github.com seems to be failing based on your logs.
The logs which you've attached, are they from your private agent or hosted?

@ds-ms I was lucky that the issue happened quite often during this timeframe so I was able to create the logs. The logs are from the on-premise agent but the very same error occurs on the hosted linux agents as well.
This is an example of a deployment but without debug-log: https://dev.azure.com/Scan2Lead/Scan2Lead/_releaseProgress?_a=release-environment-logs&releaseId=259&environmentId=721
As I said it fails quite randomly...

@ds-ms, Should we start logging what content we got from api.github.com?

I suppose the download utility tool which is currently being used for fetching the latest version of Helm is causing this error. When a REST call is made, the utility pipes the contents of the REST call's response to a file, and that file is consumed later and parsed.
I've raised a PR to skip the process of file write/read and directly consume the response; which would prevent errors like Unexpected end of JSON input because we're skipping the relay and directly parsing the string.

Closing this issue as the PR is merged. If this issue continues to persist after the release (approx 3 weeks) feel free to reopen this issue

Thank you @ds-ms very much. I'll keep an eye on it.

@ds-ms Hi, it's now 28 days later (4 weeks) and that's my observations:

  • The hosted agents (ubuntu linux) just had the issue around 2 times.
  • The on premise agents (win10, 1803, x64) get this error almost every time

Where is the fix? I will try to get a log with debug info.
Please reopen this issue.

here is the log from the broken step:

log.txt

@SeriousM , Can you give your account name. From logs I see still your account has " Version : 0.1.8" Helm installer task. This issue fixed in " Version : 0.1.10" version. Fix deployed on all accounts yesterday.

Sure, here you go

account name: scan2lead
team project name: scan2lead

@SeriousM , I have verified.,fix deployed to your account region yesterday. You can see "Version : 0.1.10" Helm installer task logs. Can you try now and let us know if you faces same issue.

Thank you @vithati, I will have a close look on the behavior.
Is there any way to see the release ETAs for my region? I also miss the dark mode in Azure DevOps even though it was already public announced.

No, currently there is no way to see the release ETAs for your region and secondly dark mode should be now available on your account as well.

Seems everything works now as expected. Thank you!

Was this page helpful?
0 / 5 - 0 ratings