{"record":{"id":"005a709fc2a95e7d","repo":"QuantConnect/Lean","slug":"custom-data-was-not-received","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/CustomDataZipFileEntryNamesRegressionAlgorithm.cs","lineNumber":55,"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.FileEntryName}\");\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        public class CustomData : BaseData\n        {\n            private int _i;\n\n            public string FileEntryName { get; private set; }\n\n            public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)\n            {\n                // Even though the url includes a specific entry name, FileFormat.ZipEntryName indicates that\n                // the entry names should be read, not the content of the given entry\n                return new SubscriptionDataSource(@\"https://cdn.quantconnect.com/uploads/multi_csv_zipped_file.zip?some=query&for=testing#csv_file_10.csv\",\n                    SubscriptionTransportMedium.RemoteFile,\n                    FileFormat.ZipEntryName);\n            }\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/QuantConnect/Lean/blob/d2c3659f877bfc2b5d9dc0fc89a9c7566f45e892/Algorithm.CSharp/CustomDataZipFileEntryNamesRegressionAlgorithm.cs#L37-L73","documentation":"Asserts that custom data loaded from a zip file was delivered at least once. _receivedCustomData is set true in OnData when slice.Get<CustomData>(_customDataSymbol) is non-null; OnEndOfAlgorithm throws if it never became true. This variant specifically tests the ZipEntryName file format (it reads FileEntryName from each zip entry).","triggerScenarios":"Custom data source is a remote zip with FileFormat.ZipEntryName; GetSource/Reader never materialize a point, so OnData never sees the symbol. Causes include unreachable URL, wrong file format flag, or Reader returning null for every entry.","commonSituations":"Network egress blocked to cdn.quantconnect.com (sandboxed CI, proxy, offline), zip layout changed so ZipEntryName parsing yields nothing, or the SubscriptionDataSource not configured with the ZipEntryName format so Lean treats entries as raw CSV.","solutions":["Confirm network access to the zip URL and that the file downloads and contains named entries.","Verify GetSource returns a SubscriptionDataSource with the correct SourceFormat and that config.FileFormat is ZipEntryName.","Ensure the Reader handles the per-entry CSV lines and returns a populated CustomData instance (with FileEntryName set).","If running offline, point GetSource at a local zip mirror under the data folder."],"exampleFix":"// before: format defaults to CSV, entries never enumerated\nreturn new SubscriptionDataSource(url, SubscriptionTransportMedium.RemoteFile, FileFormat.Csv);\n\n// after: declare ZipEntryName so each entry is parsed\nreturn new SubscriptionDataSource(url, SubscriptionTransportMedium.RemoteFile, FileFormat.ZipEntryName);","handlingStrategy":"validation","validationCode":"// Validate source reachability and format before relying on the feed\nvar src = new CustomData().GetSource(config, date, false);\nif (src.Format != FileFormat.ZipEntryName)\n    throw new InvalidOperationException(\"Expected ZipEntryName format for zip-entry custom data\");","typeGuard":"bool SourceIsZipEntry(SubscriptionDataSource s) => s.Format == FileFormat.ZipEntryName;","tryCatchPattern":"try { /* fetch/parse zip */ }\ncatch (WebException ex) { Log($\"Custom data fetch failed: {ex.Message}\"); /* fall back to local cache */ }","preventionTips":["Declare FileFormat.ZipEntryName in GetSource when reading per-entry data.","Mirror remote zips locally for offline/CI runs.","Ensure Reader sets FileEntryName and returns a populated instance for valid entries."],"tags":["regression-test","custom-data","zip-file","network"],"backgroundTag":null,"analyzedSha":"d2c3659f877bfc2b5d9dc0fc89a9c7566f45e892","analyzedAt":"2026-08-13T13:52:21.013Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}