{"record":{"id":"4e440fa69494cb22","repo":"langchain-ai/deepagents","slug":"failed-to-add-marketplace-source-redact-urls-i","errorCode":null,"errorMessage":"Failed to add marketplace {source}: {redact_urls_in_text(str(exc))}","messagePattern":"Failed to add marketplace (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/commands_cli.py","lineNumber":207,"sourceCode":"                return None\n            text = (\n                \"No plugin marketplaces configured.\"\n                if not rows\n                else \"\\n\".join(f\"{row['name']} {row['source']}\" for row in rows)\n            )\n            print(text)  # noqa: T201\n            return text\n        if marketplace_command == \"add\":\n            try:\n                marketplace = add_marketplace_source(args.source)\n            except (MarketplaceError, FileNotFoundError, OSError, ValueError) as exc:\n                source = redact_marketplace_source(args.source)\n                text = (\n                    f\"Failed to add marketplace {source}: \"\n                    f\"{redact_urls_in_text(str(exc))}\"\n                )\n                print(text)  # noqa: T201\n                raise SystemExit(1) from exc\n            text = (\n                f\"Added marketplace {marketplace.name} \"\n                f\"({len(marketplace.plugins)} plugin(s)).\"\n            )\n            print(text)  # noqa: T201\n            return text\n        if marketplace_command == \"remove\":\n            removed = remove_marketplace(args.name)\n            text = (\n                f\"Removed marketplace {args.name} and its installed plugins.\"\n                if removed\n                else f\"Marketplace {args.name} is not configured.\"\n            )\n            print(text)  # noqa: T201\n            return text\n    text = \"Usage: plugin {list,install,uninstall,enable,disable,marketplace}\"\n    print(text)  # noqa: T201\n    return text","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/commands_cli.py#L189-L225","documentation":"When `plugin marketplace add <source>` fails, execute_plugin_command builds this message by redacting the source argument and the exception text through redact_urls_in_text, then exits with status 1. The redaction prevents credentials embedded in URLs (tokens in the marketplace source or in the error) from being printed to the terminal. The cause is any MarketplaceError/OSError/ValueError raised while fetching or persisting the marketplace definition.","triggerScenarios":"Running `plugin marketplace add <source>` where the source cannot be fetched/parsed (MarketplaceError), the target location cannot be written (OSError), or the source/definition is invalid (ValueError).","commonSituations":"A URL with an unreachable host or bad TLS config; a marketplace manifest that fails schema validation; a git/HTTP source requiring auth; a typo'd local path; the URL containing a token the redactor then strips from output.","solutions":["Check network reachability of the source URL (curl it) — note the CLI output redacts URLs, so test the raw source yourself.","Validate the marketplace definition file (names, plugin entries) parses and matches the expected schema.","Ensure the destination install_location is writable and the parent directory exists.","If auth was required, supply credentials via the supported mechanism before adding.","Fix any typos in the local path and retry the add command."],"exampleFix":"// before\n$ dcode plugin marketplace add https://git.example.com/team/mkt.git\nFailed to add marketplace https://git.example.com/team/mkt.git: could not fetch source\n// after (verify source first)\n$ git ls-remote https://git.example.com/team/mkt.git\n$ dcode plugin marketplace add https://git.example.com/team/mkt.git\nAdded marketplace team-mkt (12 plugin(s)).","handlingStrategy":"try-catch","validationCode":"import urllib.request\n\ndef source_reachable(source: str) -> bool:\n    if source.startswith((\"http://\", \"https://\")):\n        try:\n            urllib.request.urlopen(source, timeout=10)\n            return True\n        except OSError:\n            return False\n    import os\n    return os.path.exists(source)\n\nassert source_reachable(\"https://git.example.com/team/mkt.git\"), \"source unreachable\"","typeGuard":"def is_valid_marketplace_source(source: str) -> bool:\n    import os\n    return bool(source) and (os.path.exists(source) or source.startswith((\"http://\", \"https://\", \"git@\")))","tryCatchPattern":"proc = subprocess.run([\"dcode\", \"plugin\", \"marketplace\", \"add\", SRC], capture_output=True, text=True)\nif proc.returncode == 1 and proc.stdout.startswith(\"Failed to add marketplace\"):\n    # output is URL-redacted; debug with the raw source yourself\n    print(\"add failed; verify source reachability and marketplace schema\")","preventionTips":["Curl/ls the source before adding it to confirm reachability.","Validate the marketplace definition file against the expected schema.","Keep tokens out of URLs; use supported credential mechanisms.","Ensure the install_location parent directory exists and is writable.","Re-add the marketplace after upstream restructuring instead of patching records."],"tags":["cli","marketplace","credential-redaction"],"backgroundTag":"marketplace-add-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}