Devolutions/UniGetUI · warning · InvalidOperationException

No cloud backups are available for the current account.

Error message

No cloud backups are available for the current account.

What it means

GetCloudBackupContentsAsync (used by download and restore) calls GetBackupGistAsync with createIfMissing=false. If no gist with the sentinel description-ending key is found among the user's gists, the method returns null, and GetCloudBackupContentsAsync throws InvalidOperationException. This means the user has authenticated successfully but has never created a cloud backup, or their backup gist was deleted.

Source

Thrown at src/UniGetUI.Interface.IpcApi/IpcBackupApi.cs:509

    private static async Task<GitHubUser> GetAuthenticatedGitHubUserAsync(GitHubApiClient client)
    {
        var user = await client.GetCurrentUserAsync();
        if (!string.IsNullOrWhiteSpace(user.Login))
        {
            Settings.SetValue(Settings.K.GitHubUserLogin, user.Login);
        }

        return user;
    }

    private static async Task<string> GetCloudBackupContentsAsync(string key)
    {
        using var client = CreateAuthenticatedGitHubClient();
        await GetAuthenticatedGitHubUserAsync(client);
        var backupGist = await GetBackupGistAsync(client, createIfMissing: false);
        if (backupGist is null)
        {
            throw new InvalidOperationException("No cloud backups are available for the current account.");
        }

        var fullGist = await client.GetGistAsync(backupGist.Id);
        var file = fullGist.Files.FirstOrDefault(candidate =>
            candidate.Key.StartsWith(PackageBackupStartingKey, StringComparison.Ordinal)
            && candidate.Key.EndsWith(key, StringComparison.Ordinal));

        if (file.Value?.Content is null)
        {
            throw new InvalidOperationException($"The cloud backup \"{key}\" was not found.");
        }

        return file.Value.Content;
    }

    private static async Task<GitHubGist?> GetBackupGistAsync(
        GitHubApiClient client,
        bool createIfMissing

View on GitHub (pinned to 9b1d7d0eab)

Solutions

  1. Call CreateCloudBackupAsync first to create and populate the backup gist.
  2. Verify the correct GitHub account is signed in (check IpcGitHubAuthInfo.Login).
  3. If the gist was renamed/edited, delete the modified gist so a fresh one with the correct description can be created.
  4. List available backups via ListCloudBackupsAsync before attempting download/restore.

Example fix

// before: downloading when no backup gist exists
await IpcBackupApi.DownloadCloudBackupAsync(request);
// after: create a backup first if none exists
var entries = await IpcBackupApi.ListCloudBackupsAsync();
if (entries.Count == 0)
    await IpcBackupApi.CreateCloudBackupAsync();
else
    await IpcBackupApi.DownloadCloudBackupAsync(request);
Defensive patterns

Strategy: validation

Validate before calling

var entries = await IpcBackupApi.ListCloudBackupsAsync();
if (entries.Count == 0)
    await IpcBackupApi.CreateCloudBackupAsync();

Type guard

static bool HasCloudBackup(IReadOnlyList<IpcCloudBackupEntry> entries) => entries.Count > 0;

Try / catch

try { await IpcBackupApi.DownloadCloudBackupAsync(request); }
catch (InvalidOperationException ex) when (ex.Message.Contains("No cloud backups"))
{ /* create a backup first */ }

Prevention

When it happens

Trigger: DownloadCloudBackupAsync or RestoreCloudBackupAsync is called when the authenticated user has no backup gist. The user never ran CreateCloudBackupAsync, or the gist was manually deleted from their GitHub account, or the gist's description was edited (breaking the sentinel-key detection).

Common situations: A new user tries to restore before creating their first backup. The user manually deleted or renamed the gist in GitHub's UI. The gist description was altered so EndsWith(GistDescriptionEndingKey) no longer matches. The user is authenticated with a different GitHub account that has no backup.

Related errors


AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13). Data as JSON: /api/errors/f594d31c4408b6e1. Report an issue: GitHub.