# Problem upgrading front-end canister on IC

**URL:** <https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385>\
**Category:** Developers\
**Created:** [July 18, 2022, 5:02pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385 "2022-07-18T17:02:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveyEbb](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DaveyEbb](https://forum.dfinity.org/u/DaveyEbb)\
**Post date:** [July 18, 2022, 5:02pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/1 "2022-07-18T17:02:05Z")

</div>

I am trying to upgrade an IC deployment with new code (Rust backend and vue.js frontend). It deploys nicely and works perfectly locally. The `canister-ids.js` file is as follows:

```nohighlight
{
  "rust_simplifire": {
    "ic": "redgg-aaaaa-aaaap-qaesa-cai"
  },
  "rust_simplifire_assets": {
    "ic": "rdcas-nyaaa-aaaap-qaesq-cai"
  }
}

```

The Rust canister appears to upgrade OK:

```auto
$ dfx canister --network ic install --mode=reinstall rust_simplifire
WARNING!
You are about to reinstall the rust_simplifire canister
This will OVERWRITE all the data and code in the canister.

YOU WILL LOSE ALL DATA IN THE CANISTER.");

Do you want to proceed? yes/No
yes
Reinstalling code for canister rust_simplifire, with canister_id redgg-aaaaa-aaaap-qaesa-cai

```

But the front-end canister upgrade fails as follows:

```auto
dfx canister --network ic install --mode=reinstall rust_simplifire_assets
WARNING!
You are about to reinstall the rust_simplifire_assets canister
This will OVERWRITE all the data and code in the canister.

YOU WILL LOSE ALL DATA IN THE CANISTER.");

Do you want to proceed? yes/No
yes
Reinstalling code for canister rust_simplifire_assets, with canister_id rdcas-nyaaa-aaaap-qaesq-cai
Error: No such file or directory (os error 2)

```

Not sure what I’m doing wrong. Any suggestions most welcome.

Dave

---

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [July 18, 2022, 5:11pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/2 "2022-07-18T17:11:30Z")

</div>

I think the error message might be improved in newer versions of `dfx` but I would compare the files you have on disk with the file paths mentioned in your `dfx.json` and see if something is missing.

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [July 18, 2022, 6:10pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/3 "2022-07-18T18:10:09Z")

</div>

Did you recently upgrade to newer version of dfx `v0.11.0`? Not sure it is related but there is a breaking change regarding assets that was announced in this thread [Dfx 0.11.0 is promoted with breaking changes](https://forum.dfinity.org/t/dfx-0-11-0-is-promoted-with-breaking-changes/14327)

---

<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:** [July 18, 2022, 8:52pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/4 "2022-07-18T20:52:21Z")

</div>

Check the `source` config in dfx.json. Are all the directories listed there actually present?

---

<div class="post-metadata">

**Author:** ![DaveyEbb](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DaveyEbb](https://forum.dfinity.org/u/DaveyEbb)\
**Post date:** [July 19, 2022, 5:04am UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/5 "2022-07-19T05:04:26Z")

</div>

I can see the dfx.json source files & directory fine from the root directory, Kyle. `dfx.json` is:

```nohighlight
"canisters": {
    "rust_simplifire": {
      "candid": "src/rust_simplifire/rust_simplifire.did",
      "package": "rust_simplifire",
      "type": "rust"
    },
    "rust_simplifire_assets": {
      "dependencies": [
        "rust_simplifire"
      ],
      "frontend": {
        "entrypoint": "dist/rust_simplifire_assets/index.html"
      },
      "source": [
        "dist/rust_simplifire_assets/"
      ],
      "type": "assets"
    }
  },
  "defaults": {
    "build": {
      "args": "",
      "packtool": ""
    }
  },
  "dfx": "0.9.3",
  "networks": {
    "local": {
      "bind": "127.0.0.1:8000",
      "type": "ephemeral"
    }
  },
  "version": 1

```

---

<div class="post-metadata">

**Author:** ![DaveyEbb](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DaveyEbb](https://forum.dfinity.org/u/DaveyEbb)\
**Post date:** [July 19, 2022, 6:11am UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/6 "2022-07-19T06:11:45Z")

</div>

We’re still on dfx 0.9.3. Should we upgrade?

---

<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:** [July 19, 2022, 4:11pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/7 "2022-07-19T16:11:23Z")

</div>

I see two odd things here - the `entrypoint` is pointing to your `dist` directory. Generally Webpack uses this to determine the entrypoint for your code bundling.

Can you confirm that your `npm build` job is successfully outputting to `dist/rust_simplifire_assets` and not just `dist`? Providing your webpack config may help too

---

<div class="post-metadata">

**Author:** ![DaveyEbb](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DaveyEbb](https://forum.dfinity.org/u/DaveyEbb)\
**Post date:** [July 20, 2022, 6:11am UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/8 "2022-07-20T06:11:31Z")

</div>

We do have the `dist/rust_simplifire_assets` folder. Our webpack config can be seen on this link: [simplifire-ic/webpack.config.js at master · Simplifire/simplifire-ic · GitHub](https://github.com/Simplifire/simplifire-ic/blob/master/webpack.config.js)

---

<div class="post-metadata">

**Author:** ![DaveyEbb](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@DaveyEbb](https://forum.dfinity.org/u/DaveyEbb)\
**Post date:** [July 20, 2022, 1:55pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/9 "2022-07-20T13:55:42Z")

</div>

I seem to have found a way around the problem, Kyle. I used `sudo dfx -v deploy --network ic` instead of `dfx canister --network ic install --mode=reinstall rust_simplifire`

It deployed the two canisters:

```auto
Deployed canisters.
URLs:
  Frontend:
    rust_simplifire_assets: https://rdcas-nyaaa-aaaap-qaesq-cai.ic0.app/
  Candid:
    rust_simplifire: https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app/?id=redgg-aaaaa-aaaap-qaesa-cai

```

The new code is visible through the frontend URL and, upon initial testing, all looks good.

Should we continue to use this for new versions of code (noting that we are still in prototype mode so loss of data is not an issue)?

Thanks

Dave

---

<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:** [July 20, 2022, 4:24pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/10 "2022-07-20T16:24:32Z")

</div>

`dfx deploy --network ic` is a perfectly fine pattern, and won’t delete your canister’s state like `--mode=reinstall` does. If you need to use `sudo`, there’s something weird about your dfx installation

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [July 20, 2022, 5:24pm UTC](https://forum.dfinity.org/t/problem-upgrading-front-end-canister-on-ic/14385/11 "2022-07-20T17:24:11Z")

</div>

> [@anon74414410](#):
>
> If you need to use `sudo`,

I remember having issue with permission on OSX too. If @DaveyEbb you deploy on OSX too and if it can be useful, here what solved my scheme: [Permissions on OSX - #2 by peterparker](https://forum.dfinity.org/t/permissions-on-osx/5853/2)
