{"record":{"id":"fc439f69d05d07e7","repo":"dgtlmoon/changedetection.io","slug":"no-favicon-available-for-uuid","errorCode":null,"errorMessage":"No Favicon available for {uuid}","messagePattern":"No Favicon available for (.+?)","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"changedetectionio/api/Watch.py","lineNumber":459,"sourceCode":"        watch = self.datastore.data['watching'].get(uuid)\n        if not watch:\n            abort(404, message=f\"No watch exists with the UUID of {uuid}\")\n\n        favicon_filename = watch.get_favicon_filename()\n        if favicon_filename:\n            # Use cached MIME type detection\n            filepath = os.path.join(watch.data_dir, favicon_filename)\n            mime = get_favicon_mime_type(filepath)\n            if 'text' in mime:\n                logger.debug(f\"Aborting favicon request for {filepath} because mimetype might be text (bad mimetype) '{mime}'\")\n                abort(404)\n\n            response = make_response(send_from_directory(watch.data_dir, favicon_filename))\n            response.headers['Content-type'] = mime\n            response.headers['Cache-Control'] = 'max-age=300, must-revalidate'  # Cache for 5 minutes, then revalidate\n            return response\n\n        abort(404, message=f'No Favicon available for {uuid}')\n\n\nclass CreateWatch(Resource):\n    def __init__(self, **kwargs):\n        # datastore is a black box dependency\n        self.datastore = kwargs['datastore']\n        self.update_q = kwargs['update_q']\n\n    @auth.check_token\n    @validate_openapi_request('createWatch')\n    def post(self):\n        \"\"\"Create a single watch.\"\"\"\n\n        # Silently discard `__`-prefixed transient/internal keys (not part of the public schema).\n        json_data = strip_internal_api_fields(request.get_json())\n        url = json_data['url'].strip()\n\n        if not is_safe_valid_url(url):","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/dgtlmoon/changedetection.io/blob/5d9c7c6da76340597243e8163c4f2439237fa0e8/changedetectionio/api/Watch.py#L441-L477","documentation":"Flask abort(404) raised by the watch favicon endpoint when no favicon file exists in the watch's data directory. changedetection.io stores a per-watch favicon (scraped or fetched) in watch.data_dir; when a browser requests /favicon/<uuid> and no such file has been saved yet, the handler falls through to this 404 with a descriptive message.","triggerScenarios":"GET request to the watch favicon URL (e.g. /favicon/<uuid>) before any favicon was captured for the watch, after the favicon file was deleted from disk (data dir pruned/migrated), or when the fetch of the favicon failed during watch checks.","commonSituations":"Freshly created watches that have never run a check; watches whose data_dir was copied/restored without favicon files; watchdog/browserless not running so favicons never get captured.","solutions":["Verify the watch has run at least one successful check so a favicon can be captured","Check watch.data_dir on disk for the favicon file returned by watch.get_favicon_filename()","Re-fetch the favicon by triggering a recheck of the watch","If serving favicons is optional in your UI, tolerate 404 and render a placeholder icon"],"exampleFix":"# before\nresp = requests.get(f'{base}/favicon/{uuid}')\nresp.raise_for_status()\n\n# after\nresp = requests.get(f'{base}/favicon/{uuid}')\nif resp.status_code == 404:\n    return placeholder_icon  # favicon not yet captured\nresp.raise_for_status()","handlingStrategy":"fallback","validationCode":"import os, requests\ndef favicon_exists(base, uuid):\n    # cheap probe: 404 means not captured yet\n    return requests.head(f'{base}/favicon/{uuid}').status_code == 200","typeGuard":null,"tryCatchPattern":"try:\n    resp = requests.get(f'{base}/favicon/{uuid}', timeout=10)\n    resp.raise_for_status()\nexcept requests.HTTPError as e:\n    if e.response.status_code == 404:\n        return DEFAULT_ICON\n    raise","preventionTips":["Run at least one check per watch before expecting favicons","Cache 404 results briefly so UIs don't re-request missing favicons","Keep watch data dirs intact when migrating instances"],"tags":["flask","favicon","http-404","changedetectionio"],"backgroundTag":"http-404-not-found","analyzedSha":"5d9c7c6da76340597243e8163c4f2439237fa0e8","analyzedAt":"2026-08-27T19:41:16.067Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}