Failed to truncate heap of canister

It tried to update my code, but it seems like “dfx start” now loops forever with “failed to truncate heap of canister” and “Invalid argument” and I can’t uninstall-code nor delete the canister. What to do?

1 Like

Seems like a bug.

rm -rf .dfx in the directory you ran dfx start from might unblock you for now but I think you would lose all state by doing that.

yeah you can do rm -rf .dfx or dfx start --clean should achieve the same thing.
Was there something special you’re doing your canister’s pre-upgrade hook? are you able to share the code before the upgrade and after the upgrade?

start --clean made me run my new code, it was just playing with a greet example adding a new method inside the actor without input param like:

    public func senikk(): async Text {
        return "This is a message from senikk";
    };

It runned ok now with call canister. But after it runned I got “Cannot propose block as the locally available validation context is smaller than the parent” and “Failed to make a checkpoint” and now this is looping.

After running “dfx canister call hello senikk” it gives me the result but within a minute the trouble starts and I can’t do anything more, the only working solution now is --clean or rm -rf .dfx

I’m begin wondering if its Windows Subsystem for Linux (WSL) with Ubuntu I’m using right now which is causing the problems I have after calling functions successfully. Anyone with experience running with WSL?