{"record":{"id":"7f352b1faabc9ba3","repo":"XingangPan/DragGAN","slug":"google-drive-virus-checker-nag","errorCode":null,"errorMessage":"Google Drive virus checker nag","messagePattern":"Google Drive virus checker nag","errorType":"exception","errorClass":"IOError","httpStatus":null,"severity":"warning","filePath":"dnnlib/util.py","lineNumber":457,"sourceCode":"    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:\n                raise\n            except:\n                if not attempts_left:\n                    if verbose:\n                        print(\" failed\")\n                    raise\n                if verbose:\n                    print(\".\", end=\"\", flush=True)","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/XingangPan/DragGAN/blob/336f120ce126aca6f55dc58537e76c10d19eabd0/dnnlib/util.py#L439-L475","documentation":"This is an internal control-flow exception in dnnlib.util.open_url, not a real failure. When Google Drive serves a small interstitial page with a download_warning cookie, the code extracts the real direct-download link, reassigns url, and raises IOError('Google Drive virus checker nag') so the surrounding retry loop re-requests the new URL. You only see it if the retry budget (num_attempts) is exhausted or you catch it yourself.","triggerScenarios":"Calling open_url on a Google Drive URL of a file flagged for large-file virus scanning; the first response is the nag page, the code rewrites url, and the next retry fetches the actual file. Surfaces directly when num_attempts is too low or the retry loop is modified.","commonSituations":"Downloading community-shared StyleGAN weights hosted on Google Drive; catching IOError broadly around open_url and intercepting this internal signal; GDrive changing its interstitial HTML so the link extraction fails and every attempt re-nags until attempts run out.","solutions":["Do not catch this error narrowly — let open_url's internal retry loop handle it; usually nothing to fix","Re-run the command; the retry loop fetches the resolved URL on the next attempt","Download the file manually in a browser and pass a local path to open_url / the script","Increase num_attempts when calling open_url","If hosting weights yourself, avoid Google Drive for large files; use direct HTTP/Dropbox/S3"],"exampleFix":"# before\ntry:\n    with dnnlib.open_url(gdrive_url) as f: ...\nexcept IOError as e:\n    print(e)  # 'Google Drive virus checker nag' aborts the retry logic\n\n# after\nwith dnnlib.open_url(gdrive_url) as f: ...  # let internal retries resolve it\n# or use a local file:\n# with dnnlib.open_url('model.pkl') as f: ...","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    with dnnlib.open_url(url) as f: data = f.read()\nexcept IOError as e:\n    if 'virus checker nag' in str(e):\n        pass  # internal retry signal — do not treat as fatal; simply re-invoke open_url\n    else:\n        raise","preventionTips":["Never catch IOError narrowly around open_url — let internal retries work","Prefer non-Google-Drive mirrors for automated pipelines","Cache downloaded files locally so the download path runs once"],"tags":["network","google-drive","download","internal-retry","stylegan2"],"backgroundTag":"google-drive-virus-scan-interstitial","analyzedSha":"336f120ce126aca6f55dc58537e76c10d19eabd0","analyzedAt":"2026-08-27T06:29:00.251Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}