{"record":{"id":"678bfb688484f56e","repo":"QuantConnect/Lean","slug":"custom-data-was-not-received-678bfb","errorCode":null,"errorMessage":"Custom data was not received","messagePattern":"Custom data was not received","errorType":"exception","errorClass":"RegressionTestException","httpStatus":null,"severity":"error","filePath":"Algorithm.CSharp/CustomDataZipFileRegressionAlgorithm.cs","lineNumber":58,"sourceCode":"\n            SetBenchmark(x => 0);\n        }\n\n        public override void OnData(Slice slice)\n        {\n            var data = slice.Get<CustomData>(_customDataSymbol);\n            if (data != null)\n            {\n                Log($\"{Time}: {data.Symbol} - {data.Time} - {data.Value}\");\n                _receivedCustomData = true;\n            }\n        }\n\n        public override void OnEndOfAlgorithm()\n        {\n            if (!_receivedCustomData)\n            {\n                throw new RegressionTestException(\"Custom data was not received\");\n            }\n        }\n\n        protected virtual string GetCustomDataUrl()\n        {\n            return @\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip?some=query&for=testing\";\n        }\n\n        public class CustomData : BaseData\n        {\n            public static string Url { get; set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                return new SubscriptionDataSource(Url);\n            }\n\n            public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/QuantConnect/Lean/blob/d2c3659f877bfc2b5d9dc0fc89a9c7566f45e892/Algorithm.CSharp/CustomDataZipFileRegressionAlgorithm.cs#L40-L76","documentation":"Same 'custom data not received' assertion for the multi-CSV zipped file variant (without the ZipEntryName entry-name tracking). _receivedCustomData stays false if no CustomData point ever reaches OnData. The data source is a remote zip containing multiple CSV files that Lean must concatenate and emit as one stream.","triggerScenarios":"GetCustomDataUrl returns the multi-csv zip; the zip is fetched and unpacked, but Reader never returns a point for any line, so slice.Get<CustomData> is null for the whole run.","commonSituations":"Remote zip unreachable, Reader throws/returns null on parse, Symbol/Value not set so the point is dropped, or the zip format changed (entries merged differently) after a data-pipeline update. Offline runs without a cached copy also trigger it.","solutions":["Verify the zip URL is reachable and the file contains CSV entries the Reader can parse.","Ensure Reader sets Symbol, Time, and Value and does not return null on valid lines.","Confirm GetCustomDataUrl points to the correct endpoint (overridable for local mirrors).","Cache the zip locally and point GetCustomDataUrl at the local path for offline/CI runs."],"exampleFix":"// before: Reader drops every row\npublic override BaseData Reader(...) { return null; }\n\n// after: parse line into a point\npublic override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)\n{\n    var row = line.Split(',');\n    return new CustomData { Symbol = config.Symbol, Time = date, Value = decimal.Parse(row[1]) };\n}","handlingStrategy":"validation","validationCode":"// Validate the URL and parser produce points before the run depends on them\nvar url = GetCustomDataUrl();\nif (string.IsNullOrWhiteSpace(url)) throw new InvalidOperationException(\"Empty custom data URL\");","typeGuard":null,"tryCatchPattern":"try { /* download/parse multi-csv zip */ }\ncatch (Exception ex) { Log($\"Custom zip parse failed: {ex.Message}\"); }","preventionTips":["Override GetCustomDataUrl to a local mirror in restricted networks.","Make Reader robust: skip malformed lines rather than returning null for the whole file.","Validate the zip contains CSV entries the parser expects."],"tags":["regression-test","custom-data","zip-file","remote-source"],"backgroundTag":null,"analyzedSha":"d2c3659f877bfc2b5d9dc0fc89a9c7566f45e892","analyzedAt":"2026-08-13T13:52:21.013Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}