trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.31k forks source link

truffle unbox failed #4152

Closed RunHippo closed 2 years ago

RunHippo commented 3 years ago
This directory is non-empty...
? Proceed anyway? (Y/n) 
Starting unbox...
=================

? Proceed anyway? Yes
✔ Preparing to download box
✖ Downloading
Unbox failed!
✖ Downloading
Unbox failed!
Error: Error connecting to github.com. Please check your internet connection and try again.
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:45:1
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:6:41)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Local Environment

Truffle v5.3.13 (core: 5.3.13)
Node v14.16.0
yipu3 commented 3 years ago

Same

> truffle unbox pet-shop

Starting unbox...
=================
✔ Preparing to download box
✖ Downloading
Unbox failed!
✖ Downloading
Unbox failed!
Error: Error connecting to github.com. Please check your internet connection and try again.
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:45:1
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:6:41)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Truffle v5.3.13 (core: 5.3.13)
Node v14.16.1

And connection to github.com works well using wget github.com.

Using proxy or not does not effect the result.

cds-amal commented 3 years ago

Hi @RunHippo,

We were unable to reproduce this. Though we have seen it when we simulate network connection issues. Could it be an internet issue on your side?

yipu3 commented 3 years ago

屏幕快照 2021-07-01 下午4 39 25 I think the output of error omit necessary key information. URL and error should be printed, not just Error connecting to github.com. Actually I can connect to github.com in my terminal.

cds-amal commented 3 years ago

That's a good suggestion @yipu0v0 ! I'll update the output. The following command might help trace down the issue.

 $ DEBUG=unbox truffle unbox pet-shop ps   

When I test the command I get the following output

 $ DEBUG=unbox truffle unbox pet-shop ps
Secp256k1 bindings are not compiled. Pure JS implementation will be used.
Keccak bindings are not compiled. Pure JS implementation will be used.
  unbox { in: 'pet-shop',
  unbox   out: 'https://github.com:truffle-box/pet-shop-box' } +0ms

Starting unbox...
=================

✔ Preparing to download box
✔ Downloading
npm WARN pet-shop@1.0.0 No description
npm WARN pet-shop@1.0.0 No repository field.

✔ Cleaning up temporary files
✔ Setting up box

Unbox successful, sweet!

Commands:

  Compile:        truffle compile
  Migrate:        truffle migrate
  Test contracts: truffle test
  Run dev server: npm run dev
LIYANG-UST commented 3 years ago

I still have the same error. But I can use git clone to get the project. image

yipu3 commented 3 years ago
➜  crypto DEBUG=unbox truffle unbox pet-shop ps
Secp256k1 bindings are not compiled. Pure JS implementation will be used.
Keccak bindings are not compiled. Pure JS implementation will be used.
  unbox { in: 'pet-shop', out: 'https://github.com:truffle-box/pet-shop-box' } +0ms

Starting unbox...
=================

✔ Preparing to download box
✖ Downloading
Unbox failed!
✖ Downloading
Unbox failed!
Error: Error connecting to github.com. Please check your internet connection and try again.
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:45:1
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:6:41)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Truffle v5.3.13 (core: 5.3.13)
Node v14.16.1
haltman-at commented 3 years ago

Going to close this now that #4169 is released. Feel free to open a new issue if there's still a problem.

jwzh222 commented 3 years ago

same issue with truffle unbox on ubuntu and win10

Starting unbox...

✔ Preparing to download box ✖ Downloading Unbox failed! ✖ Downloading Unbox failed! Error: Error connecting to https://raw.githubusercontent.com/truffle-box/Metacoin-box/master/truffle-box.json. Please check your internet connection and try again.

Request failed with status code 503 at createError (/home/linuxbrew/.linuxbrew/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/core/createError.js:16:1) at settle (/home/linuxbrew/.linuxbrew/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/core/settle.js:17:1) at IncomingMessage.handleStreamEnd (/home/linuxbrew/.linuxbrew/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/adapters/http.js:260:1) at IncomingMessage.emit (node:events:406:35) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) Truffle v5.4.11 (core: 5.4.11) Node v16.9.1

Truffle v5.4.11 (core: 5.4.11) Solidity v0.5.16 (solc-js) Node v16.9.1 Web3.js v1.5.2

FYI. "wget raw.githubusercontent.com" works good on my terminal. and i can git clone.

wilmerhenao commented 3 years ago

Mac:

Starting unbox...

✔ Preparing to download box ✖ Downloading Unbox failed! ✖ Downloading Unbox failed! Error: self signed certificate in certificate chain at TLSSocket.onConnectSecure (_tls_wrap.js:1514:34) at TLSSocket.emit (events.js:400:28) at TLSSocket._finishInit (_tls_wrap.js:936:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:708:12) Truffle v5.4.14 (core: 5.4.14) Node v14.17.6

cds-amal commented 3 years ago

Hello @wilmerhenao, can you please share the full unbox command as well the output running with debug environment?

You can enable debug output for unboxing via...

$ DEBUG=unbox truffle unbox <your-box>
RogerLiNing commented 3 years ago

Sovled by adding http_proxy and https_proxy.


same issue with win 11 executing truffle unbox react

PS D:\code\web3> truffle unbox react

Starting unbox...                                                                                                       
=================                 

√ Preparing to download box
× Downloading
Unbox failed!
× Downloading
Unbox failed!
Error: Error connecting to https://raw.githubusercontent.com/truffle-box/react-box/master/truffle-box.json. Please check your internet connection and try again.

Request failed with status code 503
    at createError (C:\Users\Roger lee\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\axios\lib\core\createError.js:16:1)
    at settle (C:\Users\Roger lee\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\axios\lib\core\settle.js:17:1)
    at IncomingMessage.handleStreamEnd (C:\Users\Roger lee\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\axios\lib\adapters\http.js:269:1)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Truffle v5.4.22 (core: 5.4.22)
Node v14.16.0

while no problem of fetching content using PowerShell:

PS D:\code\web3> (Invoke-WebRequest -Uri https://raw.githubusercontent.com/truffle-box/react-box/master/truffle-box.json).content
{
  "ignore": ["README.md", ".gitignore", "box-img-lg.png", "box-img-sm.png", ".github"],
  "commands": {
    "Compile": "truffle compile",
    "Migrate": "truffle migrate",
    "Test contracts": "truffle test",
    "Test dapp": "cd client && npm test",
    "Run dev server": "cd client && npm run start",
    "Build for production": "cd client && npm run build"
  },
  "hooks": {
    "post-unpack": "cd client && npm ci"
  }
}

zhi114 commented 2 years ago

Same issue with mac m1 executing truffle unbox pet-shop. Adding http_proxy and https_proxy don't solve problem. Anyone help? 1644477266352

while no problem of fetching content using curl: 2

rockyoung commented 2 years ago

Starting unbox...

✔ Preparing to download box ✖ Downloading Unbox failed! ✖ Downloading Unbox failed! Error: Error connecting to https://raw.githubusercontent.com/truffle-box/metacoin-box/master/truffle-box.json. Please check your internet connection and try again.

Request failed with status code 503 at createError (/home/rock_u/.nvm/versions/node/v17.6.0/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/core/createError.js:16:1) at settle (/home/rock_u/.nvm/versions/node/v17.6.0/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/core/settle.js:17:1) at IncomingMessage.handleStreamEnd (/home/rock_u/.nvm/versions/node/v17.6.0/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/adapters/http.js:269:1) at IncomingMessage.emit (node:events:539:35) at endReadableNT (node:internal/streams/readable:1342:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) Truffle v5.5.1 (core: 5.5.1) Node v17.6.0

$ curl https://raw.githubusercontent.com/truffle-box/metacoin-box/master/truffle-box.json { "ignore": [ "README.md", ".gitignore" ], "commands": { "Compile contracts": "truffle compile", "Migrate contracts": "truffle migrate", "Test contracts": "truffle test" }, "hooks": { "post-unpack": "" } }

cds-amal commented 2 years ago

see: https://en.greatfire.org/ for validation

cds-amal commented 2 years ago

Closing this as issues seem to be related to PROXY configuration. Anyone coming here, please see if the following links help

Deepthitv commented 2 years ago

✓ Preparing to download box ✖ Downloading Unbox failed! Error: Truffle Box at URL https://github.com:chainskills/chainskills-box doesn't exist. If you believe this is an error, please contact Truffle support. at /usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:43:1 at Generator.throw () at rejected (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:6:42) at processTicksAndRejections (internal/process/task_queues.js:95:5) Truffle v5.5.14 (core: 5.5.14) Node v14.17.5

cliffoo commented 2 years ago

Hey @Deepthitv, looks like chainskills/chainskills-box doesn't have a truffle-box.json file at the repo's root, which is what the unbox command uses to identify if the repo is indeed a Truffle box.

Give our react box a try?

ZulquarnainKhan commented 1 year ago

Unbox failed! Error: Error connecting to https://raw.githubusercontent.com/truffle-box/react-box/master/truffle-box.json. Please check your internet connection and try again.

connect ETIMEDOUT 2405:200:1607:2820:41::36:443 at Function.AxiosError.from (C:\Users\tabas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\axios\dist\node\axios.cjs:789:1) at RedirectableRequest.handleRequestError (C:\Users\tabas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\axios\dist\node\axios.cjs:2744:1) at RedirectableRequest.emit (node:events:513:28) at ClientRequest.eventHandlers. (C:\Users\tabas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\follow-redirects\index.js:14:1) at ClientRequest.emit (node:events:513:28) at TLSSocket.socketErrorListener (node:_http_client:502:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at processTicksAndRejections (node:internal/process/task_queues:82:21) Truffle v5.7.7 (core: 5.7.7) Node v18.14.1

ZulquarnainKhan commented 1 year ago

facing this issue is there any solution

Siddharth-sing commented 1 year ago

For windows (might also work for others)

I have a solution where we don't have to downgrade the node version and truffle-box react will be up and running. We will go old school.

Now we have to do two major things, first one is to compile & migrate the smart contracts and the next is to install the npm dependencies (because npm module doesn't go in a repo. instead package.json have all the dependencies required written.)

Kunal766 commented 1 year ago

USE A VPN

yjshi2015 commented 1 year ago

same issue with truffle unbox on ubuntu and win10

Starting unbox...

✔ Preparing to download box ✖ Downloading Unbox failed! ✖ Downloading Unbox failed! Error: Error connecting to https://raw.githubusercontent.com/truffle-box/Metacoin-box/master/truffle-box.json. Please check your internet connection and try again.

Request failed with status code 503 at createError (/home/linuxbrew/.linuxbrew/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/core/createError.js:16:1) at settle (/home/linuxbrew/.linuxbrew/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/core/settle.js:17:1) at IncomingMessage.handleStreamEnd (/home/linuxbrew/.linuxbrew/lib/node_modules/truffle/build/webpack:/node_modules/axios/lib/adapters/http.js:260:1) at IncomingMessage.emit (node:events:406:35) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) Truffle v5.4.11 (core: 5.4.11) Node v16.9.1

Truffle v5.4.11 (core: 5.4.11) Solidity v0.5.16 (solc-js) Node v16.9.1 Web3.js v1.5.2

FYI. "wget raw.githubusercontent.com" works good on my terminal. and i can git clone.

do you resolved this problem?

Kushvanshi-Shubham commented 1 year ago

how to solve it?

PS C:\Users\shubh\Blockchain\eventtrigger> truffle unbox react

Starting unbox... √ Preparing to download box × Downloading Unbox failed! Error: Error connecting to https://raw.githubusercontent.com/truffle-box/react-box/master/truffle-box.json. Please check your internet connection and try again.

connect ETIMEDOUT 2405:200:1607:2820:41::36:443 at Function.AxiosError.from (C:\Users\shubh\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\axios\dist\node\axios.cjs:789:1) at RedirectableRequest.handleRequestError (C:\Users\shubh\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\axios\dist\node\axios.cjs:2744:1) at RedirectableRequest.emit (node:events:514:28) at ClientRequest.eventHandlers. (C:\Users\shubh\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\follow-redirects\index.js:14:1) at ClientRequest.emit (node:events:514:28) at TLSSocket.socketErrorListener (node:_http_client:501:9) at TLSSocket.emit (node:events:514:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at processTicksAndRejections (node:internal/process/task_queues:82:21) Truffle v5.11.2 (core: 5.11.2) Node v18.17.0