-
Notifications
You must be signed in to change notification settings - Fork 892
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
Bug: INFO... query parsing error (RUST SDK) #3984
Comments
investigating broken code from 1.42 upgrade rust sdkTried few alternate supported channels.
and deadlock error as follows: ERROR surrealdb::api::engine::remote::ws::native] Failure { code: -32700, message: "Parse error" } BTW v1.4.0 works well |
it seems also to be happening for the |
Still present in 1.5.0. The issue with the |
I'm seeing the same behaviour too. Interestingly if you add the STRUCTURE keyword after INFO (e.g. |
@LivingLimes has mentioned they will work on this |
I am running the current repository locally using cargo. The current version is @fokklz Running
Running
I notice that the query you mentioned in the issue was actually @risha700 I'm a new contributor here. Could you explain what you mean by running on difference channels? I'm running surrealdb locally using @Dhghomon Running
tldr: I am unable to reproduce this issue on the latest |
@LivingLimes well it's not about the cli. It's about the SDK, I linked a repo, clone and run Did not try directly using main tho. It's the published version of the crate |
When i run it using surreal's latest install script so 1.5.0 on Windows i get the following, no matter if with or without I do not have v2 running localy, u have a download? but i guess its possibly fixed there then @LivingLimes |
@LivingLimes Thank you for taking time to investigate at first, the issue seem to be super nested due to surrealdb versatility to run. As much as I like the idea, the sql behavior is inconsistent across native installation, in-memory, behind docker on unix. Regarding INFO statement parse error I can confirm it exists while
The issue reproduction in a nutshell // from the docs
use std::env;
use surrealdb::engine::any;
use surrealdb::opt::auth::Root;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Use the endpoint specified in the environment variable or default to `memory`.
// This makes it possible to use the memory engine during development but switch it
// to any other engine for deployment.
let endpoint = env::var("SURREALDB_ENDPOINT").unwrap_or_else(|_| "ws://localhost:8000".to_owned());
env_logger::init_from_env(env_logger::Env::default().default_filter_or("debug"));
// Create the Surreal instance. This will create `Surreal<Any>`.
let db = any::connect(endpoint).await?;
let _s = db.signin(Root{
username: "root",
password: "pass",
}).await.expect("Can't authenticate SurrealDB Root");
// Specify the namespace and database to use
db.use_ns("test").use_db("test").await?;
// let ns = db.query(surrealdb::sql::statements::InfoStatement::Ns).await.expect("cant get response"); //fails as well
let ns = db.query("info for nsr").await.expect("cant get response");
println!("NS {:#?}", ns);
Ok(())
} while cargo deps [dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
surrealdb = { version = "1.5.0", features = ["kv-mem"] }
tokio = { version = "1.37.0", features = ["full"] }
env_logger = "0.11.3" As a work around for now running surrealdb/surrealdb:nightly works fine, seem to be with engine i guess. @fokklz for info for ns, has a remedy use session::ns |
@fokklz @risha700 Thanks for the extra information. From what I can see, I can't reproduce this when using the code from @phughk Can you ask if anyone on the team is aware of changes that would have fixed this issue? If we're not sure what could have fixed the issue, I can do some investigation to figure out if this issue has actually been addressed in @risha700 I am also able to reproduce your issue with auth, but I think it makes sense to create a new issue for this so it can be tracked independently of this ticket. I can help create this ticket a bit later. |
Hey everyone! It's not CBOR related nor is it related to the parser rewrite, as the new parser is only available behind a feature flag. For the launch of Surrealist however, we had to add a new
I think the second PR has the biggest chance of being the culprit, it could however also be the third PR. CC @DelSkayn |
I've been looking into this one since I'm unsure if it's immediately apparent to the team where the issue might be coming from. It has also been helping me get acquainted with the codebase. I should be done investigating in the next few days. |
Issue identificationI have identified the issue around usage of The error is being thrown when trying to deserialise the This is a little difficult to explain with words so I've created a branch with some tests to illustrate this. I also created an integration test to indicate failure when running the To summarise, I think the problem is in either the serialisation of the payload before it is sent through the web socket or it is in the deserialisation of the message after it is received by the web socket connection to be parsed by the query parser. Some solutions
I think either (1) or (3) are the ideal solution making the serialisation aware of variants that aren't present in a revision prevents us from serialising by using a different revision of the struct or enum. Other notes ...I've had some difficulty debugging this and I'm not sure if it's because of metaprogramming or generics in a separate crate (revision) are involved so I'll either take a break before returning to this or (hopefully) get some pointers on how to move forward. @phughk @kearfy @Dhghomon I haven't closely investigated your finding that calling |
Describe the bug
When trying to run a query with
INFO FOR
the parsing fails & nothing else happens.The function just seems to die.
Steps to reproduce
I've created a Repository to allow for simpler reproduction of the issue.
git clone https://github.com/fokklz/surreal-bug-report-parse-error.git
surreal start memory
cargo run
Expected behaviour
I'd expect a similar Response to the one from inside surrealist. If run there, i get:
INFO FOR SCOPE users;
INFO FOR NS;
SurrealDB version
1.4.2-1.5.0 (cargo & exe)
Contact Details
chat@fokklz.dev
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: