# DFX12.1 canister import don't work anymore when deploying single canister

**URL:** <https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749>\
**Category:** Language Support\
**Tags:** Motoko\
**Created:** [November 21, 2022, 3:44pm UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749 "2022-11-21T15:44:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinny](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vinny](https://forum.dfinity.org/u/vinny)\
**Post date:** [November 21, 2022, 3:44pm UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749/1 "2022-11-21T15:44:11Z")

</div>

Hey community,

I have a little issue breaking my deplyment pipelines since migrating to dfx 12.1.  
`dfx deploy --network=xxx` works fine to deploy all the canisters  
Yet, deploying a single does not work and throw an error I have never faced before:

```auto
All canisters have already been created.
Building canisters...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build call canisters.
    Failed while trying to build all canisters.
      [...]
Stdout:

Stderr:
/Users/shef/projects/theshelf/dfinity-infra/backend/dfinity/user_db/user_db.mo:17.1-17.47: import error [M0009], file "/Users/shef/projects/theshelf/dfinity-infra/.dfx/ic/canisters/idl/aq43c-6yaaa-aaaao-aaxfa-cai.did" does not exist

```

The line in question is canister import:  
`import SocialNetwork "canister:social_network";`

The reason why I need this, is that I need to `deploy --mode=reinstall` quite frequently, which only works for single-canister deploys.

Any idea how I can resolve this?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [November 21, 2022, 4:00pm UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749/2 "2022-11-21T16:00:20Z")

</div>

What version were you using previously and do you have something that I could play around with? I’ve seen the same error a few times now but couldn’t get my hands on an example to test a potential fix on

---

<div class="post-metadata">

**Author:** ![vinny](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vinny](https://forum.dfinity.org/u/vinny)\
**Post date:** [November 21, 2022, 4:05pm UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749/3 "2022-11-21T16:05:16Z")

</div>

I was using dfx 11.2 previously.  
I don’t have enoigh resource to build an example right now, but as you’re part of the dfinity team, I guess I could give you acces to the codebase temporarily - would that work for you?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [November 21, 2022, 4:09pm UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749/4 "2022-11-21T16:09:39Z")

</div>

Yes, thank you, that would be great! My GH user is [sesi200 (Severin Siffert) · GitHub](https://github.com/sesi200)

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [November 23, 2022, 10:37am UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749/5 "2022-11-23T10:37:00Z")

</div>

Will be fixed in this PR: [fix: dfx deploy --mode reinstall for single canisters fails because of dependent canisters by sesi200 · Pull Request #2779 · dfinity/sdk · GitHub](https://github.com/dfinity/sdk/pull/2779)

---

<div class="post-metadata">

**Author:** ![vinny](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vinny](https://forum.dfinity.org/u/vinny)\
**Post date:** [November 23, 2022, 12:53pm UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749/6 "2022-11-23T12:53:04Z")

</div>

just an fyi regarding the current fix: the same error still get thrown if the deployer’s identity is **not** authorized.  
Without the `--mode=reinstall`, the CLI would return: `The replica returned an HTTP Error: Http Error: status 403 Forbidden, content type "application/cbor", content: Only controllers of canister aq43c-6yaaa-aaaao-aaxfa-cai can call ic00 method install_code`, which makes sense.  
Perhaps a little misleading for people who are not in the know 😉

Anyway, thought you might want to know as you were interested in this original error message

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [November 23, 2022, 1:24pm UTC](https://forum.dfinity.org/t/dfx12-1-canister-import-dont-work-anymore-when-deploying-single-canister/16749/7 "2022-11-23T13:24:50Z")

</div>

> [@vinny](#):
>
> just an fyi regarding the current fix: the same error still get thrown if the deployer’s identity is **not** authorized.

Clarification: You mean you still get a **compilation** error if you use a different identity? In the test case I wrote I get a 403 forbidden in both cases.
