# Error when trying to make an inter canister call in a motoko project

**URL:** <https://forum.dfinity.org/t/error-when-trying-to-make-an-inter-canister-call-in-a-motoko-project/19984>\
**Category:** Motoko\
**Created:** [May 14, 2023, 9:55am UTC](https://forum.dfinity.org/t/error-when-trying-to-make-an-inter-canister-call-in-a-motoko-project/19984 "2023-05-14T09:55:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [May 14, 2023, 9:55am UTC](https://forum.dfinity.org/t/error-when-trying-to-make-an-inter-canister-call-in-a-motoko-project/19984/1 "2023-05-14T09:55:27Z")

</div>

I am trying to make inter canister calls to a deployed canister from my local canister as follows by interface:

```auto
public shared func getProducts() : async [ProductWithId] {

    let productsInterface = actor ("yg4ya-nyaaa-anaal-qb8eq-cai") : actor {
      getAllProducts : shared query () -> async [ProductWithId];
    };

    let products = await productsInterface.getAllProducts();

    Debug.print(debug_show(products));

    return products;
  };

```

I an getting this error:

```auto
Call was rejected:
Request ID: 2d550165d9436ed018c6f7cafc31c156baa9f583051085114972f50b08267116
Reject code: 4
Reject text: No route to canister yg4ya-nyaaa-anaal-qb8eq-cai

```

What am I missing?

---

<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:** [May 15, 2023, 7:23am UTC](https://forum.dfinity.org/t/error-when-trying-to-make-an-inter-canister-call-in-a-motoko-project/19984/2 "2023-05-15T07:23:05Z")

</div>

Are you saying you’re trying to make a call to mainnet from local? That will not work. You have to have the same canister deployed locally, too

---

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [May 15, 2023, 11:04am UTC](https://forum.dfinity.org/t/error-when-trying-to-make-an-inter-canister-call-in-a-motoko-project/19984/3 "2023-05-15T11:04:24Z")

</div>

I deployed both of them, that workded, thanks
