{"record":{"id":"90f4bed5de9e5f08","repo":"hasura/graphql-engine","slug":"movie-id-out-of-range","errorCode":null,"errorMessage":"movie_id out of range","messagePattern":"movie_id out of range","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/crates/custom-connector/src/query/relational.rs","lineNumber":503,"sourceCode":"\n// return types for tables, with columns / data we don't current support filtered out\nfn get_table_provider(\n    collection_name: &ndc_models::CollectionName,\n    arguments: &BTreeMap<ndc_models::ArgumentName, RelationalLiteral>,\n    state: &AppState,\n) -> datafusion::error::Result<Arc<dyn TableProvider>> {\n    let (rows, collection_fields) = match collection_name.as_str() {\n        \"actors\" => (\n            crate::collections::actors::rows(&BTreeMap::new(), state)\n                .map_err(|e| DataFusionError::Internal(e.1.0.message))?,\n            crate::types::actor::definition().fields,\n        ),\n        \"actors_by_movie\" => {\n            let movie_id_int: i32 = arguments\n                .get(\"movie_id\")\n                .and_then(|v| match v {\n                    RelationalLiteral::Int64 { value } => {\n                        Some(i32::try_from(*value).expect(\"movie_id out of range\"))\n                    }\n                    _ => None,\n                })\n                .ok_or_else(|| {\n                    DataFusionError::Internal(\n                        \"actors_by_movie requires a movie_id argument\".to_string(),\n                    )\n                })?;\n\n            (\n                crate::collections::actors_by_movie::rows_inner(movie_id_int, state),\n                crate::types::actor::definition().fields,\n            )\n        }\n        \"countries\" => (\n            crate::collections::countries::rows(&BTreeMap::new(), state)\n                .map_err(|e| DataFusionError::Internal(e.1.0.message))?\n                .iter()","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/custom-connector/src/query/relational.rs#L485-L521","documentation":"In the custom-connector example, the `movie_id` argument to the `actors_by_movie` model was provided as an Int64 that doesn't fit in i32, so an expect() panics during query planning.","triggerScenarios":"Calling the `actors_by_movie` table-valued model with movie_id outside i32 range (e.g. 3000000000).","commonSituations":"Example/demo queries with arbitrary large IDs; GraphQL Int being coerced to a large i64; fuzz or test inputs exceeding int4 range.","solutions":["Pass a movie_id within i32 range (-2147483648..=2147483647)","Change the argument to i64 in the connector instead of try_from+expect","Return a proper DataFusionError instead of panicking if you own this code"],"exampleFix":"// before\n.oku003e(i32::try_from(*value).expect(\"movie_id out of range\"))\n// after\nlet v = i32::try_from(*value).map_err(|_| DataFusionError::Execution(\"movie_id out of range\".into()))?;","handlingStrategy":"validation","validationCode":"if (!Number.isInteger(movieId) || movieId < -2147483648 || movieId > 2147483647) throw new RangeError('movie_id out of i32 range');","typeGuard":"const isI32 = (n: number): n is number => Number.isInteger(n) && n >= -2147483648 && n <= 2147483647;","tryCatchPattern":"Wrap model calls and catch the panic in the connector boundary, returning a user-facing range error.","preventionTips":["Bound ID inputs at the API layer","Prefer returning errors over expect/panic in connector code"],"tags":["datafusion","custom-connector","panic","range"],"backgroundTag":"integer-overflow-panic","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}