{"record":{"id":"f330018c54e92cb2","repo":"hashicorp/vagrant","slug":"an-error-occurred-while-downloading-the-remote-fil","errorCode":null,"errorMessage":"An error occurred while downloading the remote file. The error\nmessage, if any, is reproduced below. Please fix this error and try\nagain.\n\n%{message}","messagePattern":"An error occurred while downloading the remote file\\. The error\nmessage, if any, is reproduced below\\. Please fix this error and try\nagain\\.\n\n%(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::DownloaderError","httpStatus":null,"severity":"error","filePath":"lib/vagrant/util/downloader.rb","lineNumber":227,"sourceCode":"        # If the download was interrupted, then raise a specific error\n        raise Errors::DownloaderInterrupted if interrupted\n\n        # If it didn't exit successfully, we need to parse the data and\n        # show an error message.\n        if result.exit_code != 0\n          @logger.warn(\"Downloader exit code: #{result.exit_code}\")\n          check = result.stderr.match(/\\n*curl:\\s+\\((?<code>\\d+)\\)\\s*(?<error>.*)$/)\n          if check && check[:code] == \"416\"\n            # All good actually. 416 means there is no more bytes to download\n            @logger.warn(\"Downloader got a 416, but is likely fine. Continuing on...\")\n          else\n            if !check\n              err_msg = result.stderr\n            else\n              err_msg = check[:error]\n            end\n\n            raise Errors::DownloaderError,\n              code: result.exit_code,\n              message: err_msg\n          end\n        end\n\n        result\n      end\n\n      # Returns the various cURL and subprocess options.\n      #\n      # @return [Array<Array, Hash>]\n      def options\n        # Build the list of parameters to execute with cURL\n        options = [\n          \"--fail\",\n          \"--location\",\n          \"--max-redirs\", \"10\", \"--verbose\",\n          \"--user-agent\", USER_AGENT,","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/util/downloader.rb#L209-L245","documentation":"Raised by Vagrant::Util::Downloader when curl exits non-zero and the parsed stderr code is not 416 (416 = requested range already satisfied, treated as success). The %{message} carries the curl exit code plus the parsed `curl: (code) error` line, or raw stderr when unparsable, so the exact curl objection is visible.","triggerScenarios":"`vagrant box add` / box_download where the URL returns 404/403, DNS fails (code 6), connection refused (7), TLS verification fails (35/60), a proxy blocks the transfer via http_proxy/https_proxy, or a signed URL expired — any curl failure except a clean 416.","commonSituations":"Stale box_url in a Vagrantfile after the box was renamed or removed from Vagrant Cloud; corporate TLS-intercepting proxies with missing CA bundles; self-hosted artifact servers with expired tokens; typo'd URLs.","solutions":["Read %{message} and map the curl code: 6=DNS, 7=connect, 22=HTTP 4xx/5xx (fix the URL), 35/60=TLS/CA, 5=proxy resolution","Reproduce outside Vagrant: `curl -fIL <box_url>` to confirm the failure mode","Fix the source: update the renamed/removed box URL or regenerate the expired signed link","For TLS/proxy issues, install the full CA bundle in the environment running vagrant and set correct http_proxy/https_proxy/no_proxy"],"exampleFix":"# before\nconfig.vm.box_url = \"https://vagrantcloud.com/myuser/old-box-name\"\n\n# after (box was renamed upstream)\nconfig.vm.box_url = \"https://vagrantcloud.com/myuser/new-box-name\"","handlingStrategy":"retry","validationCode":"require 'uri'\n\nbegin\n  u = URI.parse(url)\n  raise unless u.is_a?(URI::HTTP) || u.is_a?(URI::FTP)\nrescue\n  abort \"bad box_url: #{url}\"\nend\n\n# reachability probe before handing off to Vagrant\nsystem('curl', '-fsIL', url, out: File::NULL) or abort 'URL not reachable'","typeGuard":null,"tryCatchPattern":"begin\n  downloader.download!\nrescue Vagrant::Errors::DownloaderError => e\n  fatal = e.message.include?('(22)') # HTTP 4xx/5xx — retry will not help\n  retry unless fatal\n  abort e.message\nend","preventionTips":["Pin box URLs to versioned, stable paths","Probe URLs with curl -I in CI before vagrant runs","Keep CA bundles current behind TLS-intercepting proxies","Never blind-retry 404s — fix the source first"],"tags":["download","curl","network","box","tls","proxy"],"backgroundTag":"download-failed","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}