Vanilla-OS / first-setup

This utility is meant to be used in Vanilla OS as a first-setup wizard. It takes care of the user choices.
GNU General Public License v3.0
72 stars 34 forks source link

First Setup Hangs Indefinitely After Fresh Install #331

Closed NN708 closed 4 weeks ago

NN708 commented 1 month ago

After a fresh install, the First Setup fails to complete, resulting in an indefinite installation process.

Screenshot

The following error messages were found in journalctl:

Sep 24 11:37:00 vanilla org.vanillaos.FirstSetup.desktop[2515]: rm -f /etc/vanilla-first-setup-done
Sep 24 11:37:00 vanilla pkexec[4066]: pam_unix(polkit-1:session): session opened for user root(uid=0) by vanilla(uid=1000)
Sep 24 11:37:00 vanilla vanilla-first-s[2515]: (../src/vtepty.cc:810):void vte_pty_spawn_with_fds_async(VtePty*, const char*, const char* const*, const char* const*, const int*, int, const int*, int, GSpawnFlags, GSpawnChildSetupFunc, gpointer, GDestroyNotify, int, GCancellable*, GAsyncReadyCallback, gpointer): runtime check failed: ((spawn_flags & ignored_spawn_flags()) == 0)
Sep 24 11:37:00 vanilla pkexec[4079]: pam_unix(polkit-1:session): session opened for user root(uid=0) by vanilla(uid=1000)
Sep 24 11:37:00 vanilla systemd[1795]: Started vte-spawn-ce39d28f-cc2d-4f2f-95e1-09a8142a4b36.scope - VTE child process 4079 launched by vanilla-first-setup process 2515.
Sep 24 11:37:01 vanilla vanilla-first-s[2515]: char* vte_terminal_get_text(VteTerminal*, VteSelectionFunc, gpointer, GArray*): assertion 'attributes == nullptr' failed
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]: Traceback (most recent call last):
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]:   File "/usr/share/org.vanillaos.FirstSetup/vanilla_first_setup/views/progress.py", line 150, in on_vte_child_exited
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]:     self.__window.set_installation_result(status, self.__terminal)
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]:   File "/usr/share/org.vanillaos.FirstSetup/vanilla_first_setup/window.py", line 190, in set_installation_result
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]:     self.__view_done.set_result(result, terminal)
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]:   File "/usr/share/org.vanillaos.FirstSetup/vanilla_first_setup/views/done.py", line 81, in set_result
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]:     if len(out) > 0:
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]:        ^^^^^^^^
Sep 24 11:37:01 vanilla org.vanillaos.FirstSetup.desktop[2515]: TypeError: object of type 'NoneType' has no len()
jardon commented 1 month ago

If I'm understanding this correctly, the stack trace is not where the error is. The logic only gets to that point if there is a previous failure. I could update it to avoid that specific error, but that doesn't solve whatever previous error tripped it up. Obviously, error handling failed us here.

Can you give me any more info about the environment? it would be helpful to reproduce

NN708 commented 1 month ago

Can you give me any more info about the environment? it would be helpful to reproduce

It's a desktop PC equipped with an Intel Core i7-13700K processor, 64 GB of RAM, a 1 TB SSD, and two 4 TB HDDs. I was performing a fresh installation on the SSD when the issue occurred. I can only reproduce this issue on this specific machine.

jardon commented 1 month ago

So it looks like the VTE terminal exited after the post_run commands finished. The terminal in question runs asynchronously here. It's hard to debug without a reproducable environment.

To confirm, this is a completely unmodified install? Could you share the recipe located at /usr/share/org.vanillaos.FirstSetup/recipe.json?

NN708 commented 1 month ago

Yes, it is an unmodified install. Here's the recipe file:

{
    "log_file": "/etc/vanilla/first-setup.log",
    "distro_name": "Vanilla OS",
    "distro_logo": "org.vanillaos.FirstSetup-flower",
    "pre_run": [
        "!nextBoot su - $REAL_USER -c \"flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo\""
    ],
    "post_run": [
        "sh -c /usr/bin/__first_setup_reset_session",
        "!nextBoot sh -c /usr/bin/__first_setup_cleanup",
        "!nextBoot !noRoot vso pico-init",
        "rm -f /etc/vanilla-first-setup-done"
    ],
    "tour_app": "vanilla-tour",
    "tour": {
        "get-involved": {
            "icon": "system-users-symbolic",
            "title": "Get Involved",
            "description": "Vanilla OS is a community project. You can contribute to the project by reporting bugs, suggesting new features, or even by writing code.",
            "read_more_link": "https://vanillaos.org/get-involved"
        },
        "community": {
            "icon": "help-faq-symbolic",
            "title": "Join The Community",
            "description": "Our community is active on Discord. You can join us to ask questions, get help, or just to chat with other users.",
            "read_more_link": "https://discord.gg/3cD2Q7Ht3S"
        },
        "abroot": {
            "icon": "security-medium-symbolic",
            "title": "Immutable and Atomic",
            "description": "Vanilla OS is an immutable and atomic Linux distribution. It is based on Debian and uses ABRoot to provide atomic transactions.",
            "read_more_link": "https://documentation.vanillaos.org/docs/ABRoot/"
        },
        "apx": {
            "icon": "vanilla-container-terminal-symbolic",
            "title": "Sub-System Ready To Go",
            "description": "Vanilla OS comes with Apx, a new package manager which installs software in integrated containers to prevent host compromise.",
            "read_more_link": "https://documentation.vanillaos.org/docs/apx/"
        }
    },
    "steps": {
        "network": {
            "template": "network",
            "protected": true
        },
        "conn-check": {
            "template": "conn-check",
            "protected": true
        },
        "welcome": {
            "template": "welcome",
            "protected": true
        },
        "language": {
            "template": "language",
            "new-user-only": true
        },
        "keyboard": {
            "template": "keyboard",
            "new-user-only": true
        },
        "timezone": {
            "template": "timezone",
            "new-user-only": true
        },
        "theme": {
            "template": "theme"
        },
        "user": {
            "template": "user",
            "new-user-only": true
        },
        "hostname": {
            "template": "hostname",
            "new-user-only": true
        },
        "apps": {
            "template": "applications",
            "icon": "org.gnome.Software-symbolic",
            "title": "Applications",
            "description": "Choose which applications to install.",
            "bundles": [
                {
                    "id": "core-apps",
                    "title": "Core Applications",
                    "subtitle": "Essential GNOME apps like Calendar or Document Viewer.",
                    "default": true,
                    "applications": [
                        {
                            "name": "Calculator",
                            "icon": "org.gnome.Calculator",
                            "flatpak": true
                        },
                        {
                            "name": "Calendar",
                            "icon": "org.gnome.Calendar",
                            "flatpak": true
                        },
                        {
                            "name": "Characters",
                            "icon": "org.gnome.Characters",
                            "flatpak": true
                        },
                        {
                            "name": "Clocks",
                            "icon": "org.gnome.clocks",
                            "flatpak": true
                        },
                        {
                            "name": "Connections",
                            "icon": "org.gnome.Connections",
                            "flatpak": true
                        },
                        {
                            "name": "Contacts",
                            "icon": "org.gnome.Contacts",
                            "flatpak": true
                        },
                        {
                            "name": "Disk Usage Analyzer",
                            "icon": "org.gnome.baobab",
                            "flatpak": true
                        },
                        {
                            "name": "Document Scanner",
                            "icon": "org.gnome.SimpleScan",
                            "flatpak": true
                        },
                        {
                            "name": "Document Viewer",
                            "icon": "org.gnome.Evince",
                            "flatpak": true
                        },
                        {
                            "name": "File Roller",
                            "icon": "org.gnome.FileRoller",
                            "flatpak": true
                        },
                        {
                            "name": "Fonts",
                            "icon": "org.gnome.font-viewer",
                            "flatpak": true
                        },
                        {
                            "name": "Image Viewer",
                            "icon": "org.gnome.Loupe",
                            "flatpak": true
                        },
                        {
                            "name": "Logs",
                            "icon": "org.gnome.Logs",
                            "flatpak": true
                        },
                        {
                            "name": "Maps",
                            "icon": "org.gnome.Maps",
                            "flatpak": true
                        },
                        {
                            "name": "Music",
                            "icon": "org.gnome.Music",
                            "flatpak": true
                        },
                        {
                            "name": "Photos",
                            "icon": "org.gnome.Photos",
                            "flatpak": true
                        },
                        {
                            "name": "Snapshot",
                            "icon": "org.gnome.Snapshot",
                            "flatpak": true
                        },
                        {
                            "name": "Text Editor",
                            "icon": "org.gnome.TextEditor",
                            "flatpak": true
                        },
                        {
                            "name": "Videos",
                            "icon": "org.gnome.Totem",
                            "flatpak": true
                        },
                        {
                            "name": "Weather",
                            "icon": "org.gnome.Weather",
                            "flatpak": true
                        }
                    ]
                },
                {
                    "id": "office",
                    "title": "Office",
                    "subtitle": "The LibreOffice suite.",
                    "default": false,
                    "applications": [
                        {
                            "name": "LibreOffice",
                            "icon": "org.libreoffice.LibreOffice",
                            "flatpak": true
                        }
                    ]
                },
                {
                    "id": "utilities",
                    "title": "Common Utilities",
                    "subtitle": "Useful utilities like Bottles or Sound Recorder.",
                    "default": false,
                    "applications": [
                        {
                            "name": "Bottles",
                            "icon": "com.usebottles.bottles",
                            "flatpak": true
                        },
                        {
                            "name": "Extension Manager",
                            "icon": "com.mattjakeman.ExtensionManager",
                            "flatpak": true
                        },
                        {
                            "name": "Heroic Games Launcher",
                            "icon": "com.heroicgameslauncher.hgl",
                            "flatpak": true
                        },
                        {
                            "name": "Lutris",
                            "icon": "net.lutris.Lutris",
                            "flatpak": true
                        },
                        {
                            "name": "Boxes",
                            "icon": "org.gnome.Boxes",
                            "flatpak": true
                        },
                        {
                            "name": "Déjà Dup Backups",
                            "icon": "org.gnome.DejaDup",
                            "flatpak": true
                        },
                        {
                            "name": "Flatseal",
                            "icon": "com.github.tchx84.Flatseal",
                            "flatpak": true
                        },
                        {
                            "name": "Metadata Cleaner",
                            "icon": "fr.romainvigier.MetadataCleaner",
                            "flatpak": true
                        },
                        {
                            "name": "Rnote",
                            "icon": "com.github.flxzt.rnote",
                            "flatpak": true
                        },
                        {
                            "name": "Shortwave",
                            "icon": "de.haeckerfelix.Shortwave",
                            "flatpak": true
                        },
                        {
                            "name": "Sound Recorder",
                            "icon": "org.gnome.SoundRecorder",
                            "flatpak": true
                        }
                    ]
                },
                {
                    "id": "browsers",
                    "title": "Browsers",
                    "subtitle": "Applications that you can use to browse the internet. Traditionally, you only need one.",
                    "default": true,
                    "applications": [
                        {
                            "name": "Firefox",
                            "icon": "org.mozilla.firefox",
                            "flatpak": true
                        },
                        {
                            "name": "Google Chrome",
                            "icon": "com.google.Chrome",
                            "flatpak": true,
                            "active": false
                        },
                        {
                            "name": "Chromium",
                            "icon": "org.chromium.Chromium",
                            "flatpak": true,
                            "active": false
                        },
                        {
                            "name": "Brave Browser",
                            "icon": "com.brave.Browser",
                            "flatpak": true,
                            "active": false
                        },
                        {
                            "name": "Microsoft Edge",
                            "icon": "com.microsoft.Edge",
                            "flatpak": true,
                            "active": false
                        },
                        {
                            "name": "Vivaldi",
                            "icon": "com.vivaldi.Vivaldi",
                            "flatpak": true,
                            "active": false
                        },
                        {
                            "name": "GNOME Web",
                            "icon": "org.gnome.Epiphany",
                            "flatpak": true,
                            "active": false
                        }
                    ]
                }
            ],
            "final": [
                {
                    "if": "Calculator",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Calculator"
                    ]
                },
                {
                    "if": "Calendar",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Calendar"
                    ]
                },
                {
                    "if": "Characters",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Characters"
                    ]
                },
                {
                    "if": "Clocks",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.clocks"
                    ]
                },
                {
                    "if": "Connections",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Connections"
                    ]
                },
                {
                    "if": "Contacts",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Contacts"
                    ]
                },
                {
                    "if": "Disk Usage Analyzer",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.baobab"
                    ]
                },
                {
                    "if": "Document Scanner",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.SimpleScan"
                    ]
                },
                {
                    "if": "Document Viewer",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Evince"
                    ]
                },
                {
                    "if": "Extension Manager",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.mattjakeman.ExtensionManager"
                    ]
                },
                {
                    "if": "File Roller",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.FileRoller"
                    ]
                },
                {
                    "if": "Fonts",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.font-viewer"
                    ]
                },
                {
                    "if": "Image Viewer",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Loupe"
                    ]
                },
                {
                    "if": "Logs",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Logs"
                    ]
                },
                {
                    "if": "Maps",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Maps"
                    ]
                },
                {
                    "if": "Music",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Music"
                    ]
                },
                {
                    "if": "Photos",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Photos"
                    ]
                },
                {
                    "if": "Snapshot",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Snapshot"
                    ]
                },
                {
                    "if": "Text Editor",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.TextEditor"
                    ]
                },
                {
                    "if": "Weather",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Weather"
                    ]
                },
                {
                    "if": "Videos",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Totem"
                    ]
                },
                {
                    "if": "GNOME Web",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Epiphany"
                    ]
                },
                {
                    "if": "LibreOffice",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.libreoffice.LibreOffice"
                    ]
                },
                {
                    "if": "Bottles",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.usebottles.bottles"
                    ]
                },
                {
                    "if": "Heroic Games Launcher",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.heroicgameslauncher.hgl"
                    ]
                },
                {
                    "if": "Lutris",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y net.lutris.Lutris"
                    ]
                },
                {
                    "if": "Boxes",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.Boxes"
                    ]
                },
                {
                    "if": "Déjà Dup Backups",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.DejaDup"
                    ]
                },
                {
                    "if": "Flatseal",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.github.tchx84.Flatseal"
                    ]
                },
                {
                    "if": "Metadata Cleaner",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y fr.romainvigier.MetadataCleaner"
                    ]
                },
                {
                    "if": "Rnote",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.github.flxzt.rnote"
                    ]
                },
                {
                    "if": "Shortwave",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y de.haeckerfelix.Shortwave"
                    ]
                },
                {
                    "if": "Sound Recorder",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.gnome.SoundRecorder"
                    ]
                },
                {
                    "if": "Firefox",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.mozilla.firefox"
                    ]
                },
                {
                    "if": "Google Chrome",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.google.Chrome"
                    ]
                },
                {
                    "if": "Chromium",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y org.chromium.Chromium"
                    ]
                },
                {
                    "if": "Brave Browser",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.brave.Browser"
                    ]
                },
                {
                    "if": "Microsoft Edge",
                    "type": "command",
                    "commands": [
                        "!nextBoot !noRoot flatpak install -y com.microsoft.Edge"
                    ]
                }
            ]
        }
    }
}
jardon commented 1 month ago

Could you try running the script located at /etc/org.vanillaos.FirstSetup.commands? That is the script being passed to the child process that's not exiting cleanly. If you aren't able to run that, could you at least share the contents?

jardon commented 1 month ago

Once this build is done, you can try a fix by doing a custom install and using ghcr.io/jardon/desktop:dev as the URL.

It won't fix the issue with the script, but it may fix the error handling.

Edit: if you were to install from there, you would need to update your abroot.json afterwards as there is no guarantee what I put in my dev branch going forward :)

NN708 commented 1 month ago

Unfortunately, I've already completed the initial setup by manually creating a user and installing applications via the terminal. Since I'm using this system for my daily work, I cannot reinstall it.

jardon commented 4 weeks ago

Since we don't have a way to reproduce this, I'm going to close this issue for the time being. If you end up doing a reinstall or if someone else runs into the same issue, we can repoen this and move forward.