Devolutions/UniGetUI · error · InvalidOperationException

The IPC API token is not available. Start UniGetUI and try…

Error message

The IPC API token is not available. Start UniGetUI and try again.

What it means

Thrown by IpcClient.EnsureTokenAvailable when the _token field is null or whitespace. EnsureTokenAvailable guards every authenticated send (SendAuthenticatedAsync), so any protected IPC call made on a tokenless client fails immediately before any network attempt.

Solutions

  1. Start UniGetUI so it publishes its IPC token, then rediscover the endpoint/token.
  2. Construct IpcClient with the token from a valid IpcEndpointRegistration rather than null/empty.
  3. Call GetStatusAsync (an unauthenticated route) only after ensuring the client has a token for protected routes.
  4. Use the endpoint-discovery helper to find a live, token-bearing registration before building the client.
Defensive patterns

Strategy: validation

Validate before calling

// Discover a token-bearing live endpoint before constructing the client:
var reg = IpcClient.FindLiveEndpoint();
if (reg is null || string.IsNullOrWhiteSpace(reg.Token))
    throw new InvalidOperationException("UniGetUI is not running or has no IPC token.");
using var client = new IpcClient(reg.ToTransportOptions(), reg.Token);

Try / catch

try { await client.DoAuthenticatedCallAsync(); }
catch (InvalidOperationException ex) when (ex.Message.Contains("token is not available"))
{ /* start UniGetUI, rediscover endpoint, rebuild client with token */ }

Prevention

When it happens

Trigger: Constructing an IpcClient without a token and then calling any authenticated method. Discovering endpoints when none have a token persisted. The token file/registration being unreadable or absent because UniGetUI is not running or has not yet written its IPC token.

Common situations: UniGetUI is not running, so no endpoint registration (and thus no token) exists. Calling IPC before the app has finished booting and written its token. Manually constructing a client for testing without passing the token. Stale registration left over after the app crashed without cleaning up.

Related errors


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

Appendix: source

Thrown at src/UniGetUI.Interface.IpcApi/IpcClient.cs:1488

    private static bool IsProcessRunning(int processId)
    {
        try
        {
            using Process process = Process.GetProcessById(processId);
            return !process.HasExited;
        }
        catch (Exception)
        {
            return false;
        }
    }

    private void EnsureTokenAvailable()
    {
        if (string.IsNullOrWhiteSpace(_token))
        {
            throw new InvalidOperationException(
                "The IPC API token is not available. Start UniGetUI and try again."
            );
        }
    }

    private static string BuildRelativeUri(
        string relativePath,
        IReadOnlyDictionary<string, string>? queryParameters
    )
    {
        if (queryParameters is null || queryParameters.Count == 0)
        {
            return relativePath;
        }

        string query = string.Join(
            "&",
            queryParameters.Select(pair =>

View on GitHub (pinned to 9b1d7d0eab)