SNS testflight error

Hi guys, when I run the sns deploy-testflight --network ic command, then I receive this error:

Could not build canister init payloads: Could not determine whether the SNS init payload is using the one-proposal flow or the legacy because it contains a mix of set and unset one proposal parameters

Does anyone know what this is about?

Thanks for reporting!

This seems like a bug in the SNS CLI tool (I suspect that the SnsInitPayload object is being generated in a way that’s no longer supported). We’ll try to fix this over the course of the day, please stay tuned.

1 Like

Update. While the SNS CLI bug was confirmed, it’s affecting only the case when the init-config-file argument is not passed. In this case, the tool generates a default payload, which is incomplete. Fixing this might take a longer time due to the prioritization being difficult this week.

Could you please try running sns deploy-testflight init-config-file <path-to-your-sns-config-yaml-file> and see if that works? We should also make this suggestion in the documentation.

Thanks @aterga ,of course I try to add the sns_init.yaml file and it did not work. This is the error message:

thread 'main' panicked at rs/sns/cli/src/deploy.rs:452:27:
Could not build canister init payloads: Error: The one-proposal SNS initialization requires some SnsInitPayload parameters to be Some. But the following fields were set to None: nns_proposal_id, neurons_fund_participants, swap_start_timestamp_seconds, swap_due_timestamp_seconds
Error: nns_proposal_id must be specified
Error: neurons_fund_participants must be specified
Error: swap_start_timestamp_seconds must be specified
NeuronsFundParticipationConstraintsValidationError: neurons_fund_participation requires neurons_fund_participation_constraints must be specified

It seems that the current version of the sns_init.yaml doesn’t have the fields it wants in

By the way, my dfx version is 0.15.3, sns-cli 1.0.0

Sorry I didn’t have time to look into this today, but I’m going to try to reproduce this tomorrow.

Could you please share your sns_init.yaml file and the exact commands you’re running — this would help debugging the issue.

Sure.
Here is the sns_init.yaml

The command:
version

/Users/admin/.cache/dfinity/versions/0.15.3/sns -V 
sns-cli 1.0.0

dfx -V                                                             
dfx 0.15.3

deploy-testflight

/Users/admin/.cache/dfinity/versions/0.15.3/sns deploy-testflight --network ic
dfx identity get-principal
xxx
dfx canister --network ic id sns_governance
xxx
dfx canister --network ic id sns_ledger
xxx
dfx canister --network ic id sns_root
xxx
dfx canister --network ic id sns_swap
xxx
dfx canister --network ic id sns_index
xxx
SNS canisters already allocated
SNS canister IDs:
SnsCanisterIds { governance: xxx, ledger: xxx, root: xxx, swap: xxx, index: xxx }
thread 'main' panicked at rs/sns/cli/src/deploy.rs:452:27:
Could not build canister init payloads: Could not determine whether the SNS init payload is using the one-proposal flow or the legacy because it contains a mix of set and unset one proposal parameters
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

deploy-testflight with init file

/Users/admin/.cache/dfinity/versions/0.15.3/sns deploy-testflight --network ic --init-config-file sns_init.yaml
dfx canister --network ic id sns_governance
xxx
dfx canister --network ic id sns_ledger
xxx
dfx canister --network ic id sns_root
xxx
dfx canister --network ic id sns_swap
xxx
dfx canister --network ic id sns_index
xxx
SNS canisters already allocated
SNS canister IDs:
SnsCanisterIds { governance: xxx, ledger: xxx, root: xxx, swap: xxx, index: xxx }
thread 'main' panicked at rs/sns/cli/src/deploy.rs:452:27:
Could not build canister init payloads: Error: The one-proposal SNS initialization requires some SnsInitPayload parameters to be Some. But the following fields were set to None: nns_proposal_id, neurons_fund_participants, swap_start_timestamp_seconds, swap_due_timestamp_seconds
Error: nns_proposal_id must be specified
Error: neurons_fund_participants must be specified
Error: swap_start_timestamp_seconds must be specified
NeuronsFundParticipationConstraintsValidationError: neurons_fund_participation requires neurons_fund_participation_constraints must be specified.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1 Like

I’m on the NNS team and my current top priority is figuring out how to unblock you on testing. Right now I think the most direct path is to fix the issue you’re encountering with sns testflight. The advantage of sns testflight is that it allows you to test your SNS deployment in a local replica or on mainnet. However, if you only need to test on the local replica for now, let me know as that opens up some other options

I have the same error
I’m using dfx version of 0.14.2 and sns-cli 1.0.0 (same as sns-test repo)

any solutions to fix this error ?

@simpson @aterga

1 Like

Hi everyone. You can use these instructions to deploy a testflight to a local replica:

First you need to get the right version of the sns binary, which this command will download to ./sns:

GIT_HASH="f72ad66cc01b5441da26a596abaa2117c023844d"
PLATFORM=$(uname | tr '[[:upper:]]' '[[:lower:]]')
DOWNLOAD_NAME="sns"
DEST=./sns
curl "https://download.dfinity.systems/ic/${GIT_HASH}/binaries/x86_64-${PLATFORM}/${DOWNLOAD_NAME}.gz" | zcat >"$DEST" && chmod +x "$DEST"

Once we have that, we can deploy the testflight like this:

# Requires a modern DFX
dfx --version 
# should say: dfx 0.16.1 or similar
# add the sns canisters to your DFX environment
dfx extension install sns --version 0.3.1
export DFX_IC_COMMIT=f72ad66cc01b5441da26a596abaa2117c023844d
dfx sns import
dfx sns download
# start the local replica (in a new terminal)
dfx start --clean
# (you may need to run `dfx stop`)
# deploy a testflight
rm ./sns_canister_ids # ok if this fails
./sns deploy-testflight --verbose --init-config-file=$(pwd)/sns_init.yaml
# you need a canister to give to the SNS, I'll create one but you can deploy it to the local replica any way you like, just set the CID variable to the canister's principal ID
TMP=$(mktemp -d) && (cd $TMP && echo '{"canisters": { "x": {} }}' >dfx.json && dfx canister create --no-wallet  x ; rm -rf .dfx ; rm dfx.json ) ; rmdir $TMP
CID="bnz7o-iuaaa-aaaaa-qaaaa-cai" # replace with your canister ID
# create the proposal to register the dapp canister
NETWORK="local"
SNS_GOVRENANCE_CANISTER=$(jq -r '.governance_canister_id' ./sns_canister_ids.json) 
CANDID_PATH="candid/sns_governance.did"
PRINCIPAL="$(dfx identity get-principal)"
NEURON_ID=$(dfx canister \
   --network "${NETWORK}" \
   call "${SNS_GOVRENANCE_CANISTER}" \
   --candid ${CANDID_PATH} \
   list_neurons "(record {of_principal = opt principal\"${PRINCIPAL}\"; limit = 1})" | sed -n 's/.*id = blob "\([^"]*\).*/\1/p')
dfx canister \
   --network "${NETWORK}" \
   call "${SNS_GOVRENANCE_CANISTER}" \
   --candid ${CANDID_PATH} \
   manage_neuron "(record { subaccount = blob \"${NEURON_ID}\"; command = opt variant {MakeProposal = record { title=\"Register dapp's canisters with SNS.\"; url=\"https://example.com/\"; summary=\"This proposal registers dapp's canisters with SNS.\"; action=opt variant {RegisterDappCanisters = record {canister_ids=vec {principal\"${CID}\"}}}}} })"

Edit: replaced with instructions that are tested to work on mainnet. In particular, the steps where we download the sns-cli and add the sns canisters to your dfx environment have been changed. If you followed the previous version of the instructions, run rm ./sns-* && rm ./ic-icrc1-* before re-adding the sns canisters to your environment

1 Like

Hi I’ve been working through this and was wondering how I could work around this restriction:

My project was funded by 120 people and need to give them each 5 neurons, was hoping to do this via sns_init.yaml.

Kind regards,
James

So I ran this and I get such a long message back that ends in an error I can’t see what the start says:

I’ve consolidated my neurons so there are less than 100

Hey @jamesbeadle . I updated the instructions in my post. I’m not sure they’ll fix what you’re experiencing, but could you try again?

So I refollowed the instructions but got argument list too long:

Here is the sns_init.yaml:

I’ve followed the guide above to deploy a testing sns and when I try to stake a new neuron I get the following error

(
  record {
    command = opt variant {
      Error = record {
        error_message = "Because governance is currently in PreInitializationSwap mode, manage_neuron commands of this type are not allowed (caller_is_swap_canister=false). command: ClaimOrRefresh(\n    ClaimOrRefresh {\n        by: Some(\n            MemoAndController(\n                MemoAndController {\n                    memo: 1,\n                    controller: Some(\n                        465sx-szz6o-idcax-nrjhv-hprrp-qqx5e-7mqwr-wadib-uo7ap-lofbe-dae,\n                    ),\n                },\n            ),\n        ),\n    },\n)";
        error_type = 10 : int32;
      }
    };
  },
)

Main problem seems to be that the SNS is still mode PreInitializationSwap.
How can I change this?