Skip to content
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

AssertionError: insufficient data in buffer: requested 4 remaining 0 #8446

Open
serzhiio opened this issue Mar 6, 2025 · 3 comments
Open

Comments

@serzhiio
Copy link

serzhiio commented Mar 6, 2025

Here is the error i got.
GelDB version 7.0-dev.9399+e5e6e72

I am trying to insert array of tuples.

part of schema: pairs: array<tuple<pair_id: int32, quote_idx: int32, quote_ca: str, quote_token: str, is_canonical: bool>>;

Error inserting token K: Error(
    Inner {
        code: 16777216,
        messages: [
            "AssertionError: insufficient data in buffer: requested 4 remaining 0",
        ],
        error: None,
        headers: {
            1: b"This is most likely a bug in Gel. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md",
            257: b"Traceback (most recent call last):\n  File \"edb/server/protocol/binary.pyx\", line 1069, in edb.server.protocol.binary.EdgeConnection.main_step\n  File \"edb/server/protocol/binary.pyx\", line 1020, in execute\n  File \"edb/server/protocol/binary.pyx\", line 763, in _execute\n  File \"edb/server/protocol/binary.pyx\", line 764, in edb.server.protocol.binary.EdgeConnection._execute\n  File \"edb/server/protocol/execute.pyx\", line 410, in execute\n  File \"edb/server/protocol/execute.pyx\", line 299, in edb.server.protocol.execute.execute\n  File \"edb/server/protocol/args_ser.pyx\", line 207, in edb.server.protocol.args_ser.recode_bind_args\n  File \"edb/server/protocol/args_ser.pyx\", line 512, in edb.server.protocol.args_ser._decode_tuple_args\n  File \"edb/server/protocol/args_ser.pyx\", line 448, in edb.server.protocol.args_ser._decode_tuple_args_core\n  File \"edb/server/pgproto/./frb.pxd\", line 27, in edb.server.pgproto.pgproto.frb_read\n  File \"edb/server/pgproto/./frb.pyx\", line 10, in edb.server.pgproto.pgproto.frb_check\nedb.errors.InternalServerError: AssertionError: insufficient data in buffer: requested 4 remaining 0\n",
        },
        fields: {
            (
                "source_code",
                TypeId(0x94ff3f0e5737f34b0effa8a39e1851a9),
            ): Any { .. },
            (
                "capabilities",
                TypeId(0x86474051b9d758be698236851a2bd44e),
            ): Any { .. },
        },
    },
)
@serzhiio
Copy link
Author

serzhiio commented Mar 6, 2025

#4575

@serzhiio
Copy link
Author

serzhiio commented Mar 6, 2025

Here is the part of request i believe casing this error:

rust
pub struct L1ContractPairs(pub Option<Vec<(i32,i32,String,String,bool)>>);
impl Into<Value> for L1ContractPairs {
    fn into(self) -> Value {
        if let Some(pairs) = self.0 {
            let vec = pairs.into_iter().map(|p| {
                Value::Tuple (vec![
                        Value::Int32(p.0),
                        Value::Int32(p.1),
                        Value::Str(p.2),
                        Value::Str(p.3),
                        Value::Bool(p.4)
                ])
            }).collect::<Vec<_>>();

            Value::Array(vec)
        } else {
            Value::Nothing
        }
    }
}

@msullivan
Copy link
Member

Could you post a full program that reproduces this? I don't have enough to go on here.

(Though my first suspicion is a bug in the rust bindings, which is quite a bit less well tested than the server's encoding paths. Not certain, though.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants