Error: DOS Header magic not found

Hi all, I’ve noticed a really bizarre issue when trying to configure some games. While changing configurations for most games seem to be fine, other games like Warhammer Chaosbane comes up with an error window saying “Lutris has encountered an error ‘DOS header magic not found.’” I have tried searching for a solution before posting here but I couldn’t find anything on what I’ve encountered, not saying it’s an issue exclusive to me but potentially a problem that’s not been caught yet.

The game seems to run and play fine with no real issues, the error only appears when trying to edit the configuration, which in turn doesn’t save the config.

Here’s the error details in full:

'DOS Header magic not found.'

Traceback (most recent call last):

  File "/usr/lib/python3.12/site-packages/lutris/", line 108, in error_wrapper
    return handler(*args, **kwargs)

  File "/usr/lib/python3.12/site-packages/lutris/gui/config/", line 688, in on_save

  File "/usr/lib/python3.12/site-packages/lutris/runners/", line 1243, in extract_icon
    extractor = ExtractIcon(self.game_exe)

  File "/usr/lib/python3.12/site-packages/lutris/util/wine/", line 28, in __init__ = pefile.PE(filepath)

  File "/usr/lib/python3.12/site-packages/", line 2895, in __init__
    self.__parse__(name, data, fast_load)

  File "/usr/lib/python3.12/site-packages/", line 3031, in __parse__
    raise PEFormatError("DOS Header magic not found.")

pefile.PEFormatError: 'DOS Header magic not found.'

Am I missing some kind of dependency that’s stopping configs for certain games from saving? Or is it more something in the prefix itself that’s causing the problem? Would really appreciate some insight into this problem because it’s been a real thorn in my side lately.

  Kernel: 6.9.2-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 14.1.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=c87e17cf-c2aa-4cb7-9b3f-535b1b50e245 rw rootflags=subvol=@
    quiet quiet rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
  Desktop: KDE Plasma v: 6.0.5 tk: Qt v: N/A info: frameworks v: 6.2.0
    wm: kwin_wayland vt: 2 dm: 1: GDM v: 46.0 2: SDDM note: stopped
    Distro: Garuda base: Arch Linux
  Type: Desktop System: Tactus product: Custom v: N/A
    serial: <superuser required>
  Mobo: ASUSTeK model: ROG STRIX X570-E GAMING WIFI II v: Rev X.0x
    serial: <superuser required> part-nu: SKU uuid: <superuser required>
    UEFI: American Megatrends v: 5003 date: 10/07/2023
  Info: model: AMD Ryzen 9 5900X bits: 64 type: MT MCP arch: Zen 3+ gen: 4
    level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25)
    model-id: 0x21 (33) stepping: 2 microcode: 0xA20120E
  Topology: cpus: 1x cores: 12 tpc: 2 threads: 24 smt: enabled cache:
    L1: 768 KiB desc: d-12x32 KiB; i-12x32 KiB L2: 6 MiB desc: 12x512 KiB
    L3: 64 MiB desc: 2x32 MiB
  Speed (MHz): avg: 3757 high: 3900 min/max: 2200/5218 boost: disabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 3900 2: 3900
    3: 3895 4: 3898 5: 3898 6: 2200 7: 3899 8: 3900 9: 3899 10: 3899 11: 3899
    12: 3896 13: 3890 14: 2200 15: 3899 16: 3900 17: 3900 18: 3900 19: 3900
    20: 3898 21: 3900 22: 3898 23: 3900 24: 3900 bogomips: 187201
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
  Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] vendor: Gigabyte
    driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm)
    built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16 ports:
    active: DP-1,DP-2 empty: HDMI-A-1,HDMI-A-2,Writeback-1 bus-ID: 0c:00.0
    chip-ID: 1002:73bf class-ID: 0300
  Display: wayland server: v: with: Xwayland v: 24.1.0
    compositor: kwin_wayland driver: X: loaded: N/A failed: amdgpu dri: radeonsi
    gpu: amdgpu d-rect: 5120x1440 display-ID: 0
  Monitor-1: DP-1 pos: primary,left res: 2560x1440 size: N/A modes: N/A
  Monitor-2: DP-2 pos: right res: 2560x1440 size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast surfaceless: drv: radeonsi wayland: drv: radeonsi x11:
    drv: radeonsi inactive: gbm
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.0.8-arch1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 6800 XT (radeonsi
    navi21 LLVM 17.0.6 DRM 3.57 6.9.2-zen1-1-zen) device-ID: 1002:73bf
    memory: 15.62 GiB unified: no display-ID: :0.0
  API: Vulkan v: 1.3.279 layers: 11 device: 0 type: discrete-gpu name: AMD
    Radeon RX 6800 XT (RADV NAVI21) driver: mesa radv v: 24.0.8-arch1.1
    device-ID: 1002:73bf surfaces: xcb,xlib,wayland device: 1 type: cpu
    name: llvmpipe (LLVM 17.0.6 256 bits) driver: mesa llvmpipe
    v: 24.0.8-arch1.1 (LLVM 17.0.6) device-ID: 10005:0000
    surfaces: xcb,xlib,wayland
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie:
    gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 0c:00.1 chip-ID: 1002:ab28
    class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 0e:00.4 chip-ID: 1022:1487 class-ID: 0403
  Device-3: Creative Pebble V3 driver: hid-generic,snd-usb-audio,usbhid
    type: USB rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-2:2
    chip-ID: 041e:3272 class-ID: 0300 serial: <filter>
  Device-4: RODE Microphones NT-USB driver: hid-generic,snd-usb-audio,usbhid
    type: USB rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-4:3
    chip-ID: 19f7:0003 class-ID: 0300
  API: ALSA v: k6.9.2-zen1-1-zen status: kernel-api with: aoss
    type: oss-emulator tools: N/A
  Server-1: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
  Device-1: MEDIATEK MT7921K Wi-Fi 6E 80MHz driver: mt7921e v: kernel pcie:
    gen: 2 speed: 5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 14c3:0608
    class-ID: 0280
  IF: wlp4s0 state: up mac: <filter>
  Device-2: Realtek RTL8125 2.5GbE vendor: ASUSTeK driver: r8169 v: kernel
    pcie: gen: 2 speed: 5 GT/s lanes: 1 port: e000 bus-ID: 05:00.0
    chip-ID: 10ec:8125 class-ID: 0200
  IF: enp5s0 state: down mac: <filter>
  Device-3: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: kernel
    pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 06:00.0
    chip-ID: 8086:1539 class-ID: 0200
  IF: enp6s0 state: up speed: 100 Mbps duplex: full mac: <filter>
  Device-4: ASUSTek ROG KERIS WIRELESS driver: hid-generic,usbhid type: USB
    rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 5-1:2 chip-ID: 0b05:195e
    class-ID: 0300
  Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
  Device-1: MediaTek Wireless_Device driver: btusb v: 0.8 type: USB rev: 2.1
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-6:5 chip-ID: 0e8d:0608
    class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.2
    lmp-v: 11 status: discoverable: no pairing: no class-ID: 6c0104
  Local Storage: total: 8.19 TiB used: 5.56 TiB (67.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Seagate model: FireCuda 530
    ZP1000GM30013 size: 931.51 GiB block-size: physical: 512 B logical: 512 B
    speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter> fw-rev: SU6SM001
    temp: 42.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 870 QVO 2TB
    size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 2B6Q
  ID-3: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST2000DM008-2FR102
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 7200 serial: <filter> fw-rev: 0001
  ID-4: /dev/sdc maj-min: 8:32 vendor: Seagate model: ST4000NE001-2MA101
    size: 3.64 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 7200 serial: <filter> fw-rev: EN01
  ID-1: / raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 493.71 GiB (53.0%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 584 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 493.71 GiB (53.0%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 493.71 GiB (53.0%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 493.71 GiB (53.0%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 62.71 GiB used: 183.5 MiB (0.3%)
    priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 24
    dev: /dev/zram0
  System Temperatures: cpu: 44.0 C mobo: 37.0 C gpu: amdgpu temp: 58.0 C
    mem: 58.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 928
  Memory: total: 64 GiB note: est. available: 62.71 GiB
    used: 13.95 GiB (22.2%)
  Processes: 513 Power: uptime: 6h 7m states: freeze,mem,disk suspend: deep
    avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 25.06 GiB services: org_kde_powerdevil,upowerd
    Init: systemd v: 255 default: graphical tool: systemctl
  Packages: 1816 pm: pacman pkgs: 1793 libs: 501 tools: paru,yay pm: flatpak
    pkgs: 23 Compilers: clang: 17.0.6 gcc: 14.1.1 Shell: garuda-inxi
    default: Bash v: 5.2.26 running-in: gnome-terminal inxi: 3.3.34
Garuda (2.6.26-1):
  System install date:     2023-06-21
  Last full system update: 2024-05-29
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       No/Undetected
  Failed units:

You have the Python module pefile installed - and lutris only uses it if installed - I don’t have it and Lutris works happily. Saying that, I wouldn’t recommend removing it unless you know another bit of software isn’t using it.

It needs a valid corresponding reference in a magic database for the file it is parsing. The default magic database(s) has a lot of file type info, but it certainly isn’t total coverage.
You might want to start by checking your libmagic packages, and that python3-magic is also installed.

If it is just one specific game breaking, then it might be a custom file which isn’t handled, in which case you’re going to need to run lutris debug info to get to the bottom of what file is being parsed that is generating the error. Either way, it might also be that lutris needs to handle that error.

Hey there! Thanks for replying, I hope you don’t mind a big reply because what I ended up discovering is quite the doozy. I did download the “python-magic” package and ended up getting an interesting result. Out of the games mentioned, downloading that package did seem to stop the error during configuration for Killing Time, as far as I could tell. However the issue persisted for Warhammer Chaosbane and XCOM, though since I haven’t properly started XCOM yet, I decided to get rid of that whole game’s prefix and redownloaded from scratch and now that game seems to work, leaving only Warhammer with the error.

I did however do more tinkering with the Chaosbane configuration and found a most peculiar solution/workaround; I was testing to see if it was the Lutris entry that was the problem, the prefix or the game folder itself and I believe I may have found the issue… It’s the icon selection in the configuration. For some reason if I leave the configuration with the blank Lutris icon, the error occurs, but if I select any other icon and it can be a completely random one, then the error no longer happens.

However if I revert the icon back to the Lutris icon then the error occurs again and can be a pain to get Lutris to recognise other .ico files, saying it can’t “find a path” to it despite having no issue selecting it before. But upon tinkering selecting a random .png and then going back to the previous .ico file it could be used again. But even then the error seems to be solved even by using a random .png selected as the icon.

Needless to say it’s an extremely weird and bizarre issue I’ve encountered, I’m not sure if this is affecting Lutris as a whole or if it’s something on my end that’s causing Lutris to behave really strangely. But for now, selecting a random icon does seem to be a decent workaround. Just note that the default Lutris icon doesn’t throw an error up for all game entries in Lutris, it only seems to affect certain games, seemingly GOG games especially, creating my own manual entries doesn’t seem to have this issue as far as I can tell.

I must also note all the games mentioned were already on my drive when I was on a different distro, so perhaps that could also be a part of the problem? Nevertheless, I hope the Lutris team looks into this in case it’s a much bigger issue that’s yet to be addressed.

Edit: You’ve posted it on GitHub issues and got some input already :+1: hopefully they can get to the bottom of why, or at least improve the error handling.

1 Like

I did indeed :slight_smile: Trying my best to be as detailed and helpful as possible for the team, so fingers crossed they figure it out!