XX-net/XX-Net · warning

Enable auto start, create path:%s fail:%r

Error message

Enable auto start, create path:%s fail:%r

What it means

The launcher's autostart add() failed to create the XDG autostart directory (~/.config/autostart) before writing a .desktop entry. os.mkdir raised (typically because a parent is missing or permissions are wrong), so the launcher logged a warning and gave up on enabling auto-start.

Source

Thrown at code/default/launcher/autorun.py:76

    home_config_path = os.path.expanduser(_xdg_config_home)
    _xdg_user_autostart = os.path.join(home_config_path, "autostart")


    def getfilename(name):
        """get the filename of an autostart (.desktop) file"""
        return os.path.join(_xdg_user_autostart, name + ".desktop")


    def add(name, application):
        if not os.path.isdir(home_config_path):
            xlog.warn("autorun linux config path not found:%s", home_config_path)
            return

        if not os.path.isdir(_xdg_user_autostart):
            try:
                os.mkdir(_xdg_user_autostart)
            except Exception as e:
                xlog.warn("Enable auto start, create path:%s fail:%r", _xdg_user_autostart, e)
                return

        """add a new autostart entry"""
        desktop_entry = "[Desktop Entry]\n" \
                        "Name=%s\n" \
                        "Exec=%s\n" \
                        "Type=Application\n" \
                        "Terminal=false\n" \
                        "X-GNOME-Autostart-enabled=true" % (name, application)
        with open(getfilename(name), "w") as f:
            f.write(desktop_entry)


    def exists(name):
        """check if an autostart entry exists"""
        return os.path.exists(getfilename(name))

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Verify $HOME and ~/.config exist and are writable: mkdir -p ~/.config/autostart
  2. Check XDG_CONFIG_HOME if set — ensure it points to a valid writable directory
  3. Remove any regular file at the autostart path (os.mkdir fails if a file exists there)
  4. Run the launcher with sufficient filesystem permissions

Example fix

// before
if not os.path.isdir(_xdg_user_autostart):
    try:
        os.mkdir(_xdg_user_autostart)
    except Exception as e:
        xlog.warn("Enable auto start, create path:%s fail:%r", _xdg_user_autostart, e)
        return
// after
try:
    os.makedirs(_xdg_user_autostart, exist_ok=True)
except Exception as e:
    xlog.warn("Enable auto start, create path:%s fail:%r", _xdg_user_autostart, e)
    return
Defensive patterns

Strategy: validation

Validate before calling

import os
autostart_dir = os.path.expanduser('~/.config/autostart')
parent_ok = os.access(os.path.dirname(autostart_dir) or '/', os.W_OK)
if not parent_ok:
    # skip auto-start enable or prompt user

Prevention

When it happens

Trigger: Calling add() on Linux when ~/.config/autostart does not exist and os.mkdir fails, e.g. missing ~/.config parent, read-only $HOME, or a file occupying the path.

Common situations: Running XX-Net as a restricted user, from a container/live session with a read-only home, or with a broken XDG_CONFIG_HOME environment variable.

Related errors


AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27). Data as JSON: /api/errors/091110ec1e5d4ccd. Report an issue: GitHub.