# Upgrade canister on ic with new dfx version

**URL:** <https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546>\
**Category:** Developers\
**Created:** [January 28, 2022, 3:37pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546 "2022-01-28T15:37:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinli](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@kevinli](https://forum.dfinity.org/u/kevinli)\
**Post date:** [January 28, 2022, 3:37pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/1 "2022-01-28T15:37:39Z")

</div>

I have an existing canister on mainnet that was deployed with 0.8.4. I want to use the new heartbeat functionality with motoko in 0.9.0. If I try to upgrade my canister on the ic with dfx 0.9.0, I get error:

```auto
The replica returned an HTTP Error: Http Error: status 403 Forbidden, content type "", content: Requested canister rejected the message

```

How do I upgrade my canister code with dfx 0.9.0 (I obviously cannot reinstall my code and lose state)?

---

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [January 28, 2022, 11:40pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/2 "2022-01-28T23:40:50Z")

</div>

Might be related to [Dfx generate failing in 0.9.0](https://forum.dfinity.org/t/dfx-generate-failing-in-0-9-0/10470), not sure…

---

<div class="post-metadata">

**Author:** ![senior.joinu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/senior.joinu/32/9240_2.png) [@senior.joinu](https://forum.dfinity.org/u/senior.joinu)\
**Post date:** [January 31, 2022, 6:42pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/3 "2022-01-31T18:42:31Z")

</div>

Running into the same problem.

UPD: figured it out - since `--no-wallet` behavior is now the default one, you have to specify a wallet to deploy from.

```auto
dfx deploy --network ic --wallet <wallet-canister-id> 

```

---

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [January 31, 2022, 11:45pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/4 "2022-01-31T23:45:30Z")

</div>

That seems like a problem almost every IC dev will run into. Hope they can document that somewhere…

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [January 31, 2022, 11:56pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/5 "2022-01-31T23:56:00Z")

</div>

We will document that in the release notes - it’s not related to `dfx generate`, just the wallet changes.

We haven’t published those changes to [smartcontracts.org](http://smartcontracts.org) yet, since there hasn’t been an official, blessed build of 0.9.x, but it is documented in the sdk [changelog](https://github.com/dfinity/sdk/blob/master/CHANGELOG.adoc#feat-remove-the-wallet-proxy-and-the---no-wallet-flag)

---

<div class="post-metadata">

**Author:** ![bitdivine](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bitdivine/32/246_2.png) [@bitdivine](https://forum.dfinity.org/u/bitdivine)\
**Post date:** [February 4, 2022, 3:40am UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/6 "2022-02-04T03:40:02Z")

</div>

I note that [Network deployment :: Internet Computer](https://smartcontracts.org/docs/quickstart/network-quickstart.html) shows dfx version 0.9.0 but the “dfx deploy” does not use the --wallet flag.

---

<div class="post-metadata">

**Author:** ![ericswanson](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ericswanson/32/622_2.png) [@ericswanson](https://forum.dfinity.org/u/ericswanson)\
**Post date:** [February 7, 2022, 11:13pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/7 "2022-02-07T23:13:33Z")

</div>

You’ll have to upgrade your wallet canister and run a command to upgrade your other canisters in order to use dfx 0.9.0. This is documented in the [changelog](https://github.com/dfinity/sdk/blob/master/CHANGELOG.adoc#feat-remove-the-wallet-proxy-and-the---no-wallet-flag) and in the [release notes](https://smartcontracts.org/docs/release-notes/0.9.0-rn.html). After running the steps to upgrade, you should not need the `--wallet` parameter.

Unfortunately we’ve published the dfx 0.9.0 release notes, as well as updated the docs to use dfx 0.9.0, but have not yet promoted dfx 0.9.0.

> Breaking change: Canister commands, except for `dfx canister create`, will make the call directly, rather than via the user’s wallet. The `--no-wallet` flag is thus removed from `dfx canister` as its behavior is the default.
> 
> When working with existing canisters, use the `--wallet` flag in conjunction with `dfx identity get-wallet` in order to restore the old behavior.

> You will need to upgrade your wallet and each of your existing canisters to work with the new system. To do so, execute the following in each of your dfx projects:

```auto
dfx wallet upgrade
dfx canister --wallet "$(dfx identity get-wallet)" update-settings --all --add-controller "$(dfx identity get-principal)"

```

> To upgrade projects that you have deployed to the IC mainnet, execute the following:

```auto
dfx wallet --network ic upgrade
dfx canister --network ic --wallet "$(dfx identity --network ic get-wallet)" update-settings --all --add-controller "$(dfx identity get-principal)"

```

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [February 8, 2022, 9:10pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/8 "2022-02-08T21:10:27Z")

</div>

When I try to start the replica locally by `dfx start --clean` I get this error

dfx --version  
`dfx 0.9.0`

```auto
dfx start --clean
Starting webserver for /_/
binding to: 127.0.0.1:52065
Feb 08 21:01:21.165 INFO ic-starter. 
Configuration: ValidatedConfig { replica_path: Some("/Users/t/.cache/dfinity/versions/0.9.0/replica"), 
replica_version: "0.8.0", log_level: Warning, cargo_bin: "cargo", cargo_opts: "", 
state_dir: "/Users/t/dev/play-ground/dfinity/ic/.dfx/state/replicated_state", 
http_listen_addr: 127.0.0.1:0, 
http_port_file: Some("/Users/t/dev/play-ground/dfinity/ic/.dfx/replica-configuration/replica-1.port"), 
metrics_addr: None, provisional_whitelist: Some(All), 
artifact_pool_dir: "/Users/t/dev/play-ground/dfinity/ic/.dfx/state/replicated_state/node-100/ic_consensus_pool", 
crypto_root: "/Users/t/dev/play-ground/dfinity/ic/.dfx/state/replicated_state/node-100/crypto", state_manager_root: "/Users/t/dev/play-ground/dfinity/ic/.dfx/state/replicated_state/node-100/state", 
registry_local_store_path: "/Users/t/dev/play-ground/dfinity/ic/.dfx/state/replicated_state/ic_registry_local_store", 
unit_delay: None, initial_notary_delay: Some(600ms), 
dkg_interval_length: None, detect_consensus_starvation: None, consensus_pool_backend: Some("rocksdb"), 
state_dir_holder: None }, Application: starter
Feb 08 21:01:21.166 INFO Initialize replica configuration "/Users/t/dev/play-ground/dfinity/ic/.dfx/state/replicated_state/ic.json5", Application: starter
Feb 08 21:01:22.199 INFO Executing "/Users/t/.cache/dfinity/versions/0.9.0/replica" "--replica-version" "0.8.0" "--config-file" "/Users/t/dev/play-ground/dfinity/ic/.dfx/state/replicated_state/ic.json5", Application: starter
Feb 08 21:01:22.566 WARN s:mah4l-zsgxh-wawlh-t4kpk-32pc2-n4thb-irypx-xolts-beg3g-b3wme-kae/n:r3c3j-qyrl4-fiucz-kj2qk-fhshq-pm2xm-7ngcu-wr5g7-qce2p-mesa2-gae/ic_p2p/advert_utils AdvertRequestBuilder::new(): advert_config = None
version: 0.7.0
 Feb 08 22:01:22.679 INFO Log Level: INFO
 Feb 08 22:01:22.680 INFO Starting server. 
Listening on http://127.0.0.1:8000/
Feb 08 21:01:23.092 WARN 
s:mah4l-zsgxh-wawlh-t4kpk-32pc2-n4thb-irypx-xolts-beg3g-b3wme-kae/n:r3c3j-qyrl4-fiucz-kj2qk-fhshq-pm2xm-7ngcu-wr5g7-qce2p-mesa2-gae/ic_consensus/payload_builder max_block_payload_size too small. 
current value: 0, required minimum: 3670016! max_block_payload_size must be larger than max_ingress_bytes_per_message and MAX_XNET_PAYLOAD_IN_BYTES. Update registry!

```

---

<div class="post-metadata">

**Author:** ![ericswanson](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ericswanson/32/622_2.png) [@ericswanson](https://forum.dfinity.org/u/ericswanson)\
**Post date:** [February 8, 2022, 11:31pm UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/9 "2022-02-08T23:31:29Z")

</div>

Yes, you can ignore this warning. It’s described in the release notes:

> **[Internet Computer | Documentation](https://smartcontracts.org/docs/release-notes/0.9.0-rn.html#_repeated_warning_about_missing_max_block_payload_size_registry_setting)**
>
> Documentation for the internet computer.

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [February 9, 2022, 7:03am UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/10 "2022-02-09T07:03:35Z")

</div>

Thanks for the reply.

I have tried to upgrade the wallet but I keep getting this error.

`dfx wallet --network ic upgrade`

`The replica returned an HTTP Error: Http Error: status 403 Forbidden, content type "", content: Requested canister rejected the message`

```auto
dfx -V
dfx 0.9.0

```

And I made sure my principal is the controller of the wallet.

Not sure if this has something to do with it but my deployed production wallet has more than one controller.

---

<div class="post-metadata">

**Author:** ![MaxLascombe](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/maxlascombe/32/4606_2.png) [@MaxLascombe](https://forum.dfinity.org/u/MaxLascombe)\
**Post date:** [February 24, 2022, 4:07am UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/11 "2022-02-24T04:07:34Z")

</div>

Omg I was stuck on this for like 3 hours. Thanks for this!

---

<div class="post-metadata">

**Author:** ![Safik](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/safik/32/953_2.png) [@Safik](https://forum.dfinity.org/u/Safik)\
**Post date:** [February 24, 2022, 11:59am UTC](https://forum.dfinity.org/t/upgrade-canister-on-ic-with-new-dfx-version/10546/12 "2022-02-24T11:59:19Z")

</div>

I have exactly the same error. When I create cans in the operation and fill the data (Blob) into them. The local environment freezes and even restarting dfx does not help. We have to build new canisters of services.Something like that…

> ic\_consensus/payload\_builder max\_block\_payload\_size too small. current value: 0, required minimum: 3670016! max\_block\_payload\_size must be larger than max\_ingress\_bytes\_per\_message and MAX\_XNET\_PAYLOAD\_IN\_BYTES. Update registry!
