Expected Behavior
lean data generate generates market data
Actual Behavior
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at QuantConnect.Securities.SecurityService.InitializeSecurity(Boolean initializeSecurity, Security security, Boolean seedSecurity) in
/LeanCloud/CI.Builder/bin/Release/src/QuantConnect/Lean/Common/Securities/SecurityService.cs:line 346
Potential Solution
This was introduced in #9045. The line if (seedSecurity && _algorithm.Settings.SeedInitialPrices) needs to check if _algorithm is null before using its Settings value.
I confirmed this fix worked by building lean locally and running lean data generate:
if (seedSecurity && _algorithm != null && _algorithm.Settings.SeedInitialPrices)
Reproducing the Problem
lean data generate --start=20260101 --symbol-count=1
Or any lean data generate call will do it.
System Information
Ubuntu 20.04.1 from inside WSL2
Checklist
Expected Behavior
lean data generategenerates market dataActual Behavior
Potential Solution
This was introduced in #9045. The line
if (seedSecurity && _algorithm.Settings.SeedInitialPrices)needs to check if _algorithm is null before using its Settings value.I confirmed this fix worked by building lean locally and running
lean data generate:Reproducing the Problem
lean data generate --start=20260101 --symbol-count=1Or any
lean data generatecall will do it.System Information
Ubuntu 20.04.1 from inside WSL2
Checklist
masterbranch