diff --git a/CHANGELOG.md b/CHANGELOG.md index 02cc11faf3..b4c38b73d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ This used to be a warning. A hard error can abort the command so that no insecure state will be on the mainnet. -Users can surpress this error by setting `export DFX_WARNING=-mainnet_plaintext_identity`. +Users can suppress this error by setting `export DFX_WARNING=-mainnet_plaintext_identity`. The warning won't display when executing commands like `dfx deploy --playground`. @@ -48,6 +48,9 @@ Please top up your cycles balance by converting ICP to cycles like below: 'dfx cycles convert --amount=0.123'. ``` +If users run `dfx deploy --playground` but the backend is not updated with the latest frontend canister wasm +the error message will explain this properly and recommends asking for help on the forum since this can't be resolved by users. + ### chore: improve `dfx cycles convert` messages. If users run `dfx cycles convert` without enough ICP tokens, show additional messages to indicate what to do next. diff --git a/src/dfx/src/lib/operations/canister/motoko_playground.rs b/src/dfx/src/lib/operations/canister/motoko_playground.rs index 16c6e45db4..e8b5238e9a 100644 --- a/src/dfx/src/lib/operations/canister/motoko_playground.rs +++ b/src/dfx/src/lib/operations/canister/motoko_playground.rs @@ -1,5 +1,6 @@ +use crate::lib::diagnosis::DiagnosedError; use crate::lib::{environment::Environment, error::DfxResult}; -use anyhow::{bail, Context}; +use anyhow::{anyhow, bail, Context}; use candid::{encode_args, CandidType, Decode, Deserialize, Encode, Principal}; use dfx_core::config::model::canister_id_store::AcquisitionDateTime; use dfx_core::config::model::network_descriptor::{ @@ -210,7 +211,16 @@ pub async fn playground_install_code( .update(&playground_canister, "installCode") .with_arg(encoded_arg.as_slice()) .await - .context("install failed")?; + .map_err(|err| { + if is_asset_canister && err.to_string().contains("Wasm is not whitelisted") { + anyhow!(DiagnosedError { + error_explanation: Some("The frontend canister wasm needs to be allowlisted in the playground but it isn't. This is a mistake in the release process.".to_string()), + action_suggestion: Some("Please report this on forum.dfinity.org and mention your dfx version. You can get the version with 'dfx --version'.".to_string()), + }) + } else { + anyhow!(err) + } + })?; let out = Decode!(&result, CanisterInfo)?; out.get_timestamp() }