Help needed with obtaining options chain via IB

Hey everyone, I’m struggling with collecting option chain information via collect_ibkr_option_chains. Here’s a code snippet below:

from quantrocket.master import download_master_file, collect_ibkr_option_chains
import io
f = io.StringIO()
download_master_file(f, sec_types=["ETF"], symbols=["SPY"])

and in the log, I see:

2021-03-10 03:44:36 quantrocket.master: INFO Requesting option strike prices and expiries for sids FIBBG000BDTBL9
2021-03-10 03:44:37 quantrocket.master: WARNING ibg1 client 5092 got IBKR error code 320: Error reading request.Message id 0.  Unable to parse data. java.lang.NumberFormatException: For input string: "nan"
2021-03-10 03:45:38 quantrocket.master: ERROR Requested option params for 1 underlyings but got IB API responses for only 0 (missing: nan)
2021-03-10 03:45:38 quantrocket.master: WARNING No option chains found for sids FIBBG000BDTBL9

I see similar results with other symbols/securities as well. Does anyone know what I am doing in correctly? Many thanks!

Although SPY is in your database, you haven’t collected SPY from IBKR but only from another data provider, so the ibkr_ConId field is missing. First collect SPY from IBKR:

Thanks Brian for the help!