NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.24k stars 1.39k forks source link

HardhatError: HH502: Couldn't download complier connection list. Please check your connection ?! #1639

Closed vinaypuranik closed 3 years ago

vinaypuranik commented 3 years ago

Hi Folks,

Getting this below error . Any possible solution ? Hardhat v2.4.1 image

HardhatError: HH502: Couldn't download compiler versions list. Please check your connection.

    at CompilerDownloader.downloadCompilersList (/app/node_modules/hardhat/src/internal/solidity/compiler/downloader.ts:186:13)

    at processTicksAndRejections (node:internal/process/task_queues:96:5)

    at CompilerDownloader.getCompilersList (/app/node_modules/hardhat/src/internal/solidity/compiler/downloader.ts:159:7)

    at CompilerDownloader._fetchVersionPath (/app/node_modules/hardhat/src/internal/solidity/compiler/downloader.ts:241:16)

    at CompilerDownloader._versionExists (/app/node_modules/hardhat/src/internal/solidity/compiler/downloader.ts:259:25)

    at CompilerDownloader.getCompilerBuild (/app/node_modules/hardhat/src/internal/solidity/compiler/downloader.ts:168:9)

    at CompilerDownloader.isCompilerDownloaded (/app/node_modules/hardhat/src/internal/solidity/compiler/downloader.ts:74:27)

    at SimpleTaskDefinition.action (/app/node_modules/hardhat/src/builtin-tasks/compile.ts:489:36)

    at Environment._runTaskDefinition (/app/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)

    at Environment.run (/app/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)

    Caused by: FetchError: request to https://binaries.soliditylang.org/linux-amd64/list.json failed, reason: Client network socket disconnected before secure TLS connection was established

        at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1461:11)

        at ClientRequest.emit (node:events:394:28)

        at TLSSocket.socketErrorListener (node:_http_client:447:9)

        at TLSSocket.emit (node:events:394:28)

        at emitErrorNT (node:internal/streams/destroy:193:8)

        at emitErrorCloseNT (node:internal/streams/destroy:158:3)

        at processTicksAndRejections (node:internal/process/task_queues:83:21)
alcuadrado commented 3 years ago

Are you behind a proxy?

fvictorio commented 3 years ago

I'm going to assume this is a connection or a proxy issue. If you are behind a proxy, you can configure an HTTP_PROXY environment variable, as explained here:

Hardhat will automatically download the versions of solc that you set up. If you are behind an HTTP proxy, you may need to set the HTTP_PROXY or HTTPS_PROXY environment variable to the URL of your proxy.

Please use our Discord server if you have more questions.

vinaypuranik commented 3 years ago

@alcuadrado @fvictorio I checked with our network team they mentioned that we are not behind any proxy. Have Jenkins deployed on some server and trying to build the docker image. Below are the contents of Dockerfile.
image

Strange that if I build this docker image locally, it succeeds. But not on our Jenkins box.

image

curl binaries url inside docker image on Jenkins box works fine as well. image

Quick update: Workaround mentioned here https://github.com/fvictorio/hardhat-examples/tree/master/custom-solc works! Thanks @fvictorio @alcuadrado