[BUG] Stable interface compatibility check failed for canister

I’m using dfx 0.9.2 to deploy a canister to the local network twice without modifying it and get the following error:

Stable interface compatibility check failed for canister 'dao'.
Upgrade will either FAIL or LOSE some stable variable data.

/Users/moritz/projects/ic/flower-power-dao/fpd/.dfx/local/canisters/dao/dao.old.most:2.39-2.40: syntax error [M0001], unexpected token '/', expected one of token or <phrase> sequence:
  }
  <typ_args>?
  ; seplist(<typ_field>,<semicolon>)
  or <typ>
  . <id>
  -> <typ_nobin>
  and <typ>

Do you want to proceed? yes/No

I already deleted the .dfx folder and ran dfx start --clean, but this didn’t change anything.

The .most files are identical, I guess this error is due to some sort of bug?

// dao.old.most

type Branch<K, V> = {left : Trie<K, V>; right : Trie<K, V>; size : Nat};
type Leaf<K, V> = {keyvals : AssocList/1<Key<K>, V>; size : Nat};
type List<T> = ?(T, List<T>);
type Proposal =
  {
    description : Text;
    expiryDate : Int;
    flowersVoted : List<Nat32>;
    id : Nat;
    options : [Option];
    proposer : Principal;
    state : ProposalState;
    timestamp : Int;
    title : Text;
    totalVotes : Nat
  };
actor {
  stable var nextProposalId : Nat;
  stable var proposals :
    {#branch : Branch<Nat, Proposal>; #empty; #leaf : Leaf<Nat, Proposal>};
  stable var votingHistories :
    {
      #branch : Branch<Principal, List<Nat>>;
      #empty;
      #leaf : Leaf<Principal, List<Nat>>
    }
};
// dao.most

type Branch<K, V> = {left : Trie<K, V>; right : Trie<K, V>; size : Nat};
type Leaf<K, V> = {keyvals : AssocList/1<Key<K>, V>; size : Nat};
type List<T> = ?(T, List<T>);
type Proposal =
  {
    description : Text;
    expiryDate : Int;
    flowersVoted : List<Nat32>;
    id : Nat;
    options : [Option];
    proposer : Principal;
    state : ProposalState;
    timestamp : Int;
    title : Text;
    totalVotes : Nat
  };
actor {
  stable var nextProposalId : Nat;
  stable var proposals :
    {#branch : Branch<Nat, Proposal>; #empty; #leaf : Leaf<Nat, Proposal>};
  stable var votingHistories :
    {
      #branch : Branch<Principal, List<Nat>>;
      #empty;
      #leaf : Leaf<Principal, List<Nat>>
    }
};

@chenyan @claudio @rossberg

3 Likes

Thanks for reporting this. We’re aware of the issue (a bug) and it should we fixed with moc 0.6.25.

This is another instance of the bug reported earlier here:

For now, if you are confident that you aren’t making any breaking changes, just click through and ignore the warning.

1 Like

To add, this breaks my CI by giving a false positive. For now, I’m using the yes utility to pass yes to everything

yes "yes" | dfx deploy --network ic

But this can lead to state losing bugs as everything is allowed now

Thanks for posting … getting the same thing and with a “yes” it does the equivalent to an “reinstall” blowing away state data … hope this upvotes the patch … :slight_smile:

WARNING!
Stable interface compatibility check failed for canister 'icpm'.
Upgrade will either FAIL or LOSE some stable variable data.
:1.14-1.15: syntax error [M0001], unexpected token '/', expected one of token or <phrase> sequence:
  = <typ>
  < seplist(<typ_bind>,,) > = <typ>
1 Like