This could happen if the PocketIC instance is not stopped properly (and thus its state is corrupted). To stop the PocketIC instance properly, you should:
- run
dfx stop; - or hit
Ctrl-Cin the terminal tab executingdfx start(or send SIGINT - corresponding toCtrl-C- todfx startin a non-interactive environment).
And you should not run dfx start after dfx killall. In other words, if you have to run dfx killall (or kill the container etc.), then you should use dfx start --clean afterwards.
I took a note to produce a comprehensible error message in PocketIC if the state is corrupted.