Skip to content

bug: frontend: a pre-31 config without LastVersion is not migrated; the hidden first-run wizard disables all outputs #815

Closed

Description

@vpacher

Summary

A config from OBS before 31.0 is not migrated when its global.ini has no [General] LastVersion. OBS writes LastVersion only on a clean exit, so this happens when OBS never exited cleanly: for example when it runs as a service and is always stopped with a signal it does not handle, or killed.

The user settings then stay in global.ini, user.ini starts empty, and the first start opens the auto-configuration wizard as for a fresh install. While the wizard is open, all outputs are disabled (AutoConfig calls EnableOutputs(false)): recording, streaming, the replay buffer and the virtual camera do not start. On a headless or unattended host, nobody sees the wizard, so the outputs stay disabled until someone closes it.

The fork reaches this path on its first start after MigrateRustConfiguration() copied an upstream 30.x config. Upstream OBS 31+ has the same code.

Location

frontend/OBSApp.cpp OBSApp::InitGlobalConfig():

	uint32_t lastVersion = config_get_int(appConfig, "General", "LastVersion");

	if (lastVersion && lastVersion < MAKE_SEMANTIC_VERSION(31, 0, 0)) {
		bool migratedUserSettings = config_get_bool(appConfig, "General", "Pre31Migrated");

		if (!migratedUserSettings) {
			bool migrated = MigrateGlobalSettings();

With lastVersion == 0, the migration is skipped. Then OBSBasic::OBSInit() reads FirstRun from the (empty) user config and, because has_last_version is false too, queues on_autoConfigure_triggered.

Class

Logic error: a legacy config is treated as a fresh install. The user settings are not migrated, and the outputs are disabled by a dialog nobody can see.

How it is reached

Reproduced with the master build (aaed86f) on Debian 13, headless, OBS started by a systemd unit:

  1. A ~/.config/obs-studio written by OBS 30.2.3 (Debian package) that was always stopped by SIGTERM, so global.ini has [General] FirstRun=true but no LastVersion.
  2. Start the fork. It copies the config to obs-studio-rust and starts.
  3. user.ini has only defaults. The "Auto-Configuration Wizard" window is open on the X display. A websocket StartRecord returns success, but no recording starts and nothing is logged.

Proposed fix and failing test

Fix: also migrate when LastVersion is missing, if global.ini has [General] FirstRun and user.ini does not exist.

  • OBS before 31.0 writes FirstRun to global.ini on its first start. OBS 31.0 and later write it to user.ini. A fresh install has no FirstRun in global.ini, so it still gets the wizard.
  • When user.ini already exists, do not migrate: MigrateGlobalSettings() would show an error box, which also blocks an unattended start.
  • With LastVersion set, nothing changes.

To make the decision testable without a display, move it into a small pure helper, frontend/utility/settings-migration.hpp (ShouldMigratePre31Settings()).

RED test (cmocka, test_settings_migration, no widgets), 6 cases:

  • no LastVersion, FirstRun in global.ini, no user.ini: migrate. Fails today.
  • fresh install (no LastVersion, no FirstRun): no migration. Passes before and after.
  • no LastVersion, FirstRun, but user.ini exists: no migration. Passes before and after.
  • LastVersion 30.2.3: migrate; already migrated: no; LastVersion 32.0: no. Pass before and after.

GREEN: the helper also migrates in the first case.

Activity

  1. vpacher commented on Oct 15, 2026

    @vpacher
    MemberAuthor

    Claiming: this issue.

    1. RED: move the decision into frontend/utility/settings-migration.hpp (ShouldMigratePre31Settings(), no change in behaviour) and add test_settings_migration (cmocka, no widgets). The case "no LastVersion, FirstRun in global.ini, no user.ini" fails.
    2. GREEN: the helper also migrates in that case. A fresh install and an existing user.ini are unchanged.
      PR today.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions