AsahiLinux / asahi-installer

Asahi Linux installer
MIT License
782 stars 103 forks source link

XML parsers expat error during installation #251

Closed zaiff5091 closed 1 month ago

zaiff5091 commented 6 months ago

Hello,

I'm trying to install Asahi Linux on my new M1 Mac mini by running curl https://alx.sh | sh but after I enter my sudo password I get this error:

Collecting system information...
root        : ERROR    Exception caught
Traceback (most recent call last):
  File "/private/tmp/asahi-install/main.py", line 1058, in <module>
    InstallerMain(installer_version).main()
  File "/private/tmp/asahi-install/main.py", line 831, in main
    self.sysinfo = system.SystemInfo()
  File "/private/tmp/asahi-install/system.py", line 8, in __init__
    self.fetch()
  File "/private/tmp/asahi-install/system.py", line 18, in fetch
    self.ioservice = plistlib.loads(result.stdout)
  File "/private/tmp/asahi-install/Frameworks/Python.framework/Versions/3.9/lib/python3.9/plistlib.py", line 883, in loads
    return load(fp, fmt=fmt, dict_type=dict_type)
  File "/private/tmp/asahi-install/Frameworks/Python.framework/Versions/3.9/lib/python3.9/plistlib.py", line 875, in load
    return p.parse(fp)
  File "/private/tmp/asahi-install/Frameworks/Python.framework/Versions/3.9/lib/python3.9/plistlib.py", line 177, in parse
    self.parser.ParseFile(fileobj)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 397925, column 38

Here is the log file: installer.log

Do you know where it could come from ?

eslerm commented 6 months ago

Do you get this error after rebooting and retrying?

How many Macos user accounts are there? If there is more than one, try using the other accounts (specifically the one used during initial Mac install).

If that doesn't help, try to print result.stdout before it is used.

What is the output from ioreg -alp IODeviceTree?

What is the output from ioreg -alp IOService?

(You might need sudo for those commands.)

zaiff5091 commented 6 months ago

No changes after reboot. I have only one user in this mac.

Sorry I'm not familiar with this, how could I print it before used ?

Outputs : ioreg_outputs.zip

eslerm commented 6 months ago

Thanks!

For whatever reason, your IOService output has a strange character on line 209567 (<string>SYNAS^P</string>) which the script doesn't know how to handle.

Reproduced with

import plistlib

with open('./asahi-ioreg-ioservice.xml', 'rb') as plist_file:
  ioservice = plistlib.load(plist_file)

Hopefully the devs here can advise or possibly handle these cases if its safe to do so. Perhaps an encoding needs to be enforced?

DubiousCactus commented 5 months ago

I am having the same issue on my new MacBook Air 2022 :(

zaiff5091 commented 5 months ago

I just found the problem, at least it worked for me.

I have one monitor on the HDMI port of the Mac Mini and a second one connected in HDMI to a USB-C hub (JSAUX Omnicase 2 Pro) plugged into one of the USB-C port of the Mac. I disconnected the hub and the installation directly worked.

I saw that in "asahi-ioreg-ioservice.xml" file, there was a line containing "SYNAS" with a strange letter after it that could cause some issues.

After trying to install, run this command : ioreg -alp IOService | grep 'SYNAS' -n

When I had my "usb-c hub with monitor" plugged, there was a line number in output of this command and the installation failed. If you have no output, relauch the installation and it should work.

Sorry for the strange explanation I'm not an expert of this types of things. If someone has a better way to explain what the meaning of this issue, don't hesitate I would be happy to read it!

DubiousCactus commented 5 months ago

Yes indeed, disconnecting my monitor did the trick! Thanks 👍 This issue should still be addressed though.

shaunduncan commented 2 months ago

For what it's worth I also ran into this issue and also have external monitors plugged in via HDMI and USB-C. Rather than unplug my monitor I just changed system.py to have result.stdout.replace(b'\x10', b'')

eslerm commented 1 month ago

@marcan this seems to regularly happen when an external display is connected.

Could hitting this error warn users about external display use?