CanisterError: "ic0_call_new" cannot be executed in non replicated query mode

Hi, @hpeebles. I got some error when deploying project on the internet computer.

Uncaught (in promise) Error: Call failed:
  Canister: on724-jqaaa-aaaap-abjbq-cai
  Method: get_posts_by_category (query)
  "Status": "rejected"
  "Code": "CanisterError"
  "Message": "IC0504: Canister on724-jqaaa-aaaap-abjbq-cai violated contract: \"ic0_call_new\" cannot be executed in non replicated query mode"
    at 3171-9e1554add3832ea9.js:16:4497
    at async m (8566-436911c062079394.js:1:10817)
    at async E (32-13d39f95f56180a6.js:1:5788)

I think this is because I use inter-canister call, but it works fine on local IC.
I set environment like this in dfx.json

  "networks": {
    "local": {
      "bind": "127.0.0.1:8080",
      "type": "ephemeral",
      "replica": {
        "subnet_type": "system"
      }
    },
    "ic": {
      "providers": ["https://ic0.app/"],
      "type": "persistent"
    },
    "ic_test": {
      "providers": ["https://ic0.app/"],
      "type": "persistent"
    },
    "web_test": {
      "providers": ["https://ic0.app/"],
      "type": "persistent"
    }
  },

Need to configure anything else when deploying to mainnet?

Hope to your answer.

It looks like you’re trying to do a cross_canister call from a query method. Have you marked your method as a composite query?

The problem you might be having in production is attempting to do a cross_canister call across subnets, which as far as I know is not currently supported. Just an idea.

2 Likes

Thanks for your response.

How do I get information from other canisters in query method?
Should I replace the query with update?
But, the update method burns many cycles.

Can you give me any solution for that?