openai/codex · error · anyhow::Error

failed to load marketplace(s): {issue_lines}

Error message

failed to load marketplace(s):
{issue_lines}

What it means

`codex marketplace list` discovers configured plugin marketplaces, then aggregates load issues from configured_marketplace_snapshot_issues plus raw discovery errors from the plugins manager. If any issue exists, run_list bails with one line per problem (`- `name` at path: message`) and suppresses the listing — a marketplace that cannot load cleanly is a hard failure, not a warning.

Source

Thrown at codex-rs/cli/src/marketplace_cmd.rs:251

                path: error.path.to_path_buf(),
                message: error.message.clone(),
            });
        }
    }
    if !load_issues.is_empty() {
        let issue_lines = load_issues
            .iter()
            .map(|issue| {
                format!(
                    "- `{}` at {}: {}",
                    issue.marketplace_name,
                    issue.path.display(),
                    issue.message
                )
            })
            .collect::<Vec<_>>()
            .join("\n");
        bail!("failed to load marketplace(s):\n{issue_lines}");
    }
    let marketplaces = marketplace_listing.marketplaces;
    if args.json {
        let marketplace_sources =
            configured_marketplace_sources_by_root(config.codex_home.as_path(), &plugins_input);
        let output =
            JsonMarketplaceListOutput::from_marketplaces(marketplaces, &marketplace_sources);
        println!("{}", serde_json::to_string_pretty(&output)?);
        return Ok(());
    }

    if marketplaces.is_empty() {
        println!("No plugin marketplaces in scope.");
        return Ok(());
    }

    let mut seen_roots = HashSet::new();
    let mut rows = Vec::new();

View on GitHub (pinned to 339751715c)

Solutions

  1. Read each `- `name` at path: message` line; open that exact path.
  2. Fix the manifest or directory at the reported path (restore the deleted clone, correct the YAML).
  3. Remove the stale entry with `codex marketplace remove <name>` and re-add via `codex marketplace add <source>` if still needed.
  4. Rerun `codex marketplace list` to confirm a clean load.

Example fix

# error output looks like:
# failed to load marketplace(s):
# - `acme` at /home/me/.codex/plugins/marketplaces/acme/marketplace.yaml: invalid YAML
# fix: correct or remove that marketplace, then rerun
codex marketplace remove acme
codex marketplace add https://github.com/acme/marketplace
codex marketplace list
Defensive patterns

Strategy: validation

Validate before calling

CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
python3 - "$CODEX_HOME" <<'PY'
import glob, os, sys, yaml
home = sys.argv[1]
bad = []
for p in glob.glob(os.path.join(home, 'plugins', '**', '*.yaml'), recursive=True):
    try:
        yaml.safe_load(open(p))
    except Exception as e:
        bad.append(f'{p}: {e}')
if bad:
    print('invalid marketplace yaml:'); print(chr(10).join(bad)); sys.exit(1)
PY
codex marketplace list

Try / catch

if ! codex marketplace list 2>err.log; then
  sed -n '/failed to load marketplace/,$p' err.log   # one `- `name` at path: message` line per issue
  exit 1
fi

Prevention

When it happens

Trigger: Any configured marketplace whose snapshot fails to load: unparseable marketplace manifest YAML at the printed path, a marketplace directory deleted or moved after being configured, or a discovery error reported for a configured source.

Common situations: Hand-editing marketplace YAML under $CODEX_HOME and breaking syntax; rm-ing a cloned marketplace directory without removing its config entry; a codex upgrade changing the manifest schema; CODEX_HOME pointing at a partial copy from another machine.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/66d507acb37b7bc4. Report an issue: GitHub.