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

Update Manager - Endpoint gave back wrong json data or it's changed #12633

Open
soosr opened this issue Mar 7, 2024 · 6 comments
Open

Update Manager - Endpoint gave back wrong json data or it's changed #12633

soosr opened this issue Mar 7, 2024 · 6 comments
Assignees

Comments

@soosr
Copy link
Collaborator

soosr commented Mar 7, 2024

Got the following exception on this branch: #12305, 74eb67c

2024-03-07 09:36:28.854 [18] ERROR      UpdateManager.UpdateChecker_UpdateStatusChangedAsync (96)       Getting new update failed with error. Exception: System.IO.InvalidDataException: Endpoint gave back wrong json data or it's changed.
   at WalletWasabi.Services.UpdateManager.GetLatestReleaseFromGithubAsync(Version targetVersion, CancellationToken cancellationToken) in WalletWasabi\Services\UpdateManager.cs:line 195
   at WalletWasabi.Services.UpdateManager.GetInstallerAsync(Version targetVersion, CancellationToken cancellationToken) in WalletWasabi\Services\UpdateManager.cs:line 110
   at WalletWasabi.Services.UpdateManager.UpdateChecker_UpdateStatusChangedAsync(Object sender, UpdateStatus updateStatus) in WalletWasabi\Services\UpdateManager.cs:line 76
2024-03-07 09:36:29.930 [19] ERROR      UpdateManager.UpdateChecker_UpdateStatusChangedAsync (96)       Getting new update failed with error. Exception: System.IO.InvalidDataException: Endpoint gave back wrong json data or it's changed.
   at WalletWasabi.Services.UpdateManager.GetLatestReleaseFromGithubAsync(Version targetVersion, CancellationToken cancellationToken) in WalletWasabi\Services\UpdateManager.cs:line 195
   at WalletWasabi.Services.UpdateManager.GetInstallerAsync(Version targetVersion, CancellationToken cancellationToken) in WalletWasabi\Services\UpdateManager.cs:line 110
   at WalletWasabi.Services.UpdateManager.UpdateChecker_UpdateStatusChangedAsync(Object sender, UpdateStatus updateStatus) in WalletWasabi\Services\UpdateManager.cs:line 76

@Szpoti Szpoti self-assigned this Mar 7, 2024
@Szpoti
Copy link
Collaborator

Szpoti commented Mar 7, 2024

Can't repro.

2024-03-07 10:58:48.183 [15] INFO       UpdateManager.GetInstallerAsync (126)   Trying to download new version: 2.0.6
2024-03-07 10:58:50.101 [28] INFO       UpdateManager.GetInstallerAsync (133)   Installer downloaded, copying...
2024-03-07 10:58:50.303 [34] INFO       UpdateManager.UpdateChecker_UpdateStatusChangedAsync (78)       Version 2.0.6 downloaded successfully.

@soosr
Copy link
Collaborator Author

soosr commented Mar 7, 2024

It doesn't happen all the time. I have encountered the issue again since I reported it.

@Szpoti
Copy link
Collaborator

Szpoti commented Mar 7, 2024

Although I'm not 100% sure what's the real issue in the background, I can imagine that the json data was an error wrapped in HTML. It can happen from time to time when there are server side or internet issues. I remember I choose having this as an error to indicate that there is, in fact, an error in the background, the default workflow that should work has been broken. But there is nothing the user can do, other than downloading the new version manually.
So I'd say the best to do is to change the LogLevel here to Warning.

@molnard
Copy link
Collaborator

molnard commented Mar 20, 2024

Now that the PR was merged, next step is to wait for the error again and observe the JSON string?

@Szpoti
Copy link
Collaborator

Szpoti commented Mar 27, 2024

Now that the PR was merged, next step is to wait for the error again and observe the JSON string?

Yes, that way we'll know what exactly goes wrong and can handle the error correctly in the future.

@Szpoti
Copy link
Collaborator

Szpoti commented Apr 18, 2024

Found the error, this is what we get back from the endpoint:

2024-04-18 11:58:06.103 [12] WARNING	UpdateManager.GetLatestReleaseFromGithubAsync (194)	{
  "message": "API rate limit exceeded for my.ip.address.###. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"
}

It could probably happen because we make requests very fast when getting the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants