Dfx canister call nns-ui-canister create_sub_account '("1111")' Error

I successfully deployed nns locally
But when I use the command

dfx canister call qoctq-giaaa-aaaaa-aaaea-cai create_sub_account '("1111")'

is to return an error message

Error: Failed update call.
Caused by: Failed update call.
   The returned replica a replica error: Replica Error: reject code DestinationInvalid, reject message Requested canister has no wasm module, error code Some("IC0304")

My dfx version is dfx 0.15.0
The deployment process is

dfx extension install nns
dfx nns install

The return result is displayed as

#####################################
# NNS CANISTER INSTALLATION COMPLETE #
#####################################

Backend canisters:
nns-registry rwlgt-iiaaa-aaaaa-aaaaa-cai
nns-governance rrkah-fqaaa-aaaaa-aaaaq-cai
nns-ledger ryjl3-tyaaa-aaaaa-aaaba-cai
nns-root r7inp-6aaaa-aaaaa-aaabq-cai
nns-cycles-minting rkp4c-7iaaa-aaaaa-aaaca-cai
nns-lifeline rno2w-sqaaa-aaaaa-aaacq-cai
nns-genesis-token renrk-eyaaa-aaaaa-aaada-cai
nns-identity rdmx6-jaaaa-aaaaa-aaadq-cai
nns-ui qoctq-giaaa-aaaaa-aaaea-cai
nns-sns-wasm qaa6y-5yaaa-aaaaa-aaafa-cai
nns-ic-ckbtc-minter qjdve-lqaaa-aaaaa-aaaeq-cai


Frontend canisters:
internet_identity http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080/
nns-dapp http://qsgjb-riaaa-aaaaa-aaaga-cai.localhost:8080/
āžœ  ~ dfx canister info qoctq-giaaa-aaaaa-aaaea-cai
Controllers: r7inp-6aaaa-aaaaa-aaabq-cai
Module hash: None
āžœ  ~ dfx canister info rrkah-fqaaa-aaaaa-aaaaq-cai
Controllers: r7inp-6aaaa-aaaaa-aaabq-cai
Module hash: 0x020013e964098332022465d9b82d9bdfe245317e699d2a0047627acf16676f45

Iā€™m not a subject matter expert on this, but I figured out that the correct canister ID to call is nns-dapp, not nns-ui. Therefore, you should try:

$ dfx canister call qoctq-giaaa-aaaaa-aaaea-cai create_sub_account '("1111")'
(variant { 566_069_724 })

Hi @ic_axb

I think due to some quirks we are not able to install the nns-dapp (otherwise known as the nns-ui) on the typical canister id location of qoctq-giaaa-aaaaa-aaaea-cai. Notice in the last line of the output you pasted has nns-dapp http://qsgjb-riaaa-aaaaa-aaaga-cai.localhost:8080/. Can you try the command again with that canisterId?

$ dfx canister info qhbym-qaaaa-aaaaa-aaafq-cai
$ dfx canister call qhbym-qaaaa-aaaaa-aaafq-ca create_sub_account '("1111")'

The result returned by the function is incorrect. The return structure should be

# did file
create_sub_account (text) -> (CreateSubAccountResponse)


pub type AccountIdentifier = String;

pub type SubAccount = Vec<u8>;

#[derive(CandidType, Deserialize)]
pub struct SubAccountDetails {
    pub name: String,
    pub sub_account: SubAccount,
    pub account_identifier: AccountIdentifier,
}

#[derive(CandidType, Deserialize)]
pub enum CreateSubAccountResponse {
    Ok(SubAccountDetails),
    AccountNotFound,
    NameTooLong,
    SubAccountLimitExceeded,
}

Moreover, the results returned by requesting other functions are (variant { 566_069_724 }), which is confusing. :joy: