{"record":{"id":"742385a7f399e1ca","repo":"unclecode/crawl4ai","slug":"getting-name-is-deprecated-self-unwanted-pr-742385","errorCode":null,"errorMessage":"Getting '{name}' is deprecated. {self._UNWANTED_PROPS[name]}","messagePattern":"Getting '(.+?)' is deprecated\\. (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"crawl4ai/async_configs.py:2045","lineNumber":1032,"sourceCode":"            raise ValueError(\n                \"chunking_strategy must be an instance of ChunkingStrategy\"\n            )\n\n        # Set default chunking strategy if None\n        if self.chunking_strategy is None:\n            self.chunking_strategy = RegexChunking()\n\n        # Deep Crawl Parameters\n        self.deep_crawl_strategy = deep_crawl_strategy\n        \n        # Experimental Parameters\n        self.experimental = experimental or {}\n\n\n    def __getattr__(self, name):\n        \"\"\"Handle attribute access.\"\"\"\n        if name in self._UNWANTED_PROPS:\n            raise AttributeError(f\"Getting '{name}' is deprecated. {self._UNWANTED_PROPS[name]}\")\n        raise AttributeError(f\"'{self.__class__.__name__}' has no attribute '{name}'\")\n\n    def __setattr__(self, name, value):\n        \"\"\"Handle attribute setting.\"\"\"\n        # TODO: Planning to set properties dynamically based on the __init__ signature\n        sig = inspect.signature(self.__init__)\n        all_params = sig.parameters  # Dictionary of parameter names and their details\n\n        if name in self._UNWANTED_PROPS and value is not all_params[name].default:\n            raise AttributeError(f\"Setting '{name}' is deprecated. {self._UNWANTED_PROPS[name]}\")\n        \n        super().__setattr__(name, value)\n\n    @staticmethod\n    def from_kwargs(kwargs: dict) -> \"CrawlerRunConfig\":\n        return CrawlerRunConfig(\n            # Content Processing Parameters\n            word_count_threshold=kwargs.get(\"word_count_threshold\", 200),","sourceCodeStart":1014,"sourceCodeEnd":1050,"githubUrl":"https://github.com/unclecode/crawl4ai/blob/7e801521428ee12509994d39151006f64055ebe3/deploy/docker/c4ai-code-context.md#L1014-L1050","documentation":"AttributeError from CrawlerRunConfig.__getattr__: reading an attribute listed in _UNWANTED_PROPS - properties removed in the current version - is blocked, and the message includes a migration hint. Non-listed unknown attributes fall through to the normal 'no attribute' error.","triggerScenarios":"Reading config.<removed prop> where <removed prop> is in _UNWANTED_PROPS (e.g. legacy option names relocated into CrawlerRunConfig/BrowserConfig), including indirect reads via getattr(config, name) in shared utility code.","commonSituations":"Upgrading crawl4ai a major version and running old scripts or third-party code written against the legacy API; copy-pasted snippets referencing options that were renamed.","solutions":["Read the migration hint in the message itself - it states what replaced the property","Update the call site to set the option at construction with its current name","Search your code for the removed name and fix every access (rg '<name>' .)","Pin the old crawl4ai version only as a last resort while you migrate"],"exampleFix":"# before (legacy)\nval = config.old_option  # AttributeError: deprecated\n\n# after\nfrom crawl4ai import CrawlerRunConfig\nconfig = CrawlerRunConfig(new_option=True)\nval = config.new_option","handlingStrategy":"try-catch","validationCode":"# before any generic attribute access on configs\nDEPRECATED = set(CrawlerRunConfig._UNWANTED_PROPS)\nname = MIGRATION_MAP[name] if name in DEPRECATED else name","typeGuard":"def safe_config_get(config, name, default=None):\n    if name in config._UNWANTED_PROPS:\n        raise KeyError(f\"{name} removed; see migration map\")\n    return getattr(config, name, default)","tryCatchPattern":"try:\n    val = getattr(config, prop)\nexcept AttributeError as e:\n    if \"deprecated\" in str(e):\n        val = MIGRATION_MAP_lookup(prop, str(e))  # parse the hint in the message\n    else:\n        raise","preventionTips":["After upgrading crawl4ai, grep the changelog/migration notes for removed properties and fix all references","Centralize config reads through one accessor so deprecations surface in a single place"],"tags":["crawl4ai","deprecation","config","migration"],"backgroundTag":null,"analyzedSha":"7e801521428ee12509994d39151006f64055ebe3","analyzedAt":"2026-08-14T20:46:20.673Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}