Sns-testing [Troubleshoot]

Hi everyone,

I’ve been doing some testing following up the README, using Linux and Bootstrapping a testing environment via Docker.

So, everything good if following up instructions for example when starting a local replica instance it prints the dashboard URL: http://localhost:8000/_/dashboard

Even running the setup locally seems to finish with no problem running:
docker exec -it $SNS_TESTING_INSTANCE bash setup_locally.sh

The first problem I’m facing is that after this you can access the NNS frontend dapp locally in here:
http://qsgjb-riaaa-aaaaa-aaaga-cai.localhost:8080/

But for some reason, it comes with some errors.

The first one is this
There was an unexpected error while loading the summaries of all deployed projects. Error converting data from aggregator canister

This just comes out of the box without signing in with Internet Identity, but then later I get more errors:
There was an unexpected error while loading the summaries of all deployed projects. Error converting data from aggregator canister

I was wondering if this is normal, even after following instructions and deploying the docker without any errors on console.

I also did try with the special instructions for Apple silicon users, but having the same result.

Other steps on the README might work, but I’m getting stuck at the NNS frontend dapp to be able to test the process.

Any help is much appreciated!
Thanks

Additionally I get some warning when running the basic scenario, although in the end it says it finished successfully

warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
OK

This error usually comes because the Aggregator is taking a few minutes to fetch all required data from the backend.

  1. You can wait for 20 minutes or so.
  2. Or you can run the following command to speed things up (but will require a higher resource consumption):

dfx canister call sns_aggregator reconfigure '(opt record { update_interval_ms = 100; fast_interval_ms = 1_000_000_000; })'

Please let us know if this helps!

Interesting, I waited about half an hour and even restarted the docker but still didn’t get to make it work.


i

I also tried the command to reconfigure the sns_aggregator but the update call failed

I was reading at the end of the HACKING.md this

I tried it up but same errors on the NNS frontend

Could it be that the dfx commands won’t work because the way scripts set it up? I was thinking it might be the docker but also trying to compile from source on Mac have the same errors.

Thank you for letting me know! We will have our team take a closer look and get back to you.

1 Like

There was an unexpected error while loading the summaries of all deployed projects. Error converting data from aggregator canister

This error will keep popping up until the first SNS is created. So it is expected that you see it until the create SNS proposal is successful.

I could successfully execute

~/sns-testing$ dfx canister call sns_aggregator reconfigure '(opt record { update_interval_ms = 100; fast_interval_ms = 1_000_000_000; })'
()

from the root of the sns-testing directory in a Linux environment. From your error, it seems that you made the call before setup_locally.sh successfully finished (the reject message says that the canister contains no wasm module).

Hi Martin,

I started from scratch again, here’s the process I followed:

-First I’m using dfxvm locally on Linux with the latest version of dfx (0.20.0)
image

-I deleted the old sns-testing folder and cloned it again from source so we have a clean start

sudo rm -R sns-testing
git clone https://github.com/dfinity/sns-testing.git
cd sns-testing
  • Started the docker service (since it doesn’t start automatically after rebooting the OS)
    systemctl start docker

and then started the local replica instance through the docker

SNS_TESTING_INSTANCE=$(
   docker run -p 8000:8000 -p 8080:8080 -v "`pwd`":/dapp -d ghcr.io/dfinity/sns-testing:main dfx start --clean
)
while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Dashboard:'
do
   echo "Awaiting local replica ..."
   sleep 3
done

All good so far
image

  • Then I ran the setup script
    docker exec -it $SNS_TESTING_INSTANCE bash setup_locally.sh

Reading the log everything seems to be fine and executed correctly, here’s the full log

Now after this step as suggested on the README, I can access the NNS frontend dapp but the first error I get is this:

There was an unexpected error while loading the summaries of all deployed projects. Error converting data from aggregator canister

Which makes sense after trying to execute the call to reconfigure the sns_aggregator, as suggested I did it from the root of the sns-testing from the Linux environment (not from the bash inside the docker)

Somehow dfx can’t find the sns_aggregator canister locally, which I don’t understand why because reading the setup_locally.sh execution log it clearly states that it was created.

Please let me know what am I missing in here, it might be something easy but I’m just following the steps on the readme as best as I understand.

Following up with the instructions I ran the basic scenario script

docker exec $SNS_TESTING_INSTANCE bash run_basic_scenario.sh

Got this huge log but I can’t find any errors, only the workspace.resolver warning at the end
Here’s the full log:

Also, locally dfx still can’t find the sns_agregator canister


which makes no sense to me since the scripts have executed fine.

Then I entered the bash inside the docker

docker exec -it $SNS_TESTING_INSTANCE bash

But from the docker bash, I was able to execute the dfx command

At this point I still get the following errors browsing the local nns frontend dashboard

Now, I understand the error will keep popping until the first SNS is created, so I followed the instructions for the SNS Lifecycle

from the docker’s bash:

./cleanup.sh

image

since I don’t want to over complicate things at this point, I’ll use the test_canister

./deploy_test_canister.sh


But the script failed when trying to install the wasm module, I thought it could be that the rust environment could not be set properly, but reading the logs from the setup and basic setup it should’ve been fine.

But then I tried again with the same script and it worked

gave control of the dapp to the NNS

./let_nns_control_dapp.sh

submitted the NNS proposal to create the SNS for the test dapp

./propose_sns.sh

As suggested, I waited around 30 minutes the for SNS instance in the [Launchpad] (http://qsgjb-riaaa-aaaaa-aaaga-cai.localhost:8080/launchpad) section of the NNS dapp.

But still getting errors

At this point, I’m clueless on what to do next

If you’re using docker for sns-testing, then please execute calls to the SNS aggregator canister from within the docker.

What I’d try to do is to hard refresh your browser and check the replica logs (docker logs $SNS_TESTING_INSTANCE) to see if the SNS aggregator is experiencing any difficulties - normally it should periodically log that it could successfully fetch SNSs and that it commits them to a json file (that the NNS-dapp tries to fetch).

I did everything from within the docker bash, as shown in the screenshots and log

Here’s the docker log

it seems the replica crashed from start but somehow it executed the scripts just fine on the terminal

Is there a way to run the sns-testing from source in Linux instead of the docker?

I’ll start from scratch on Mac following the readme steps and post them here, but last try I got the same results

I don’t see the NNS proposal to create SNS in the logs. Did you make the NNS proposal to create SNS?

Sure, you can clone the repository, run ./install.sh, start ./bin/dfx start --clean, run ./setup_locally.sh, and then ./run_basic_scenario.sh. On Linux, this should all work natively.

getting same replica errors in mac, but the replica still initialises with the dashboard

Same on Linux, it crashes from start on a new cloned folder


[bizkit@archlinux sns-testing]$ ./bin/dfx start --clean
Running dfx start for version 0.19.0
Using shared network 'local' defined in /home/bizkit/.config/dfx/networks.json
2024-05-21T19:44:18.292994Z ERROR icx_proxy_dev: Runtime crashed
Error: Runtime crashed

Caused by:
    0: fail to fetch root key for http://localhost:8000/
    1: An error happened during communication with the replica: error trying to connect: tcp connect error: Connection refused (os error 111)
2024-05-21T19:44:20.458618Z ERROR icx_proxy_dev: Runtime crashed
Error: Runtime crashed

Caused by:
    0: fail to fetch root key for http://localhost:8000/
    1: An error happened during communication with the replica: error trying to connect: tcp connect error: Connection refused (os error 111)
Initialized replica.
Dashboard: http://localhost:8000/_/dashboard

There’s something about the neworks.json that isn’t working on the sns-testing setup, but I can use dfx locally without any problem with other dfx projects/canisters

my networks.json


actually there’s something wrong with dfx networks.json since I installed dfxvm

I was using 0.16.1 before and it was all fine

but now I can’t even use that version

I’m successfully using this networks.json with dfxvm on a Linux machine:

{
  "local": {
    "bind": "127.0.0.1:8080",
    "type": "ephemeral",
    "replica": {
      "subnet_type": "system"
    }
  }
}
1 Like