Skip to content

fix: resolve empty UUID startup crash loop#19

Merged
cgnl merged 1 commit into
mainfrom
fix/empty-uuid-startup-crash
Jun 27, 2026
Merged

fix: resolve empty UUID startup crash loop#19
cgnl merged 1 commit into
mainfrom
fix/empty-uuid-startup-crash

Conversation

@simonfr

@simonfr simonfr commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Resolves #10 and #17.

On initial boot, Plex Media Server tries to look up its device configuration in the database using an empty string ("") for the identifier bind parameter. When the C++ side of PMS handles this empty result (or attempts to parse the returned empty/invalid identifier as a UUID), it throws a Boost/C++ std::domain_error: Invalid uuid length exception, causing an immediate SIGABRT.

How the fix works:

  1. Adds an automatic extractor to the Rust interposer that parses Preferences.xml for MachineIdentifier and formats it as a standard 36-character hyphenated UUID.
  2. Hooks bind_text / bind_text64 to detect if the query targets the devices table and if the parameter index belongs specifically to the identifier column.
  3. If an empty string parameter is bound to identifier, the interposer replaces it on the fly with the parsed formatted UUID from the configuration before forwarding the query to PostgreSQL.
  4. Other empty parameters (like name or platform updates on devices) are safely ignored and remain untouched to avoid DB pollution.

Includes Rust unit tests covering the XML parsing and fallback behaviors.

@simonfr simonfr force-pushed the fix/empty-uuid-startup-crash branch from 60f5bc3 to 46dcfde Compare June 25, 2026 07:54
@simonfr simonfr force-pushed the fix/empty-uuid-startup-crash branch from 46dcfde to 0a6f1cc Compare June 25, 2026 08:02
@cgnl cgnl merged commit da87d29 into main Jun 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shim crash (segfault / "Invalid uuid length") after successful migration + multiple migration issues

2 participants