Skip to content

Commit 9ec3f63

Browse files
viviveeveerikonor
authored andcommitted
chore!: improve error message about canister ranges (#3786)
1 parent 4da63f9 commit 9ec3f63

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
Now displays `Using the default configuration for the local shared network.`
88
instead of `Using the default definition for the 'local' shared network because ~/.config/dfx/networks.json does not define it.`
99

10+
### chore!: Improved error message about canister ranges when directly connecting to a node on a non-root subnet
11+
1012
### feat: `dfx start` for the shared local network stores replica state files in unique directories by options
1113

1214
The state files for different replica versions are often incompatible,

src/dfx/src/lib/diagnosis.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ pub fn diagnose(err: &AnyhowError) -> Diagnosis {
4747
if let Some(agent_err) = err.downcast_ref::<AgentError>() {
4848
if not_a_controller(agent_err) {
4949
return diagnose_http_403();
50+
} else if *agent_err == AgentError::CertificateNotAuthorized() {
51+
return subnet_not_authorized();
5052
}
5153
}
5254

@@ -98,6 +100,11 @@ The most common way this error is solved is by running 'dfx canister update-sett
98100
)
99101
}
100102

103+
fn subnet_not_authorized() -> Diagnosis {
104+
let action_suggestion = "If you are connecting to a node directly instead of a boundary node, try using --provisional-create-canister-effective-canister-id with a canister id in the subnet's canister range. First non-root subnet: 5v3p4-iyaaa-aaaaa-qaaaa-cai, second non-root subnet: jrlun-jiaaa-aaaab-aaaaa-cai";
105+
(None, Some(action_suggestion.to_string()))
106+
}
107+
101108
fn duplicate_asset_key_dist_and_src(sync_error: &SyncError) -> bool {
102109
fn is_src_to_dist(path0: &Path, path1: &Path) -> bool {
103110
// .../dist/<canister name>/... and .../src/<canister name>/assets/...

0 commit comments

Comments
 (0)