Getting an error when trying to install my cannister

Hey there

I’m trying to make a video about this tutorial https://sdk.dfinity.org/developers-guide/tutorials/counter-tutorial.html however when I run the “dfx canister install counter” command I get the following error :

Unable to deserialize read response: invalid type: byte array, expected internally tagged enum

I double checked all the names in the JSON file, directory names and motoko code is exactly the same as in the tutorial. Does anybody know what might be causing this?

2 Likes

Is this on version 0.4.9 MacOS?

2 Likes

Yep. Does anybody have experience with this error?

1 Like

Did you use dfx 0.4.9 to build the canister? We don’t guarantee that a WASM built with an older version of dfx can use with a newer version (we’re still in alpha).

2 Likes

Yeah I build the cannister and downloaded the latest version. I believe I did that tutorial already when dfinity released the sdk and it worked at that time. Strange that it doesn’t now.

1 Like

Are you able to launch a node on the v0.4.9? Maybe its just my machine but I am having trouble starting a node when I download the latest version

It gets hung in a loop forever trying to reattempt to create a client and I get this error:
CRIT Failed to compile Wasm that is known to be good: ContractViolation("Module imports function \'arg_data_size\' that is not exported by the runtime."), state_manager/src/lib.rs:61:17

My machine is running Linux (Ubuntu to be specific).

2 Likes

This is the same error as here: [Bug] Failed to compile Wasm that is known to be good

Deleting the temp checkpoints file fixes it. (On Ubuntu it’s under /tmp)

@Comp_Sci

2 Likes

Thanks @Ori. That seems to temporarily fix it. However like @Fulco I am now seeing issues an error when installing the canister. I am just using the standard project with no edits newly created for version 0.4.9 and I sometimes get the same error. Other times I get a 504 error.

It looks like something might be amiss when upgrading to the latest version from a previous version.

1 Like

There isn’t really an “upgrade” path right now, unfortunately. We’re trying to compartmentalize things as much as possible, but some stuff (like the checkpoints) fall through the cracks. Rebooting your computer should clear out the temporary files, but that’s just a temporary fix (that you hopefully have to do only once).

3 Likes

Thanks for the explanation @hansl. I’ll make sure to clear my tmp folders in the mean time. (Deleting both the checkpoints and tmp folder data does resolve the issue)

2 Likes

I finally got it to work. Restarting the computer didn’t work as did deleting all dfx related files. Turned out an earlier version I had installed on another user was interfering. If you have any issues and a laptop with multiple users be sure to take it into account.

2 Likes