CO2 plugin - TypeError: unsupported operand type(s) for %: 'float' and 'str'

Running co2_reading with scd4x configuration fails with the following output on version 25.3.5

Exception in thread Thread-1 (_target):
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.11/dist-packages/pioreactor/utils/timing.py", line 149, in _target
    while not self.event.wait(self.time_to_next_run):
                              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pioreactor/utils/timing.py", line 164, in time_to_next_run
    return self.interval - ((perf_counter() - self.start_time) % self.interval)
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for %: 'float' and 'str'

Hi @sharknaro,

Yes, you’re right, there was a bug in co2-plugin version 0.2.2. I’ve just released 0.2.3 with a fix.

Hi! I’m having some troubles using this plugin since upgrading my cluster to 25.12.10.

My setup consists of a leader (not a worker/leader), to where 10 workers are connected. The CO2 reading plugin is installed on each worker, but not on the leader itself. With previous pioreactor software versions, the plugin always worked fine. However, now I’m unable to export any CO2 data (message: no data present in co2_readings with applied filters).
Also, when running an experiment, I don’t see any previous CO2 readings appearing in my graph on the UI. Only current CO2 values show, but they are gone again when refreshing the page. Is there something wrong with storing these measurements?

hi @stijn.rommens,

There is a non-obvious problem here. The leader requires configuration for both:

  1. knowing where to store the CO2 readings coming in.
  2. knowing how to export the (now stored) CO2 readings.

Both these are configured when the CO2 plugin is installed on the leader, which normally is a leader-worker and also running CO2 stuff. However, in your case, it wasn’t installed on the leader.

Are you able to install the plugin on the leader? That should solve your problems. Let me know if there is an error though.

Hi @CamDavidsonPilon, installing the plugin on the leader solved the issue. Thanks!