MQTT trouble multiple port binding attempts

I’ve been having connection problems and MQTT errors. I’ve gotten to this point and I’m wondering why this would be?

Opening ipv4 listen socket on port 1883.
Opening websockets listen socket on port 9001.
Opening ipv4 listen socket on port 1883.    <-- TRYING AGAIN!
Error: Address already in use

Mosquitto is trying to bind port 1883 twice because:

  1. /etc/mosquitto/mosquitto.conf defines listener 1883
  2. /etc/mosquitto/conf.d/ws.conf ALSO defines listener 1883

Hm, this isn’t part of our base image (unless I’m missing something in our testing environment). Did you add that to solve a different issue?

I did a fresh install of the 25.9.18 image on all 8 of our pioreactors. When we went to calibrate the pumps and OD we got the errors below and installed libopenblas-dev and libopenblas-base.

We had to do that on everyone pioreactor though and I can’t find ws.conf on every pioreactor, just the two assigned to one student group. I don’t know what they may have installed, they can’t remember or communicate it to me.

pio calibrations set-active --device media_pump --name <calibration_name>

Reading to start stirring? [Y/n]: Y
Starting stirring and blocking until near target RPM.
Starting OD recordings.
Traceback (most recent call last):
File “/usr/local/lib/python3.11/dist-packages/numpy/_core/init.py”, line 22, in
from . import multiarray
File “/usr/local/lib/python3.11/dist-packages/numpy/_core/multiarray.py”, line 11, in
from . import _multiarray_umath, overrides
ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/lib/python3.11/dist-packages/numpy/init.py”, line 112, in
from numpy.config import show_config
File “/usr/local/lib/python3.11/dist-packages/numpy/config.py”, line 4, in
from numpy._core._multiarray_umath import (
File “/usr/local/lib/python3.11/dist-packages/numpy/_core/init.py”, line 48, in
raise ImportError(msg) from exc
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.11 from “/usr/bin/python3”
  • The NumPy version is: “2.3.3”

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libopenblas.so.0: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/bin/pio”, line 7, in
sys.exit(pio())
^^^^^
File “/usr/local/lib/python3.11/dist-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/cli/calibrations.py”, line 126, in run_calibration
calibration_struct = assistant().run(
^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/calibrations/init.py”, line 70, in run
return run_od_calibration()
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/calibrations/od_calibration_using_standards.py”, line 290, in run_od_calibration
inferred_od600s, voltages = start_recording_standards(st, pd_channel)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/calibrations/od_calibration_using_standards.py”, line 182, in start_recording_standards
with start_od_reading(
^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/od_reading.py”, line 1367, in start_od_reading
return ODReader(
^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/base.py”, line 107, in call
obj = type.call(cls, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/base.py”, line 264, in wrapped_init
orig_init(self, *args, **kwargs)
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/od_reading.py”, line 944, in init
on_reading = self.adc_reader.tune_adc() # determine best gain, max-signal, etc.
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/od_reading.py”, line 233, in tune_adc
self.most_appropriate_AC_hz = self.determine_most_appropriate_AC_hz(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/od_reading.py”, line 566, in determine_most_appropriate_AC_hz
argmin_freq1 = _compute_best_freq(timestamps[channel], aggregated_signals[channel])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/od_reading.py”, line 558, in _compute_best_freq
_, AIC = self._sin_regression_with_known_freq(timestamps, aggregated_signals, freq=freq)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/od_reading.py”, line 362, in _sin_regression_with_known_freq
import numpy as np
File “/usr/local/lib/python3.11/dist-packages/numpy/init.py”, line 117, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.

I encountered the same Numpy error, but only on my leader pioreactor, the workers themselves seemed to be fine during OD calibration (single_vial mode).

For more info, I have the air_bubbler and spectrometer plugin installed in my entire cluster, but unsure if that has anything to do with this

@DocRuzzy I think you can “delete” those ws.conf files. I suggest just renaming them, in case you need to reference them later.

sudo mv /etc/mosquitto/conf.d/ws.conf /etc/mosquitto/conf.d/ws.conf.old
sudo systemctl restart mosquitto.service

That numpy error seems to be a problem in the leader production image. I’ll need to release a hotfix.