Problem insalling Internet Identity in Local Setup

Hi everyone!
I will describe this error, received following this guide:
I have downloaded locally the did and wasm files of identity and this is my dfx json:
“internet_identity”: {
“type”: “custom”,
“candid”: “src/internet_identity/internet_identity.did”,
“wasm”: “src/internet_identity/internet_identity_dev.wasm.gz”,
“remote”: {
“id”: {
“ic”: “rdmx6-jaaaa-aaaaa-aaadq-cai”
}
},
“frontend”: {}
},
I have put the files in those paths but running dfx deploy there is a problem with tha wasm file

I’m getting this error:
Error: The Replica returned an error: code 5, message: “Wasm module of canister rrkah-fqaaa-aaaaa-aaaaq-cai is not valid: Wasmtime failed to validate wasm module wasmtime::Module::validate() failed with Bad magic number (at offset 0)”
kcbat@kcbat-HP-Pavili

thanks for taking the time to write this. Let me ping the II team folks to see who can help.

Try this instead of your dfx config:

"internet_identity": {
      "type": "custom",
      "candid": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did",
      "wasm": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm.gz",
      "shrink": false,
      "remote": {
        "candid": "internet_identity.did",
        "id": {
          "ic": "rdmx6-jaaaa-aaaaa-aaadq-cai"
        }
      }
    },

It will automatically pull the last dev version of II.

Note: there is a tutorial / sample in II repo but I had above piece of code literally open, so was faster to just copy paste that particular part

1 Like

I think that’s the old approach.
Simply get the last dfx and run
dfx start --clean
dfx nns install

you will have Internet Identity and everything else

Depends what you try to achieve and what version of the canister you are looking for.

Thanks a lot, it worked!

1 Like

Has anyone experienced this error.

It happens when I try to create an II locally.

dfx 0.14.2
latest internet identity repo

I tried diff approaches including above:

I’ve seen stuffs but, I’ve never seen that particular error :stuck_out_tongue_winking_eye:.

Have you try to clean up your local dfx state (dfx start --clean) and redeploy? Same issue?

1 Like

Yeah did everything. Did clean install :frowning: did clean. Restarted machine. I guess I will keep digging.

As you mention v0.14.2, if you downgrade dfx, same issue?

1 Like

Hmm haven’t tried that but will soon. I did upgrade everything.

1 Like

ok that works. downgraded to 14.1

1 Like

Thanks for the feedback, I forward the information!

yeah I get that on 14.2 and on 0.14.2-beta.2 as well.

I tried to reproduce myself, and I found that the important factor is dfx start with 0.14.2. If that is run with 0.14.1 or lower it doesn’t fail, no matter which version of dfx deploys it. Continuing to investigate…

1 Like

hey folks,
I was able to reproduce the issue using the dfx 0.14.2 using the snippet in this thread. At the same time both the dfx nns install and the II canister included into the 0.14.2 release work just fine for me.

For the latter I used the following dfx.json snippet:

    "internet_identity": {
      "type": "custom",
      "candid": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did",
      "wasm": "/Users/a/.cache/dfinity/versions/0.14.2/wasms/internet_identity_dev.wasm",
      "shrink": false,
      "remote": {
        "candid": "internet_identity.did",
        "id": {
          "ic": "rdmx6-jaaaa-aaaaa-aaadq-cai"
        }
      }
    },

It’s a copy-paste of the snippet from this thread, just the WASM binary is from the dfx 0.14.2 cache…

Have you try with a snippet that fetches the .wasm.gz from GitHub? When dfx nns install is not used, that’s the most common way to embed II in project I think.

"internet_identity": {
			"type": "custom",
			"candid": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did",
			"wasm": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm.gz",
			"shrink": false,
			"remote": {
				"id": {
					"ic": "rdmx6-jaaaa-aaaaa-aaadq-cai"
				}
			},
		},

That’s exactly what I used and it didn’t work for me, while the dfx 0.14.2 WASM binary (i.e. "wasm": "/Users/a/.cache/dfinity/versions/0.14.2/wasms/internet_identity_dev.wasm",) seems to work just fine.

1 Like

Ah interesting, so dfx start with a .wasm.gz does not work but, works with .wasm.

Wasn’t the support for gzipped wasm recently added to dfx? Can there be a conflict there?

Sorry for the confusion. I never stated that the gzipped WASM is the issue. And in fact I just verified, it does not.

The dfx release 0.14.2 ships with an older II WASM binary (version 2022-07-11) and it works just fine. The first failing II version is 2023-04-28, i.e. 2023-04-12 still works fine:

    "internet_identity": {
      "type": "custom",
      "candid": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did",
      "wasm": "https://github.com/dfinity/internet-identity/releases/download/release-2023-04-12/internet_identity_dev.wasm.gz",
      "shrink": false,
      "remote": {
        "candid": "internet_identity.did",
        "id": {
          "ic": "rdmx6-jaaaa-aaaaa-aaadq-cai"
        }
      }
    },

This is the last working II for me on the dfx 0.14.2

2 Likes