XX-net/XX-Net · warning

loading config e:%r

Error message

loading config e:%r

What it means

The launcher could not load its configuration file; config.load() raised an exception. This is a non-fatal warning — the process continues with default variable values, so behavior may differ from the user's saved settings.

Source

Thrown at code/default/launcher/config.py:88

config.set_var("enable_launcher", 1)
config.set_var("enable_x_tunnel", 1)
config.set_var("enable_gae_proxy", 0)
config.set_var("enable_smart_router", 1)

config.set_var("os_proxy_mode", "pac") # can be: gae, x_tunnel, smart_router, disable

# Proxy
config.set_var("global_proxy_enable", 0)
config.set_var("global_proxy_type", "HTTP") # can be: HTTP/ SOCKS4/ SOCKs5
config.set_var("global_proxy_host", "")
config.set_var("global_proxy_port", 0)
config.set_var("global_proxy_username", "")
config.set_var("global_proxy_password", "")

try:
    config.load()
except Exception as e:
    xlog.warn("loading config e:%r", e)

app_name = "XX-Net"
valid_language = ['en_US', 'fa_IR', 'zh_CN', 'ru_RU']
try:
    fp = os.path.join(root_path, "code", "app_info.json")
    with open(fp, "r") as fd:
        app_info = json.load(fd)
        app_name = app_info["app_name"]
except Exception as e:
    print("load app_info except:", e)
    pass


def _get_os_language():

    if sys_platform.platform == "mac":
        try:
            lang_code = subprocess.check_output(["/usr/bin/defaults", 'read', 'NSGlobalDomain', 'AppleLanguages'])

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Check the config file location and validate its syntax (JSON parse) manually
  2. Restore from backup or delete the corrupted file to let the launcher regenerate defaults
  3. Fix ownership/permissions if the process cannot read the file (e.g. after sudo runs)
  4. Ensure the process is not interrupted while it saves config to avoid truncated files

Example fix

// before
try:
    config.load()
except Exception as e:
    xlog.warn("loading config e:%r", e)
// after
try:
    config.load()
except Exception as e:
    xlog.warn("loading config e:%r", e)
    xlog.warn("regenerating default config")
    config.save()
Defensive patterns

Strategy: try-catch

Validate before calling

import json, os
p = config_file_path
if not os.path.exists(p) or not _is_valid_json(p):
    # back up and let app regenerate defaults

Try / catch

try:
    config.load()
except Exception as e:
    xlog.warn("loading config e:%r", e)
    # keep running with defaults; optionally back up the bad file

Prevention

When it happens

Trigger: config.load() encountering a missing, unreadable, or corrupted config file (bad JSON/YAML, truncated write, permission denied) at startup of the launcher module.

Common situations: Config file corrupted by an unclean shutdown, edited by hand with a syntax error, first run with no config file, or file owned by a different user/root after running with sudo.

Related errors


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