Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error: Error HH502: Couldn't download compiler versions list. Please check your connection. #2710

Closed
ThunderCross opened this issue May 13, 2022 · 2 comments
Assignees

Comments

@ThunderCross
Copy link

when I run hardhat compile, it return the error:
Couldn't download compiler versions list. Please check your connection.
Caused by: Error: Failed to download https://binaries.soliditylang.org/windows-amd64/list.json

but if open this url on broswer, it will download corretly .
it seems that the CloudFront CDN blocked hardhat download but allow broswer.

npx hardhat compile --show-stack-traces
Error HH502: Couldn't download compiler versions list. Please check your connection.

HardhatError: HH502: Couldn't download compiler versions list. Please check your connection.
    at CompilerDownloader.downloadCompilersList (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:203:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async CompilerDownloader.getCompilersList (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:162:7)
    at async CompilerDownloader._fetchVersionPath (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:258:16)
    at async CompilerDownloader._versionExists (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:276:25)
    at async CompilerDownloader.getCompilerBuild (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:183:9)
    at async CompilerDownloader.isCompilerDownloaded (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:74:27)
    at async SimpleTaskDefinition.action (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\builtin-tasks\compile.ts:547:36)
    at async Environment._runTaskDefinition (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\core\runtime-environment.ts:219:14)
    at async Environment.run (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\core\runtime-environment.ts:131:14)

    Caused by: Error: Failed to download https://binaries.soliditylang.org/windows-amd64/list.json - 400 received. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <TITLE>ERROR: The request could not be satisfied</TITLE>
    </HEAD><BODY>
    <H1>400 ERROR</H1>
    <H2>The request could not be satisfied.</H2>
    <HR noshade size="1px">
    Bad request.
    We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
    <BR clear="all">
    If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
    <BR clear="all">
    <HR noshade size="1px">
    <PRE>
    Generated by cloudfront (CloudFront)
    Request ID: 7NjpyqQpVVK5oAUGhWoZxQ7kRP2A6ydRqCpikI3avfE_M7Wf_flsoQ==
    </PRE>
    <ADDRESS>
    </ADDRESS>
    </BODY></HTML>
        at download (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\util\download.ts:63:9)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async CompilerDownloader.downloadFile [as _download] (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:50:3)
        at async CompilerDownloader.downloadCompilersList (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:198:7)
        at async CompilerDownloader.getCompilersList (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:162:7)
        at async CompilerDownloader._fetchVersionPath (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:258:16)
        at async CompilerDownloader._versionExists (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:276:25)
        at async CompilerDownloader.getCompilerBuild (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:183:9)
        at async CompilerDownloader.isCompilerDownloaded (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\internal\solidity\compiler\downloader.ts:74:27)
        at async SimpleTaskDefinition.action (C:\Dev\pack\DAPP\Dao\node_modules\hardhat\src\builtin-tasks\compile.ts:547:36)
@github-actions
Copy link
Contributor

This issue is also being tracked on Linear.

We use Linear to manage our development process, but we keep the conversations on Github.

LINEAR-ID: c65e84a2-79f7-4a8f-9dec-16aa2ab839c5

@ThunderCross
Copy link
Author

I use this method to resolve this problem.

#1280 (comment)
Download list.json and keep it locally, and download the solidity compiler on the same path.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants