hyperledger / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
433 stars 276 forks source link

[BUG] Queries fail with "Unknown query cursor" #5085

Closed nxsaken closed 2 days ago

nxsaken commented 3 days ago

OS and Environment

macOS m1

GIT commit hash

e68039713

Minimum working example / Steps to reproduce

With the client SDK:

fn all(iroha: &Client) {
  iroha
    .query(FindDomains)
    .execute()
    .unwrap();
}

fn single(iroha: &Client, domain: DomainId) {
  iroha
    .query(FindDomains)
    .filter_with(|dom| dom.id.eq(domain))
    .execute_single()
    .unwrap();
}

With the client CLI:

$ iroha --config <PATH_TO_CONFIG_TOML> domain list all

Actual result

All:

called `Result::unwrap()` on an `Err` value: Validation(QueryFailed(UnknownCursor))

Single:

called `Result::unwrap()` on an `Err` value: QueryError(Validation(QueryFailed(UnknownCursor)))

CLI:

Error: Failed to run the command
├╴at client_cli/src/main.rs:211:34
│
╰─▶ Failed to get all accounts
    ├╴at client_cli/src/main.rs:210:10
    ├╴Query validation error
    ├╴Query execution failed
    ╰╴Unknown query cursor

Expected result

The object(s) or an appropriate error is returned

Logs

-

Who can help to reproduce?

@DCNick3

Notes

No response

nxsaken commented 3 days ago

With #5086:

$ iroha --config <PATH_TO_CONFIG_TOML> domain list all

Error: Failed to run the command
├╴at crates/iroha_cli/src/main.rs:211:34
│
╰─▶ Failed to get all accounts
    ├╴at crates/iroha_cli/src/main.rs:210:10
    ├╴Query validation error
    ├╴Query execution failed
    ╰╴The server's cursor does not match the provided cursor.
nxsaken commented 2 days ago

Turned out to be a conflict between dockerized irohad and a bare-metal one left over from old pytests running in the background.

DCNick3 commented 2 days ago

Turned out to be a conflict between dockerized irohad and a bare-metal one left over from old pytests running in the background.

Hm, so one request went to one server and another to the other? Did they manage to simultaneously listen on the same port?

UPD: Or was it actually just a version mismatch? (I think older iroha will give you the UnknownCursor error when it can't decode the request)

nxsaken commented 2 days ago

Yeah, just a version mismatch