Doctor
warpzone doctor [--config PATH] checks the machine it runs on and prints a checklist,
in the spirit of flutter doctor: one line per check with a mark, a short detail and,
for every problem, the exact fix for this platform.
- Offline and read-only. It never installs, writes or deletes anything. The only
network-like probe is
GET /rest/system/pingon the local Syncthing, and only when its GUI address is a loopback one (a wildcard address is probed as127.0.0.1), with a 2-second timeout; the key comes from the localconfig.xmland is sent as a header, never printed.RA_API_KEYis reported as “set” or “not set”, nothing else. - Statuses.
[ok];[! ]warning (works, worth a look: DATs older than 180 days, less than 20 GiB free on the hub, a tool that is onPATHbut thatinboxwill not use);[!!]problem;[--]optional and not set up. Only[!!]counts for the exit code. - What is required. Nothing is required of a feature the machine does not use. A
missing config file or a missing
[hub],[devices]or[inbox]table is[--], and the line says what the table would enable. The exception is a config with only an[inbox]table (a machine that just files games):[hub]and[devices]are then one[ok]note, “not used here”, instead of two[--]items. A config with no[inbox]table (or no config at all) collapses the optional inbox-only items (the tools, the Switchtitledb_dirandswitch_keys, the DAT folder and arcade DATs, the hub folder andRA_API_KEY) into one[ok]line saying inbox is not set up on this machine (collapse_inbox, pure); items that are[ok],[! ]or[!!]stay. Once an[inbox]table exists,chdman,bsdtar,dats_dir, the hub root withinbox/andlibrary/roms/become required.RAHasher,dolphin-toolandnszare always optional, and so are the Switchtitledb_dirandswitch_keys(a configured path that does not exist is a problem; the keys file is only checked to exist, never read). The three arcade DAT paths (mame_dat,fbneo_dat,mame2003plus_dat) are[--]when unset,[!!]when set to something that is not a file (inboxrefuses to start) and[ok]otherwise. A config that does not load, a configured tool path that is not executable, a tool that cannot run, a local Syncthing whose API does not answer, and Python older than 3.11 are always problems. - Hub API. In the config group, from the config alone (doctor never contacts the hub):
[ok]forhttps://withapi_cert_sha256(“pinned”;warpzone checkproves the pin matches), forhttps://on loopback and forhttps://elsewhere without a pin (with a note that Syncthing’s own self-signed certificate fails default verification);[! ]for plainhttp://away from loopback, because the API key crosses the network in the clear, with the fix “use https:// and set hub.api_cert_sha256”. Plainhttp://on loopback says nothing. An invalid pin, or a pin withhttp://, is a config error like any other (judge_hub_api, pure). - Where inbox runs.
warpzone inboxruns on a computer that mounts the hub’s share or in the hub container (see Inbox), and with an[inbox]tabledoctorchecks the way in use, found from the machine and never asked. The probeProbes.in_containeris true when the runtime left a marker in the root of the container (/.dockerenvfor Docker,/run/.containerenvfor Podman); tests replace it.Where inbox runssays which way it found. On a computer the tool checks are the ones above (the[inbox]path, elsePATH) with the install command of the platform as fix. In the container they differ in four ways. The tools are the image’s: besidesPATH, a tool is looked for where the image puts it (IMAGE_TOOL_PATHS, today/usr/local/bin/RAHasher;known_tool_pathsis pure), andRAHasherfound there with no[inbox] rahasheris[! ]with the line to set. A missing tool has the fix “this hub image does not ship it” (run inbox on a computer, or build the image with it) instead of an install command (IMAGE_MISSING_TOOL; a tool with an entry inIMAGE_TOOL_HINTShas its own), since the root of a container is read-only and rebuilt from the image;chdmanandbsdtarstay[!!]there as on a computer, so an image without them fails (the image ships both from Debian packages, in/usr/bin, soPATHfinds them andIMAGE_TOOL_PATHSlists only the tools outsidePATH).dolphin-tool,nszandorbis-pkg-utilare in/usr/local/bin, also onPATH, so they are[ok]with no setting; Vita3K is in/usr/local/binon x86_64 only (the image built on another CPU has none), so it is[ok]there with no setting, and[--]on an arm64 image with the fix ofIMAGE_TOOL_HINTS: the image ships it on x86_64 only. The CIimagejob (amd64) runsdoctorin the built image and fails when a tool of the image, Vita3K included, is not[ok].Hub root for inboxis[! ]when[inbox] rootis unset but[hub] rootis there, becauseinboxneeds its ownroot(the same path as[hub] rootin the container).Work folderis[! ]whenwork_diris unset (/tmpis memory in the container), or when it does not exist and its parent is not a writable folder (inboxcreates the folder itself, so a missing leaf under a mounted parent is[ok]with “created on the first run”), and the missing-DATs fix says to mount a folder. Image tools that cannot run (a wrong architecture) are[!!]with “build the image again”.chdman memory(check_chdman_flac, one line in the same group, with an[inbox]table) is[! ]with the fixchdman_flac = falsewhen[inbox] chdman_flacistrue(the default) and inbox runs in the container or the memory available to it is below 8 GiB; otherwise there is no line. The memory is the cgroup limit of the process, read throughProbes.memory_limit(/sys/fs/cgroup/memory.max, else the v1memory/memory.limit_in_bytes;maxor a huge number is no limit,parse_memory_limitis pure), andjudge_chdman_flacis the pure judge. See Inbox. - Skyscraper. With an
[inbox]table, two lines in the inbox tools group (see Scraping):Skyscraperis[ok]with its version,[--]when not found and not configured (inboxthen does not scrape),[!!]when the configured path does not exist, is not executable or does not run, and[! ]when the version is older than 3.21.1.ScreenScraper accountappears only when Skyscraper is found:[ok]when auserCredskey is in[screenscraper]of itsconfig.ini,[--](anonymous, with the limits) otherwise. The value is never read; the check is a pure function of the file’s lines. In the hub container Skyscraper is in the image and is checked like anywhere else, with itsconfig.inion the volumeWARPZONE_SKYSCRAPER_DIRnames (/skyscraper); without that volume the line is[--](“nothing is mounted at /skyscraper”) with the fix to mount it, and Skyscraper is not run. - Nightly scrape. In the same inbox tools group, right after
Skyscraper(and its account line), under the same conditions asUnattended inbox: an[inbox]table and a hub root that can be read, on a computer as well as in the container, because the state is on the share.judge_nightly(pure, indoctor_scrape.pyand re-exported bydoctor.py) judges the state filecatalog/scrape/state.jsonand the newest run record undercatalog/scrape/runs/, against the clock; the check only reads them through the probes. No state file is[--]with the fix that scheduleswarpzone scrape --unattended; a run-level error is[!!];[! ]for a last check more than 36 hours old, a trouble streak at or above its threshold and a quota streak of 3 nights or more;[ok]with the last run (dated from the state), its counts and what is left, with the nights that takes when the last run ended on its cap or its time budget (the run’s size is the games Skyscraper was asked about, from the record; a last run with no record of its own, such as a busy night, shows its outcome in words instead of counts). A state file the parser could not read whole shows the parser’s warning on the line. Findings share the line, the worst status first. The rules are in Unattended scrape.healthdoes not read it. - Leftover folders. On a configured device,
Leftover foldersis[! ]when the local Syncthingconfig.xmlhas awz-*folder that none of the device’s config describes (a group taken out of itsfolders), and says nothing otherwise. Doctor is offline, so it finds the device as forsettings: the configured device whose ID is listed inconfig.xmland one of whose folders is there at the path the config gives it (the hub lists the same IDs but keeps its folders under its own root, so it gets no line). The text isprovision_folders.undescribed(pure), the oneprovision deviceprints as a warning; the fix says to put the group back indevices.<name>.foldersand runwarpzone provision device <name>, or to remove the folders in the device’s Syncthing (their files stay). Nothing indoctororhealthreported such a folder before. - Game Mode (SteamOS). With a local Syncthing on SteamOS,
Game Modesays whether Syncthing runs without a desktop session. Game Mode starts no desktop session, so~/.config/autostart/*.desktopentries never run there; only a systemd user unit does.judge_game_modeis pure over the.servicefiles of~/.config/systemd/user(anExecStartthat runs syncthing), the names linked in itsdefault.target.wants(enabled) and the autostart entries (anExecthat runs syncthing). An enabled unit is[ok]; with an autostart entry as well it is[! ](two instances compete for the port); an autostart entry alone, a unit that is not enabled, or nothing at all is[! ]with a fix that shows a minimal unit for the SyncThingy flatpak (ExecStart=/usr/bin/flatpak run --command=syncthing com.github.zocker_160.SyncThingy serve --no-browser --no-restart),systemctl --user enable --now syncthing.serviceand, when there is one, the autostart entry to remove. Fix lines that start with a space are code and are never wrapped. The unit hasExecStop=/usr/bin/flatpak kill com.github.zocker_160.SyncThingy:flatpak runputs the process in a scope of its own, sosystemctl --user stopdoes not reach it.Syncthing unit(judge_unit_state, pure oversystemctl --user show -p ActiveState,SubState syncthing) is[ok]when the unit is active, says nothing when it is stopped or absent, and is[! ]when it isactivatingor inauto-restart(a start that keeps failing, normally the old process holding the port), with the fix:flatpak kill, the unit withExecStopunless the unit already has one, and a restart. The flatpak app id and its commands live inwarpzone/flatpak.py. - Flatpak access. With the SyncThingy flatpak as the local Syncthing (its
config.xmlis in the flatpak’s own folder),Flatpak accessreadsflatpak override --user --showand compares it with the folders under~/.var/app/<app>that the configured devices’ profiles use (every shipped profile when the config does not load), for the apps that are installed. Missing overrides are[!!], because those save folders sync nothing; the fix is oneflatpak overrideper app plus a restart.granted_appsandmissing_appsinwarpzone/flatpak.pyare pure. A native Syncthing is not checked. - Flycast VMUs. When RetroArch’s
Flycast.optexists,judge_flycast_vmus(pure, over the file text) readsreicast_per_content_vmus:VMU A1andAll VMUsare[ok];disabled(the core’s default; the valid values aredisabled,VMU A1andAll VMUs, fromlibretro_core_options.hin the upstream Flycast repository) or a missing key is[! ], because the core then writes the shared VMUs intobios/dc, which the profile’s library ignores (/bios/dc/vmu_save_*.bin,/bios/dc/dc_nvmem.bin) keep out of sync. The fix names the core option to change. - Vita3K user. When
~/.config/Vita3K/config.ymlhas auser-id:,judge_vita3k_user(pure) is[ok]for00and[! ]for anything else: the profile syncsux0/user/00/savedataonly. A missing file or key says nothing. - Emulator settings. On a device whose config subscribes it to
settings. Doctor is offline, so it finds the device in the local Syncthingconfig.xml: the configured device whose ID is listed there and whosepaths.settingsis the path of thewz-settingsfolder (the hub lists the same IDs but keeps that folder under its own root, so it gets no such lines); with no local Syncthing, or no such device, the group is silent. The lines areSettings layers(the localwz-settingsfolder and its marker exist,[!!]if not;common.tomland the device’s layer parse and validate; a conflict copy or a secret key in a layer is[!!], an unknown emulator or file id[! ]);ES-DE startup script(present, executable, and its interpreter exists,[! ]otherwise withwarpzone provision device <name>as the fix;CustomEventScriptsnottrueines_settings.xmlis[! ]withwarpzone provision device <name>run with ES-DE closed, or the menu path, as the fix);Last settings apply(fromlast-apply.json, whosetime,exit,writtenandheldfields it reads: a failed run is[! ]with the log path, held keys are[! ]withwarpzone settings captureas the fix, no run yet is[--]). The script and theCustomEventScriptsjudges share the oneES-DE startup scriptline, which shows the text of whichever is not[ok]; a missinges_settings.xmlis[! ]too (start ES-DE once).judge_settings_layers,judge_esde_script,judge_event_scriptsandjudge_last_applyare pure. - Frontend. On a device whose config subscribes it to
libraryand whose profile has[es_systems]or[retroarch]. The device is found as forsettings, through thewz-libraryfolder in the local Syncthingconfig.xml(its path ispaths.library); any other machine, and a profile without those tables, gets no line.ES systems overrideis[ok]when the override is exactlyrewrite_system_pathsof the source; missing or out of date (the source changed, or someone edited it) is[! ], and so is a missing source.RetroArch pathsreads each file ofcfgand is[ok]when every wanted key has its value; a key that differs is named with its current value, a missing file or a key present twice is[! ]. The fix iswarpzone provision device <name>with the frontend or RetroArch closed.judge_systems_overrideandjudge_retroarch_pathsare pure. A device whose profile has[artwork]and whose config listsfrontendgets two more lines.Frontend artworkplans the gamelists exactly asfrontend refreshwould (artwork.plan_gamelists, with the reads going through the probes) and is[ok]when every gamelist is current,[! ]when some are missing, unreadable or stale (named, withwarpzone frontend refresh <name>as the fix, frontend closed; for an unreadable one the fix adds that the refresh keeps a copy first), when no scraped gamelist has arrived yet for the systems on the device (the sync is the thing to look at), or when the system list or a scraped file is unreadable.Artwork timer(only when the profile setsrefresh) is[ok]whenwarpzone-artwork.timeris installed and[! ]otherwise.judge_artworkis pure. A device whose profile has[shadps4.launch]also getsshadPS4 version: the emulator the launch script would run, found the way the script finds it (shadps4.select_version, pure: theversionSelected=line ofqt_ui.ini, then thepathentries ofversions.jsonin order, each an executable AppImage or a folder holdingShadps4-sdl.AppImage; the tests run the script and doctor on the same fixtures).[ok]names it. With none, ES-DE shows nothing (the script’s stderr goes nowhere), so it is[! ]while the device holds no PS4 games (a file inroms/ps4/games) and[!!]once it does, with the fix “open the shadPS4 Qt launcher, go to Version Manager, then download and select a version” and the log~/.local/state/warpzone/shadps4-launch.log.judge_shadps4_versionis pure. - Unattended prune. Group
Pruning, on a device found throughwz-library(as for the frontend) whose config subscribes it tolibrarywithoutauto_prune = false. One line,Unattended prune:judge_prune_guard(pure) is[ok]whenprune-guard.jsonis not in~/.local/state/warpzone, and[! ]when it is: the folders the timer’s run refused to touch because they would lose more than half of what the device holds, how long ago, and as the fixwarpzone prune <name>to review andwarpzone prune <name> --applyby hand. A file that does not parse is[! ]too, with the same fix, which rewrites it. The file and the rules that write and clear it are in Unattended runs. It is never[!!]: nothing is broken, a removal is waiting for a person. - Unattended inbox. Group
Inbox, with an[inbox]table and a hub root that can be read ([inbox] root, else[hub] root; without oneHub folderalready says so), on a computer as well as in the container, because the state is on the share. One line,Unattended inbox:judge_unattended_inbox(pure, indoctor_inbox.pyand re-exported bydoctor.py) judges the state filecatalog/inbox/state.json, the newest run record undercatalog/inbox/runs/and the age of the lockinbox/.warpzone.lock, against the clock; the check only reads them through the probes (is_file,read_text,list_dir,mtime,now). No state file is[--](no unattended run has recorded anything) with the fix that schedules the task, so a hub that does not use the feature is not alarmed. Otherwise a run-level error is[!!](its message, since when, how many runs, and the fix its step implies);[! ]for a last check more than two hours old, held items, an item waiting more than two hours sincefirst, and a lock held more than six hours;[ok]with the last check and the last run. Findings share the line, the worst status first. The rules are in Unattended inbox.healthdoes not read it. - Exit codes.
0when no check is a problem,1otherwise. - Install hints live in one table in
warpzone/doctor_hints.py(the*_HINTSdicts, withTOOLSinwarpzone/doctor_tools.py), keyed by platform family:macos,debian,fedora,arch,steamos,linux(any other Linux) andother, with ananyfallback. A hint is added only when it is known to be right for that family. SteamOS has a read-only root, so its hints point at a container instead of a system package. - Structure. Each check is a function of a
Contextthat returnsResultrecords (name, group, status, detail, fix). Everything it reads from the machine (which, running a tool, the environment, the home folder, the clock, free space, the HTTP probe) is a field ofProbes, so the tests use fakes and no real tools.renderandexit_codeare pure.renderwraps details and fixes to the terminal width (shutil.get_terminal_size, 100 when it is unknown, never narrower than 30 columns of text): continuation lines hang under the start of the detail, a fix under its text, and a word longer than the line (a path, a URL) is never cut. The config is read as far as it can be: the[inbox]values are used by the other checks even when another table is invalid.