Unexpected token < in JSON at position 0
ecraig12345 opened this issue · 1 comments
Are you reporting a bug or a feature request ?
- Bug
- Feature request
Description
YarnInstaller
intermittently fails with ##[error]Unexpected token < in JSON at position 0
The failure is not at all consistent, but it seems to disappear for weeks at a time and then come back (but still only intermittently).
Expected behavior
The task either succeeds, or fails with a meaningful error.
Reproduction
Task configuration (found in this template file):
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: 'Use Yarn 1.19.x'
inputs:
versionSpec: 1.19.x
checkLatest: true
includePrerelease: false
Unfortunately, the failure is infrequent/random enough that we'd have to leave System.Debug
enabled for a few hours or days, which is probably not feasible.
My guess is that the culprit is these lines, and that the server at https://publicblobs.geeklearning.io/yarn/tarballsV2.json
is occasionally returning an HTML error page which obviously can't be parsed as JSON.
gl-vsts-tasks-yarn/Tasks/YarnInstaller/yarnToolInstallerTask.ts
Lines 13 to 18 in 35fe5ac
System information
VSTS or TFS:
- VSTS
- TFS
Agent:
- Hosted
- Custom
OS:
- Windows
- Mac
- Linux
Yarn version:
1.19.x
Node version:
12.18.4