rocksdanister/lively · error · InvalidOperationException

Oops... Looks like something went wrong :( In order to bette

Error message

Oops... Looks like something went wrong :(
In order to better understand this error and fix the issue, share the log file with the developer.
Instructions for sharing log file:
https://github.com/rocksdanister/lively/wiki

What it means

Thrown by ExtPrograms (external-program wallpaper host) when the spawned process's window handle is IntPtr.Zero after WaitForProcessOrGameWindow times out — the process started but never produced a usable window. The message is the generic localized 'something went wrong, share logs' string.

Source

Thrown at src/Lively/Lively/Core/Wallpapers/ExtPrograms.cs:156

                */
            }
        }

        public async Task ShowAsync()
        {
            if (process is null)
                return;

            try
            {
                process.Exited += Proc_Exited;
                process.Start();
                Pid = process.Id;
                processWaitTask = process.WaitForProcessOrGameWindow(Category, timeOut, ctsProcessWait.Token, true);
                this.Handle = await processWaitTask;
                if (Handle.Equals(IntPtr.Zero))
                {
                    throw new InvalidOperationException(Properties.Resources.LivelyExceptionGeneral);
                }
                else
                {
                    //Program ready!
                    //TaskView crash fix
                    WindowUtil.BorderlessWinStyle(Handle);
                    WindowUtil.RemoveWindowFromTaskbar(Handle);
                }
                Loaded?.Invoke(this, EventArgs.Empty);
            }
            catch (Exception)
            {
                Terminate();

                throw;
            }
        }

View on GitHub (pinned to c1036feb66)

Solutions

  1. Run the same external program standalone and confirm a window appears — fix crashes/missing runtimes there first.
  2. Whitelist the program in antivirus/EDR and ensure it is not already running.
  3. Increase timeOut if the program is legitimately slow to render its window.
  4. Inspect the lively log (share link in the message) for the underlying process exit code.

Example fix

// before
if (Handle.Equals(IntPtr.Zero))
    throw new InvalidOperationException(Properties.Resources.LivelyExceptionGeneral);

// after — include the process name and exit code for diagnosability
if (Handle.Equals(IntPtr.Zero))
    throw new InvalidOperationException(
        $"{Properties.Resources.LivelyExceptionGeneral} (process={process.ProcessName}, exit={process.ExitCode})");
Defensive patterns

Strategy: validation

Validate before calling

// pre-flight: ensure the program runs standalone before assigning as wallpaper
var psi = new ProcessStartInfo(programPath) { UseShellExecute = false };
using var test = Process.Start(psi);
if (test == null || test.WaitForExit(timeoutMs)) { /* do not use as wallpaper */ }

Type guard

static bool CanHostExternally(string programPath)
    => File.Exists(programPath) && HasRequiredRuntime(programPath);

Try / catch

try { await wallpaper.StartAsync(); }
catch (InvalidOperationException ex) when (ex.Message == Properties.Resources.LivelyExceptionGeneral)
{ Log.Error($"External wallpaper '{programPath}' produced no window."); ShowErrorShareLogs(); }

Prevention

When it happens

Trigger: Launching an external-program wallpaper (e.g. a game/Unity/Godot bundle as wallpaper); process.Start() succeeds but no window handle appears within timeOut, so Handle stays zero and the throw fires.

Common situations: Required runtime missing (e.g. the program needs a specific .NET/VC++/Java); the program crashed silently on start; antivirus/EDR blocked window creation; the program is already running single-instance; timeout too short for a slow-loading app.

Related errors


AI-assisted analysis of rocksdanister/lively@c1036feb66 (2026-08-13). Data as JSON: /api/errors/129533e9daf2fd66. Report an issue: GitHub.