Dfx deploy locally with a new Dfx identity

Hi, same for me, deploy works with default but not with id created

with id it block like that

Citation
Please enter the passphrase for your identity: [hidden]
Decryption complete.
Deploying all canisters.
All canisters have already been created.
Building canisters…
Shrink WASM module size.
Building frontend…
^C

and default

Citation
Deploying all canisters.
All canisters have already been created.
Building canisters…
Shrink WASM module size.
Building frontend…
WARN: Building canisters before generate for Motoko
Shrink WASM module size.
Generating type declarations for canister wawa_backend:
src/declarations/wawa_backend/wawa_backend.did.d.ts
src/declarations/wawa_backend/wawa_backend.did.js
src/declarations/wawa_backend/wawa_backend.did

Installing canisters…
Module hash 82dd0d3281e70992b8566e2c9da5a28452f2a4e7ca50593c1756260e66104a44 is already installed.
Module hash db07e7e24f6f8ddf53c33a610713259a7c1eb71c270b819ebd311e2d223267f0 is already installed.
Uploading assets to asset canister…
Starting batch.
Staging contents of new and changed assets:
/index.html (689 bytes) sha 64e1989943da68e767ff91e8e4f453973f4cbaab2c250f2000fabb490466cd2a is already installed
/index.html (gzip) (385 bytes) sha 2a3a6332dab58060c588eacf18fcbfe325380dc6a2d4b2a4c8d35a66996cd744 is already installed
/index.js (637147 bytes) sha f8253daec6d00e00afe8a4667a8fe0656f4632bbff3380d84aaad6fac44ab38d is already installed
/index.js (gzip) (152950 bytes) sha b82e991d40bbcf67279cce0607cf8feb5bcd67e088c36b21b9663a97f56a711d is already installed
/favicon.ico (15406 bytes) sha 4e8d31b50ffb59695389d94e393d299c5693405a12f6ccd08c31bcf9b58db2d4 is already installed
/index.js.map (681314 bytes) sha 48d0c7d17c9a9298421af42ca5226c53fa28b8a26de4e5ac74caebfcd0b02d47 is already installed
/index.js.map (gzip) (156606 bytes) sha 2a5b095dd02f84c92e6972bd7ce60e7a631b993bf092c81a71846a593d875b3d is already installed
/main.css (537 bytes) sha 75ac0c5aea719bb2b887fffbde61867be5c3a9eceab3d75619763c28735891cb is already installed
/main.css (gzip) (299 bytes) sha b4879e7ba34e68b2965d626e48d772ce615e4f6b78b69cc8f2f91127ed18b850 is already installed
/sample-asset.txt (24 bytes) sha 2d523f5aaeb195da24dcff49b0d560a3d61b8af859cee78f4cff0428963929e6 is already installed
/logo2.svg (15139 bytes) sha 037eb7ae523403daa588cf4f47a34c56a3f5de08a5a2dd2364839e45f14f4b8b is already installed
Committing batch.
Deployed canisters.
URLs:
Frontend canister via browser

in your package.json, remove the “prebuild” script, that worked for me.

2 Likes

I assume that this is the problem you guys are running into: `dfx deploy` halts when running `npm run generate` using a protected identity · Issue #2872 · dfinity/sdk · GitHub

Looks like my comment above was wrong:

It should be The build step SHOULD not access your identity in any way.

Workaround that I can offer right now, which I figured out because of @nolyoi’s suggestion to remove the prebuild step:

  • edit package.json
  • find field scripts.generate
  • replace dfx generate <some canister name> with dfx --identity anonymous generate <some canister name>

This will use the anonymous identity for the build step, (which is available to anyone and not protected by a password) and therefore will not hang the process.

8 Likes

thanks for the help, i ve tried to remove that

“prebuild”: “npm run generate”,

dfx deply done that

Deploying all canisters.
All canisters have already been created.
Building canisters…
Shrink WASM module size.
Building frontend…
Installing canisters…
Module hash 82dd0d3281e70992b8566e2c9da5a28452f2a4e7ca50593c1756260e66104a44 is already installed.
Module hash db07e7e24f6f8ddf53c33a610713259a7c1eb71c270b819ebd311e2d223267f0 is already installed.
Uploading assets to asset canister…
Starting batch.
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed while trying to install all canisters.
Failed to install wasm module to canister ‘wawa_frontend’.
Failed to store assets in canister ‘wawa_frontend’.
Failed asset sync with canister xxxxxx-jaaaa-aaaaa-xxxxxxx-cai.
The Replica returned an error: code 4, message: “Caller is not authorized”

Thanks, i ve tried too your solution, it done that

Deploying all canisters.
All canisters have already been created.
Building canisters…
Shrink WASM module size.
Building frontend…
WARN: Building canisters before generate for Motoko
Shrink WASM module size.
Generating type declarations for canister wawa_backend:
src/declarations/wawa_backend/wawa_backend.did.d.ts
src/declarations/wawa_backend/wawa_backend.did.js
src/declarations/wawa_backend/wawa_backend.did

Installing canisters…
Module hash 82dd0d3281e70992b8566e2c9da5a28452f2a4e7ca50593c1756260e66104a44 is already installed.
Module hash db07e7e24f6f8ddf53c33a610713259a7c1eb71c270b819ebd311e2d223267f0 is already installed.
Uploading assets to asset canister…
Starting batch.
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed while trying to install all canisters.
Failed to install wasm module to canister ‘wawa_frontend’.
Failed to store assets in canister ‘wawa_frontend’.
Failed asset sync with canister xxxxxxxx-jaaaa-aaaaa-xxxxxxx-cai.
The Replica returned an error: code 4, message: “Caller is not authorized”

it s done the same

Another workaround is to use an identity without encryption til this issue is fixed.

dfx identity new xxx –disable-encryption

2 Likes

@rbole yea we know, this is what i told when I post the first time, btw the solution nolyoi provide work for me when I remove the “prebuild” script, also the solution from Severin work as well if i change the script to :

“generate”: “dfx --identity anonymous generate <some canister name>

@FELIX Did you try to remove all your canister and clean up using the cmd line :

rm -rf ./.dfx/* canisters/*

then try to redeploy again after updating the script in package.json ?

2 Likes

To save time, I solved it like this.

  • Export my identity & remember the ids of your canisters // wallet // backup proyects
  • Delete all the wsl with the distributions (in my case I use W11 with wsl)

  • Install ubuntu again and update it ( sudo apt update & sudo apt full-upgrade )

  • Install dfx

  • Import Identity

  • Set of the previous canisters ( dfx identity set-wallet “id” --network ic)

Everything working again.

1 Like

As an extra value to the analysis they did, I can say that this inconvenience does not “break” the process, but rather that it continues (perhaps it enters an infinite loop or similar). I discovered this with the top command, visualizing that the process continues to constantly consume resources.