Upstream connect error with large CSV files using influx write

I am trying to write large CSV files (millions of records) to a bucket in Influx Cloud. I can write small amounts of data successfully, but as the dataset gets larger I often seen this upstream connect error happening.

$ influx write -b mybucket --rate-limit="100MB/5min"  -f ./myfile.csv --header "#constant measurement,mymeasurement" --header "#datatype tag,tag,tag,tag,tag,tag,tag,tag,dateTime:number,long,double"
Error: Failed to write data: upstream connect error or disconnect/reset before headers. reset reason: connection failure.
See 'influx write -h' for help

Is my file just too big? Is there are certain number of records I should be splitting my file into? I see this error sometimes even with just 100k records. thanks.