The Replica returned an error: code 4

I was working on a project in it was working till for some reason i stopped dfx (dfx stop) in the middle of project and then

rm -rf .dfx
rm -rf dist
rm -rf src/declarations
dfx cache delete

dfx start --clean

and after that I started my local dfx (0.11.2)
dfx deploy backend - was ok
dfx deploy frontend - was ok
dfx deploy nfg - shows error

dfx deploy nft
Deploying: nft
All canisters have already been created.
Building canisters…
Installing canisters…
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 ‘nft’.
Failed to create argument blob.
Invalid data: Expected arguments but found none.

when i enter:

dfx canister call backend mint ‘(vec {137; 80; 78; 71; 13; 10; 26; 10; 0; 0; 0; 13; 73; 72; 68; 82; 0; 0; 0; 10; 0; 0; 0; 10; 8; 6; 0; 0; 0; 141; 50; 207; 189; 0; 0; 0; 1; 115; 82; 71; 66; 0; 174; 206; 28; 233; 0; 0; 0; 68; 101; 88; 73; 102; 77; 77; 0; 42; 0; 0; 0; 8; 0; 1; 135; 105; 0; 4; 0; 0; 0; 1; 0; 0; 0; 26; 0; 0; 0; 0; 0; 3; 160; 1; 0; 3; 0; 0; 0; 1; 0; 1; 0; 0; 160; 2; 0; 4; 0; 0; 0; 1; 0; 0; 0; 10; 160; 3; 0; 4; 0; 0; 0; 1; 0; 0; 0; 10; 0; 0; 0; 0; 59; 120; 184; 245; 0; 0; 0; 113; 73; 68; 65; 84; 24; 25; 133; 143; 203; 13; 128; 48; 12; 67; 147; 94; 97; 30; 24; 0; 198; 134; 1; 96; 30; 56; 151; 56; 212; 85; 68; 17; 88; 106; 243; 241; 235; 39; 42; 183; 114; 137; 12; 106; 73; 236; 105; 98; 227; 152; 6; 193; 42; 114; 40; 214; 126; 50; 52; 8; 74; 183; 108; 158; 159; 243; 40; 253; 186; 75; 122; 131; 64; 0; 160; 192; 168; 109; 241; 47; 244; 154; 152; 112; 237; 159; 252; 105; 64; 95; 48; 61; 12; 3; 61; 167; 244; 38; 33; 43; 148; 96; 3; 71; 8; 102; 4; 43; 140; 164; 168; 250; 23; 219; 242; 38; 84; 91; 18; 112; 63; 0; 0; 0; 0; 73; 69; 78; 68; 174; 66; 96; 130;}, “CryptoDunks #123”)’

I receive error like this:

Error: Failed update call.
Caused by: Failed update call.
The Replica returned an error: code 4, message: “Canister installation failed with Canister rno2w-sqaaa-aaaaa-aaacq-cai is out of cycles: requested 80000590000 cycles but the available balance is 500000000 cycles and the freezing threshold 0 cycles

what is the above error? what is my mistake?

I think one part is pretty clear - the command you ran costs more than you can afford. The real question is how you managed to set up a task that costs 80 trillion cycles

Did you figure it out?

I’m also getting

Failed to create argument blob.
        Invalid data: Expected arguments but found none.

This most likely happens because your canister takes init arguments but you don’t provide any. You can specify it like this: dfx canister install <canister name> --argument <my argument string>

1 Like

Hey, I didn’t reply to all comments on the forum and github directly but saw them all and they helped, thank you.