# Cannot deploy to DSocial canister

**URL:** <https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268>\
**Category:** Developers\
**Created:** [July 11, 2022, 1:34pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268 "2022-07-11T13:34:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashley](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Ashley](https://forum.dfinity.org/u/Ashley)\
**Post date:** [July 11, 2022, 1:34pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/1 "2022-07-11T13:34:34Z")

</div>

Trying to upload to my front end Canister and it’s erroring, I’ve added the controller. It still doesn’t work:

`Error: The Replica returned an error: code 4, message: "Caller is not authorized"`

 ![Screenshot 2022-07-11 at 15.33.16](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/4/46bbc3ae75a8d4449d4247d6b6d35fe651185ae8.png)

---

<div class="post-metadata">

**Author:** ![1eo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/1eo/32/25778_2.png) [@1eo](https://forum.dfinity.org/u/1eo)\
**Post date:** [July 11, 2022, 1:38pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/2 "2022-07-11T13:38:41Z")

</div>

Are you sure you are using the right identity ?

dfx identity get-principal

---

<div class="post-metadata">

**Author:** ![domwoe](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/domwoe/32/5165_2.png) [@domwoe](https://forum.dfinity.org/u/domwoe)\
**Post date:** [July 11, 2022, 1:47pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/3 "2022-07-11T13:47:19Z")

</div>

The certified asset canister keeps its own state of [authorized principles](https://github.com/dfinity/cdk-rs/blob/39688bd8151c714436462ad9da457fd99f9a2082/src/ic-certified-assets/src/state_machine.rs#L217) independent of the controllers of the actual canister.

Initially only the principal that installed the certified asset canister is in this list of authorized principals.

---

<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 11, 2022, 7:19pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/4 "2022-07-11T19:19:05Z")

</div>

Did you upgrade dfx recently? You may have a conflict between a canister that was proxied through a cycles wallet, and making the call directly from your dfx identity.

Try this command to auto-fix those settings for your project:

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

---

<div class="post-metadata">

**Author:** ![Ashley](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Ashley](https://forum.dfinity.org/u/Ashley)\
**Post date:** [July 12, 2022, 11:36am UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/5 "2022-07-12T11:36:41Z")

</div>

Yeah I tried the following with the return value from `dfx identity get-principal`

`dfx canister --network ic call "dwqte-viaaa-aaaai-qaufq-cai" authorize '(principal "...")'`

Still getting the same error. On deploy ☹

---

<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 12, 2022, 3:25pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/6 "2022-07-12T15:25:38Z")

</div>

Okay, if that’s erroring it’s probably because the owner is already authorized. What exact command are you using to deploy, and what version of `dfx` are you using?

---

<div class="post-metadata">

**Author:** ![Ashley](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Ashley](https://forum.dfinity.org/u/Ashley)\
**Post date:** [July 12, 2022, 7:45pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/7 "2022-07-12T19:45:11Z")

</div>

`dfx: 0.10.0`

command is `dfx deploy --network ic --no-wallet`

here’s the `dfx.json`

```auto
{
  "canisters": {
    "feedback": {
      "main": "src/backend/feedback.mo",
      "type": "motoko"
    },
    "dsocial": {
      "main": "src/backend/main.mo",
      "type": "motoko"
    },
    "frontend" : {
      "dependencies": ["dsocial", "feedback"],
      "frontend": {
        "entrypoint": "build/index.html"
      },
      "source": [
        "build"
      ],
      "type": "assets"
    }
  },
  "defaults": {
    "build": {
      "output": "canisters",
      "packtool": ""
    }
  },
  "networks": {
    "local": {
      "bind": "127.0.0.1:8000",
      "type": "ephemeral"
    }
  },
  "version": 1
}

```

Thanks for your help, here to do anything to get this resolved. Lots of code to deploy!!

---

<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 12, 2022, 8:07pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/8 "2022-07-12T20:07:10Z")

</div>

Try removing `--no-wallet`. It’s deprecated in 0.10.0, although I notice it still shows up in the help command

---

<div class="post-metadata">

**Author:** ![Ashley](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Ashley](https://forum.dfinity.org/u/Ashley)\
**Post date:** [July 12, 2022, 8:34pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/9 "2022-07-12T20:34:55Z")

</div>

> [@anon74414410](#):
>
> `dfx identity --network ic get-wallet)`

This is a bit scary TBH, from what I can see I have to setup a new wallet? But I already have an NNS account linked to an Internet Identity that owns all the canisters for DSocial. Can I not use this account already with a ton of ICP and setup?

Would be cool if you could just `dfx login` and it would auth you with your NNS account and just work out the box. Feels like I could easily make a mistake here.

I’m probably not understanding how to do this, I simply want to deploy to my current canisters. Backend canisters work no problem, it is just this front canister that is not working.

---

<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 12, 2022, 8:53pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/10 "2022-07-12T20:53:43Z")

</div>

Oh wait, this isn’t a matter of controllers at all. This is about uploads after the fact.

You can either reinstall the asset canister with

```auto
dfx build
dfx canister install <asset-canister> --mode reinstall

```

or you need to call the `authorize` method on your canister with your  
current ID. Your identity is a controller, but it is not authorized to upload assets, for some convoluted reason.

---

<div class="post-metadata">

**Author:** ![Ashley](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Ashley](https://forum.dfinity.org/u/Ashley)\
**Post date:** [July 12, 2022, 9:10pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/11 "2022-07-12T21:10:37Z")

</div>

Thanks Kyle - will this allow reinstall the dep canisters or just the frontend canister? Forgive my fear, just don’t want to lose all previous state

---

<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 12, 2022, 9:53pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/12 "2022-07-12T21:53:21Z")

</div>

specifying the name of the asset canister for `dfx install` will only affect the named canister.

We also have protection against running `dfx install` with `--mode reinstall` for all canisters. It is only allowed while targeting a single canister

---

<div class="post-metadata">

**Author:** ![Ashley](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Ashley](https://forum.dfinity.org/u/Ashley)\
**Post date:** [July 12, 2022, 10:02pm UTC](https://forum.dfinity.org/t/cannot-deploy-to-dsocial-canister/14268/13 "2022-07-12T22:02:39Z")

</div>

Fixed, paid subscriptions is now LIVE!
