Error for command dfx canister install --all

Hi everyone,
I am following this tutorial https://sdk.dfinity.org/docs/quickstart/quickstart.html
everything goes well until I try to install cannister.

I put this command:
dfx canister install --all

and I get this error code:
Installing code for canister hello_world, with canister_id ic:8043BE22FCECDF2FA7
An error occured:
AgentError(
ReqwestError(
reqwest::Error {
kind: Request,
url: “http://127.0.0.1:8000/api/v1/submit”,
source: hyper::Error(
Connect,
ConnectError(
“tcp connect error”,
Os {
code: 111,
kind: ConnectionRefused,
message: “Connection refused”,
},
),
),
},
),
)

Any ideas what might be the problem?

Thank you very much!

  1. Open a terminal
  2. Head into your project folder
  3. run dfx stop
  4. run dfx start --background
  5. wait for ~ 10 sec
  6. run dfx canister install --all

does this help?

2 Likes

Thanks for the suggestion, when I run dfx start -background it did not recognized argument -background

So I ran only dfx start, this is what I got :frowning: It asked for firewall permision which I granted, and run it again, but with the same message:
/dfinity/hello_world$ dfx start
⠂ Checking client!
Jul 14 13:21:56.331 INFO Dfinity Replica Started
Jul 14 13:21:56.333 INFO Generated node ID: 100
thread ‘main’ panicked at ‘Permissions too open for path /mnt/c/Users/Marko/documents/dfinity/hello_world/.dfx/state/crypto_store’, crypto/src/crypto_service_provider/secret_key_store/lmdb_store.rs:62:13
⠓ Replica exited with signal: 6
client address: “http://localhost:55030
binding to: V4(127.0.0.1:8000)
⠒ Client bound at 55030
An error occured:
AgentError(
TimeoutWaitingForResponse,
)

It‘s supposed to be two dashes: dfx start --background (my phone keeps reformatting this …).
Next thing you should is

  1. open a terminal
  2. head into your project folder
  3. run rm -rf .dfx/state
  4. retry the steps from my previous comment :slight_smile:
3 Likes

There’s also a dfx start --clean option for this.

(Aside, if you want to see what options are available you can always add --help to dfx and any of its subcommands).

2 Likes

I’m running into these same issues. dfx canister install —all An error occured: CannotFindCanisterName( "—all", )

1 Like

There are two dashes, not one, to --all

2 Likes

sorry, i updated my inital response

1 Like

Thanks for the suggestions, I have played with it, done all you have suggested, installed new 0.6.0 verios of dfx but still getting the same problem :(((((

Version v0.6.0 installed successfully.
⠉ Checking replica!
thread ‘main’ panicked at ‘Permissions too open for path /mnt/c/Users/Marko/Documents/dfinity/hello_world/.dfx/state/replicated_state/node-100/crypto’, crypto/src/crypto_service_provider/secret_key_store/proto_store.rs:95:132

here is another one :frowning:

I have tried exactly what you have suggested and a couple more variations… Any other suggestions? :slight_smile:

/hello_world/src/hello_world$ dfx start --background
⠂ Pinging the Internet Computer replica…
thread ‘main’ panicked at ‘Permissions too open for path /mnt/c/Users/Marko/Documents/dfinity/hello_world/.dfx/state/replicated_state/node-100/crypto’, crypto/src/crypto_service_provider/secret_key_store/proto_store.rs:95:13
⠲ Replica exited with exit code: 101
^Z

Did you try this inside your project directory?

Hi Markus

It looks like you might be running this using Windows Subsystem for Linux and saving your project on the mounted Windows drive? If so, this will have issues because of the way WSL handles the mounted drive.

Windows isn’t officially supported yet, but if you:

  1. Use WSL version 2, and

  2. Create your project in the WSL filesystem instead of on the mount, eg in ~/

…you should be able to run it fine.

Some more WSL info can be found in this thread: Dfx on windows for beginners

5 Likes

Great!!! finally it works fine with WSL 2 many thanks!!!

4 Likes

Hello @Ori!

Do you have insights about when Windows will be supported by the DFINITY execution command-line interface?

Meanwhile, thank you for troubleshooting this issue it helped me a lot. :slight_smile:

Best regards,

@motoko

You’re welcome! No news yet on the Windows release. If you’re a VSCode user their WSL integration makes the experience quite seamless though.

3 Likes

Thanks @Ori Its helped a lot. Now I am able to setup the dfinity sdk in my windows system

2 Likes