-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal error: entered unreachable code #242
Comments
From looking at https://docs.rs/crate/candid/0.6.21/source/src/parser/value.rs I suspect this might originate from: candid/rust/candid/src/parser/value.rs Lines 328 to 330 in 03d6d82
|
I see the latest version of |
Looks fine on the candid side. The error is due to calling Maybe related to dfinity/agent-rs#132, but I was doing a similar thing in Rust and did not see this error: https://github.com/dfinity/candid/blob/master/tools/ui/src/didjs/lib.rs#L50 |
@chenyan-dfinity is it possible I need to add I tried that before but I couldn't find any documentation. I gather they're related to generating a I still have a |
I just removed the Based on what you said, it seems like the issue is because it's defined like this, and uses #[derive(CandidType, Deserialize)]
pub struct CallbackStrategy {
pub callback: IDLValue,
pub token: IDLValue,
}
#[derive(CandidType, Deserialize)]
pub enum StreamingStrategy {
Callback(CallbackStrategy),
}
#[derive(CandidType, Deserialize)]
pub struct HttpResponse {
pub status_code: u16,
pub headers: Vec<HeaderField>,
#[serde(with = "serde_bytes")]
pub body: Vec<u8>,
pub streaming_strategy: Option<StreamingStrategy>,
}
#[derive(CandidType, Deserialize)]
pub struct StreamingCallbackHttpResponse {
#[serde(with = "serde_bytes")]
pub body: Vec<u8>,
pub token: Option<IDLValue>,
} |
Right,
Yeah, that is only used for auto-generating did files, and not related to this error. We are still trying to figure out the best way to integrate this into the CDK. For now, the best document is probably the test: https://github.com/dfinity/candid/blob/master/rust/candid/tests/types.rs#L98 |
Thanks @chenyan-dfinity! |
|
I think |
Also making apps private so they dont get published by lerna.
As mentioned in dfinity/agent-rs#201 (comment), I have a canister written in Rust like this:
However, when I try to make a
GET
request viaicx-proxy
I get a500
response and see this in the output fromdfx start
:[Canister rrkah-fqaaa-aaaaa-aaaaq-cai] Panicked at 'internal error: entered unreachable code', /Users/py/.cargo/registry/src/github.com-1ecc6299db9ec823/candid-0.6.21/src/parser/value.rs:326:9
I started
icx-proxy
with-v -v
so I see theGET
request being logged.I tried to
curl
the proxy instead and gotReplica Error (5): "IC0502: Canister rrkah-fqaaa-aaaaa-aaaaq-cai trapped: unreachable"
I did this in Motoko first as part of testing dfinity/agent-rs#195 and didn't run into this.
Could someone help me understand if I'm doing something wrong here? Thanks.
The text was updated successfully, but these errors were encountered: