Skip to content

Windows GUI app's log redirect delivers no output when the app is launched from the Start menu #3768

Closed

Description

@malibio

Overview

On Windows, the GUI app redirects its own stdout and stderr to %USERPROFILE%\.nodespace\logs\nodespace-app.log and nodespace-app-error.log at startup, so eprintln!/println!/tracing output of a console-less release build is not discarded. When the app is launched from the Start menu, which is how users and the autorun entry launch it, nothing reaches those files. Launched from PowerShell or from the installer's finish screen, the same binary logs normally.

Problem Statement

Observed on the published v0.3.5 release installer and on a build of main containing the models-directory fix, both release builds, on Windows 11 24H2 ARM64 in a virtual machine running the x64 build under emulation.

Launch Method GUI output in nodespace-app.log
after a fresh v0.3.5 install installer finish screen yes (2,091 bytes of INFO lines)
three launches after a reboot Start menu no
after reinstalling a newer build installer finish screen yes
three relaunches Start menu no
relaunch after deleting the daemon sidecars Start menu no, although the sidecars were re-extracted
one launch PowerShell (& 'C:\Program Files\NodeSpace\nodespace-app.exe') yes, startup through shutdown
one launch after that Start menu no

In a silent launch the GUI process is running its normal startup (it spawns the daemon one second later), the redirect's two files exist, and an exclusive open of either file fails with a sharing violation while the app runs and succeeds after it quits, so the redirect's handle is held. The println! fired by View → Toggle Sidebar (used from the menu bar) does not land either, so it is not specific to tracing.

Ruled out:

  • HOME unset: home_dir() in daemon_setup.rs is dirs::home_dir().
  • File open mode: open_daemon_log is create(true).append(true).
  • File state: the files were deleted and recreated, and still received nothing.
  • Tracing filter: the default nodespace_app=info is a string-prefix match that includes nodespace_app_lib.
  • Sidecar extraction: a launch that re-extracted both sidecars was still silent.
  • An OS update: the same OS build produced both logging and silent launches.
  • Nothing in the app crates calls AllocConsole, AttachConsole, FreeConsole or a second SetStdHandle.

Not determined: the mechanism, and whether it reproduces on x64 hardware outside a VM and emulation.

Proposed Solution

Find why the standard handles installed by redirect_gui_stdio_to_log_files do not carry output for a process started without inherited standard handles, and make output reach the log files in the Start-menu launch path, which is the one that matters.

Documentation

  • installer-distribution.md - how the daemon's log is handed over by the GUI app on Windows and rotated; it does not describe the GUI process's own log files, and should once this is settled
  • No ADR found covering the GUI process's own stdio redirect.

Acceptance Criteria

  • A release build launched from the Start menu on Windows writes its tracing output and its println!/eprintln! output to nodespace-app.log / nodespace-app-error.log
  • The same holds for a launch from PowerShell, from the installer's finish screen, and from the autorun entry
  • A test or scripted check exercises a launch with no inherited standard handles, the case the earlier verification harness did not cover, and fails against the current code
  • The documentation describes where the GUI process's own logs go

Technical Specifications

Reference Files

  • packages/desktop-app/app-lib/src/daemon_setup.rs (redirect_gui_stdio_to_log_files, redirect_std_handle_to_file, open_daemon_log) - the redirect
  • packages/desktop-app/app-lib/src/lib.rs (run, run_app) - where the redirect is called, before the tracing subscriber is initialized
  • packages/desktop-app/src-tauri/src/main.rs - windows_subsystem = "windows" for release builds

Investigation notes

  • The original verification used a standalone windows_subsystem = "windows" program launched with cmd /c start /WAIT, which may inherit handles that a Start-menu launch does not have.
  • The three launch methods that logged all pass the process standard handles from a parent (a console, or the installer).

Related Issues

Activity

  1. self-assigned this
    on Oct 13, 2026
  2. malibio commented on Oct 13, 2026

    @malibio
    CollaboratorAuthor

    Frontend: 5899 passed (326 files)

  3. added a commit that references this issue on Oct 13, 2026
    3540720
  4. added a commit that references this issue on Oct 13, 2026
    08ef1fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions