I've seen this same error with essentially the same stack trace. It can happen when Cerebro._runnext loads a bar which arrives in the narrow window of time between the first check for new data:
and the second chance:
if d.next(datamaster=dmaster, ticks=False)
If the new bar's timestamp shows it is from the "future" with respect to dmaster then it is loaded once (in d.next()) but rewound twice: once within d.next() itself and again in _runnext a few lines after the above block:
My guess is that the needed fix is in AbstractDataBase.next():
if self.lines.datetime > datamaster.lines.datetime: # can't deliver new bar, too early, go back self.rewind() return False # <-- This needs to be added since bar is not delivered
However, I'm relatively new to the code, so far all I know it could be intentional that AbstractDataBase.next() returns True to "tell the world there is a bar" even though it is too early to actually deliver the bar. In that case it would seem the logic in _runnext needs to be modified so that a second rewind does not occur.