{"record":{"id":"40e7c68c526d438d","repo":"XingangPan/DragGAN","slug":"no-data-received","errorCode":null,"errorMessage":"No data received","messagePattern":"No data received","errorType":"exception","errorClass":"IOError","httpStatus":null,"severity":"error","filePath":"dnnlib/util.py","lineNumber":449,"sourceCode":"    url_md5 = hashlib.md5(url.encode(\"utf-8\")).hexdigest()\n    if cache:\n        cache_files = glob.glob(os.path.join(cache_dir, url_md5 + \"_*\"))\n        if len(cache_files) == 1:\n            filename = cache_files[0]\n            return filename if return_filename else open(filename, \"rb\")\n\n    # Download.\n    url_name = None\n    url_data = None\n    with requests.Session() as session:\n        if verbose:\n            print(\"Downloading %s ...\" % url, end=\"\", flush=True)\n        for attempts_left in reversed(range(num_attempts)):\n            try:\n                with session.get(url) as res:\n                    res.raise_for_status()\n                    if len(res.content) == 0:\n                        raise IOError(\"No data received\")\n\n                    if len(res.content) < 8192:\n                        content_str = res.content.decode(\"utf-8\")\n                        if \"download_warning\" in res.headers.get(\"Set-Cookie\", \"\"):\n                            links = [html.unescape(link) for link in content_str.split('\"') if \"export=download\" in link]\n                            if len(links) == 1:\n                                url = requests.compat.urljoin(url, links[0])\n                                raise IOError(\"Google Drive virus checker nag\")\n                        if \"Google Drive - Quota exceeded\" in content_str:\n                            raise IOError(\"Google Drive download quota exceeded -- please try again later\")\n\n                    match = re.search(r'filename=\"([^\"]*)\"', res.headers.get(\"Content-Disposition\", \"\"))\n                    url_name = match[1] if match else url\n                    url_data = res.content\n                    if verbose:\n                        print(\" done\")\n                    break\n            except KeyboardInterrupt:","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/XingangPan/DragGAN/blob/336f120ce126aca6f55dc58537e76c10d19eabd0/dnnlib/util.py#L431-L467","documentation":"Raised inside dnnlib.util.open_url when a download request completes with HTTP 200 but the response body is empty (len(res.content) == 0). It is wrapped in a retry loop (num_attempts, default 10), so it signals that the URL returned no bytes at all — typically a dead link, a redirect that serves nothing, or a transient server failure. After exhausting attempts it propagates as an IOError to the caller.","triggerScenarios":"Calling open_url (or load_network_pickle / gen_images with a network URL) where the server returns 200 with an empty body; passing an incorrect URL that points to a zero-length resource; intermittent hosting outages of the pretrained-weight hosts.","commonSituations":"Downloading official StyleGAN2-ADA pickle files from nvlabs-fi-cdn.nvidia.com or host.robots.ox.ac.uk when the mirror is flaky; typos in the URL passed to open_url; corporate proxies returning empty responses.","solutions":["Retry the download — open_url already retries internally up to num_attempts; simply re-run the command","Verify the URL returns data: curl -sL <url> | wc -c; fix typos or use the official URL list","Download the file manually (browser/wget) and pass the local file path instead of the URL","Pass num_attempts larger, or context_kwargs={'num_attempts': 20} to be more resilient","Check corporate proxy/firewall settings if all downloads come back empty"],"exampleFix":"# before\nwith dnnlib.open_url('https://host/model.pkl') as f: data = f.read()\n\n# after (local file avoids the network path)\n# wget https://host/model.pkl\nwith open('model.pkl','rb') as f: data = f.read()","handlingStrategy":"retry","validationCode":"import requests\nres = requests.get(url, stream=True)\nif res.status_code == 200 and len(res.content) == 0:\n    raise IOError('URL returns empty body — fix the URL before calling open_url')","typeGuard":null,"tryCatchPattern":"try:\n    with dnnlib.open_url(url) as f: data = f.read()\nexcept IOError as e:\n    if 'No data received' in str(e):\n        # retries already exhausted; fall back to local file / different mirror\n        ...","preventionTips":["Validate URLs with curl/HEAD before scripted runs","Keep a local cache of pretrained weights and pass file paths","Pin num_attempts high enough for flaky mirrors"],"tags":["network","download","http","stylegan2","retry"],"backgroundTag":"empty-http-response","analyzedSha":"336f120ce126aca6f55dc58537e76c10d19eabd0","analyzedAt":"2026-08-27T06:29:00.251Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}