I got an error when I redeployed after editing the backend canister.
I have tried to search for the reason for the error, but I am not sure why. The Replica returned an error: code 5, message: "Canister trapped explicitly: RTS error: blob_of_principal: principal too short"
Under what circumstances would such an error appear?
Also, what should I check?
[ Error ]
$ dfx deploy app_backend
All canisters have already been created.
Upgrading code for canister app_backend, with canister ID rno2w-sqaaa-aaaaa-aaacq-cai
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 'app_backend'.
Failed to install wasm in canister 'rno2w-sqaaa-aaaaa-aaacq-cai'.
Failed to install wasm.
The Replica returned an error: code 5, message: "Canister rno2w-sqaaa-aaaaa-aaacq-cai trapped explicitly: RTS error: blob_of_principal: principal too short"
[ What I did when I redeployed ]
I wanted to check the functionality of the stable variable and preupgrade / postupgrade methods, so I defined a dummy variable and tried to redeploy.
Empty String is not a valid principal and this will panic, as you observed in the error message. Please use a valid one instead. The two most common ones are the management canister’s Principal "aaaaa-aa" and the anonymous Principal "2vxsx-fae", but you can use any valid principal you like.