# How to debug " Candid interface compatibility check "?

**URL:** <https://forum.dfinity.org/t/how-to-debug-candid-interface-compatibility-check/22807>\
**Category:** Developers\
**Tags:** candid, Discussing\
**Created:** [September 8, 2023, 10:39am UTC](https://forum.dfinity.org/t/how-to-debug-candid-interface-compatibility-check/22807 "2023-09-08T10:39:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![q2333gh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/q2333gh/32/36020_2.png) [@q2333gh](https://forum.dfinity.org/u/q2333gh)\
**Post date:** [September 8, 2023, 10:39am UTC](https://forum.dfinity.org/t/how-to-debug-candid-interface-compatibility-check/22807/1 "2023-09-08T10:39:49Z")

</div>

```rust
// ... end of my lib.rs code :
// new auto did generate: in ic_cdk 0.10.0
use ic_cdk::export_candid;
export_candid!();

```

```bash
btwl@btwl-virtual-machine ~/D/i/tax_lint (master)> dfx deploy backend
Please enter the passphrase for your identity: [hidden]
Decryption complete.
Deploying: backend
All canisters have already been created.
Building canisters...
WARN: Cannot check for vulnerabilities in rust canisters because cargo-audit is not installed. Please run 'cargo install cargo-audit' so that vulnerabilities can be detected.
Executing: cargo build --target wasm32-unknown-unknown --release -p backend --locked
   Compiling ic-cdk-macros v0.7.1
   Compiling ic-cdk v0.10.0
   Compiling ic-cdk-timers v0.4.0
   Compiling backend v0.1.0 (/home/btwl/Desktop/ic/tax_lint/backend)
    Finished release [optimized] target(s) in 9.03s
Installing canisters...
WARNING!
An error occurred during Candid interface compatibility check for canister 'backend'.

Generated did file should contain some service interface
Do you want to proceed? yes/No
yes
Upgrading code for canister backend, with canister ID bkyz2-fmaaa-aaaaa-qaaaq-cai
Deployed canisters.
URLs:
  Backend canister via Candid interface:
    backend: http://127.0.0.1:4943/?canisterId=bd3sg-teaaa-aaaaa-qaaba-cai&id=bkyz2-fmaaa-aaaaa-qaaaq-cai

```

the eeror: “An error occurred during Candid interface compatibility check for canister ‘backend’.” is kind of too simple that make me hard to check where goes wrong.  
Any good approach to fix that ?

---

<div class="post-metadata">

**Author:** ![chenyan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chenyan](https://forum.dfinity.org/u/chenyan)\
**Post date:** [September 8, 2023, 6:57pm UTC](https://forum.dfinity.org/t/how-to-debug-candid-interface-compatibility-check/22807/2 "2023-09-08T18:57:27Z")

</div>

> [@q2333gh](#):
>
> `Generated did file should contain some service interface`

It’s likely that the did file you generated is empty.

---

<div class="post-metadata">

**Author:** ![q2333gh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/q2333gh/32/36020_2.png) [@q2333gh](https://forum.dfinity.org/u/q2333gh)\
**Post date:** [September 9, 2023, 2:30am UTC](https://forum.dfinity.org/t/how-to-debug-candid-interface-compatibility-check/22807/3 "2023-09-09T02:30:58Z")

</div>

Yes, its empty.If i use hand made generate. : cargo build & wasmtime it is something like this :  
lake of function body:

```bash
# cargo build --target wasm32-unknown-unknown --release --package "backend" --features "ic-cdk/wasi"
# wasmtime "./target/wasm32-unknown-unknown/release/backend.wasm" > backend.did --allow-precompiled

type Result = variant { Ok : text; Err : text };
service : () -> {
  get_caller : () -> (text) query;
  greet : (text) -> (text) query;
  next_id : () -> (nat64) query;
  now : () -> (nat64) query;
  register_user : () -> (Result);
}

```

---

<div class="post-metadata">

**Author:** ![chenyan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chenyan](https://forum.dfinity.org/u/chenyan)\
**Post date:** [September 9, 2023, 2:41am UTC](https://forum.dfinity.org/t/how-to-debug-candid-interface-compatibility-check/22807/4 "2023-09-09T02:41:24Z")

</div>

Do you put this generated did file in `dfx.json`? e.g., `candid = "backend.did"`
