You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a server in Docker and accessing it with a program written in Rust. REMOVE NAMESPACE test will generate a panic in the server.
Steps to reproduce
Run server: docker run --rm --name my-surrealdb1 -p 8000:8000 --user root -v my-surreal-db:/database surrealdb/surrealdb:latest start --log trace file://database
Running the client:
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.12s
Running `target/debug/foreign-key`
before
connected
Error: Api(InternalError("receiving on a closed channel"))
Client code:
use surrealdb::engine::remote::ws::Ws;use surrealdb::Surreal;#[tokio::main]asyncfnmain() -> surrealdb::Result<()>{println!("before");let db = Surreal::new::<Ws>("127.0.0.1:8000").await?;println!("connected");let response = db.query("REMOVE NAMESPACE test").await?;
response.check()?;Ok(())}
Cargo.toml
[package]
name = "foreign-key"version = "0.1.0"edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
surrealdb = "1.4.0"serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.35", features = ["macros", "rt-multi-thread"] }
Full server log
2024-04-17T18:12:46.155861Z INFO surreal::env: Running 1.4.0 for linux on x86_64
2024-04-17T18:12:46.155886Z DEBUG surreal::dbs: Database strict mode is false
2024-04-17T18:12:46.155897Z WARN surreal::dbs: ❌🔒 IMPORTANT: Authentication is disabled. This is not recommended for production use. 🔒❌
2024-04-17T18:12:46.155914Z DEBUG surreal::dbs: Server capabilities: scripting=false, guest_access=false, live_query_notifications=true, allow_funcs=all, deny_funcs=none, allow_net=none, deny_net=none
2024-04-17T18:12:46.155941Z INFO surrealdb_core::kvs::ds: Starting kvs store at file://database
...
2024-04-17T18:12:46.239675Z INFO surrealdb_core::kvs::ds: Started kvs store at file://database
2024-04-17T18:12:46.239724Z TRACE surrealdb_core::kvs::ds: Clearing unreachable state
2024-04-17T18:12:46.239855Z TRACE surrealdb_core::kvs::ds: Found 1 nodes
2024-04-17T18:12:46.239879Z TRACE surrealdb_core::kvs::ds: Found 1 heartbeats
2024-04-17T18:12:46.239889Z TRACE surrealdb_core::kvs::ds: Found 0 node live queries
2024-04-17T18:12:46.239897Z TRACE surrealdb_core::kvs::ds: Found 0 table live queries
2024-04-17T18:12:46.239899Z TRACE surrealdb_core::kvs::ds: Successfully cleared cluster of unreachable state
2024-04-17T18:12:46.239981Z TRACE surrealdb_core::kvs::ds: Bootstrapping 'e2604fb5-fdfd-44ed-884f-62a726ad2624'
2024-04-17T18:12:46.240018Z TRACE surrealdb_core::kvs::ds: Registering node 'e2604fb5-fdfd-44ed-884f-62a726ad2624'
2024-04-17T18:12:46.240079Z TRACE surrealdb_core::kvs::tx: delr_hb: ts=[Hb { __: 47, _a: 33, _b: 104, _c: 98, hb: Timestamp { value: 1713368372254 }, _d: 47, nd: febacc64-be92-41bf-bbf0-07bf702297c4 }] limit=100000
2024-04-17T18:12:46.240096Z TRACE surrealdb_core::kvs::ds: Found 1 expired heartbeats
2024-04-17T18:12:46.240098Z TRACE surrealdb_core::kvs::ds: Deleting node febacc64-be92-41bf-bbf0-07bf702297c4
2024-04-17T18:12:46.240100Z TRACE surrealdb_core::kvs::ds: Archiving dead nodes: [Uuid(febacc64-be92-41bf-bbf0-07bf702297c4)]
2024-04-17T18:12:46.240103Z TRACE surrealdb_core::kvs::ds: Archiving node 'febacc64-be92-41bf-bbf0-07bf702297c4'
2024-04-17T18:12:46.240108Z TRACE surrealdb_core::kvs::ds: Found 0 LQ entries for Uuid(febacc64-be92-41bf-bbf0-07bf702297c4)
2024-04-17T18:12:46.240202Z TRACE surrealdb_core::kvs::ds: Gone into removing archived: 0
2024-04-17T18:12:46.240275Z DEBUG surrealdb_core::dbs::lifecycle: Started node agent initialisation
2024-04-17T18:12:46.240281Z TRACE surrealdb::api::engine::tasks: Ticker interval is 1s
2024-04-17T18:12:46.240293Z DEBUG surrealdb_core::dbs::lifecycle: Stopped node agent initialisation
2024-04-17T18:12:46.240327Z DEBUG surrealdb_core::dbs::lifecycle: Started heartbeat task
2024-04-17T18:12:46.240370Z DEBUG surrealdb_core::dbs::lifecycle: Started live query agent task
2024-04-17T18:12:46.240415Z DEBUG surrealdb_core::dbs::lifecycle: Stopped live query agent task
2024-04-17T18:12:46.240516Z INFO surrealdb::net: Started web server on 0.0.0.0:8000
2024-04-17T18:12:47.241756Z TRACE surrealdb::api::engine::tasks: Node agent tick: Instant { tv_sec: 122383, tv_nsec: 440845751 }
2024-04-17T18:12:47.241794Z TRACE surrealdb_core::kvs::ds: Ticking at timestamp 1713377567
2024-04-17T18:12:48.241018Z TRACE surrealdb::api::engine::tasks: Node agent tick: Instant { tv_sec: 122384, tv_nsec: 440845751 }
2024-04-17T18:12:48.241042Z TRACE surrealdb_core::kvs::ds: Ticking at timestamp 1713377568
2024-04-17T18:12:49.240776Z TRACE surrealdb::api::engine::tasks: Node agent tick: Instant { tv_sec: 122385, tv_nsec: 440845751 }
2024-04-17T18:12:49.240812Z TRACE surrealdb_core::kvs::ds: Ticking at timestamp 1713377569
2024-04-17T18:12:49.484121Z DEBUG request: surreal::net::tracer: started processing request otel.kind="server" http.request.method="GET" url.path="/rpc" network.protocol.name="http" network.protocol.version="1.1" otel.name="GET /rpc" http.route="/rpc" http.request.id="24312de8-bfe4-4dff-ab67-1fc43968c0c1" client.address="172.17.0.1"
2024-04-17T18:12:49.484216Z DEBUG request: surreal::net::tracer: finished processing request otel.kind="server" http.request.method="GET" url.path="/rpc" network.protocol.name="http" network.protocol.version="1.1" otel.name="GET /rpc" http.route="/rpc" http.request.id="24312de8-bfe4-4dff-ab67-1fc43968c0c1" client.address="172.17.0.1" http.response.body.size="0" http.response.status_code=101 http.latency.ms=0
2024-04-17T18:12:49.484311Z TRACE surreal::rpc::connection: WebSocket 24312de8-bfe4-4dff-ab67-1fc43968c0c1 connected
2024-04-17T18:12:49.484865Z DEBUG rpc/call: surreal::rpc::connection: Process RPC request otel.kind="server" ws.id=24312de8-bfe4-4dff-ab67-1fc43968c0c1 rpc.service="surrealdb" rpc.method="version" otel.name="surrealdb.rpc/version" rpc.request_id="0"
2024-04-17T18:12:49.484886Z DEBUG rpc/call: surreal::rpc::response: Process RPC response otel.kind="server" ws.id=24312de8-bfe4-4dff-ab67-1fc43968c0c1 rpc.service="surrealdb" rpc.method="version" otel.name="surrealdb.rpc/version" rpc.request_id="0"
2024-04-17T18:12:49.485498Z DEBUG request: surreal::net::tracer: started processing request otel.kind="server" http.request.method="GET" url.path="/rpc" network.protocol.name="http" network.protocol.version="1.1" otel.name="GET /rpc" http.route="/rpc" http.request.id="fe8439ce-a516-44d6-ba1b-9b49dea73cf3" client.address="172.17.0.1"
2024-04-17T18:12:49.485521Z DEBUG request: surreal::net::tracer: finished processing request otel.kind="server" http.request.method="GET" url.path="/rpc" network.protocol.name="http" network.protocol.version="1.1" otel.name="GET /rpc" http.route="/rpc" http.request.id="fe8439ce-a516-44d6-ba1b-9b49dea73cf3" client.address="172.17.0.1" http.response.body.size="0" http.response.status_code=101 http.latency.ms=0
2024-04-17T18:12:49.485571Z TRACE surreal::rpc::connection: WebSocket fe8439ce-a516-44d6-ba1b-9b49dea73cf3 connected
2024-04-17T18:12:49.485788Z TRACE surreal::rpc::connection: WebSocket 24312de8-bfe4-4dff-ab67-1fc43968c0c1 disconnected
2024-04-17T18:12:49.532332Z DEBUG rpc/call: surreal::rpc::connection: Process RPC request otel.kind="server" ws.id=fe8439ce-a516-44d6-ba1b-9b49dea73cf3 rpc.service="surrealdb" rpc.method="query" otel.name="surrealdb.rpc/query" rpc.request_id="0"
2024-04-17T18:12:49.532485Z DEBUG rpc/call:process:executor: surrealdb_core::dbs::executor: Executing: REMOVE NAMESPACE test otel.kind="server" ws.id=fe8439ce-a516-44d6-ba1b-9b49dea73cf3 rpc.service="surrealdb" rpc.method="query" otel.name="surrealdb.rpc/query" rpc.request_id="0"
thread 'surrealdb-worker' panicked at core/src/dbs/options.rs:355:45:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Describe the bug
Running a server in Docker and accessing it with a program written in Rust.
REMOVE NAMESPACE test
will generate a panic in the server.Steps to reproduce
Run server:
docker run --rm --name my-surrealdb1 -p 8000:8000 --user root -v my-surreal-db:/database surrealdb/surrealdb:latest start --log trace file://database
Running the client:
Client code:
Cargo.toml
Full server log
Expected behaviour
The server should not crash
SurrealDB version
Running 1.4.0 for linux on x86_64
Contact Details
gabor@szabgab.com
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: