Error adding new pioreactor follower to cluster

I’m typing in “worker1.local” into the hostname when I try to add a worker to the cluster but then I get this error. Should I be entering something else? I’m able to ssh into the worker at pioreactor@worker1.local

I did a fresh install of a leader+worker image on my leader pioreactor and a fresh install of a worker image on my worker pioreactor.

Unable to complete installation. The following error occurred: e[32m2023-03-11T16:02:42-0800 INFO [add_pioreactor] Adding new pioreactor worker1.local to cluster.e[0m e[31m2023-03-11T16:02:46-0800 ERROR [add_pioreactor] + set -e + export LC_ALL=C + LC_ALL=C + export SSHPASS=raspberry + SSHPASS=raspberry + HOSTNAME=worker1 + USERNAME=pioreactor + ssh-keygen -R worker1.local + ssh-keygen -R worker1 ++ getent hosts worker1.local ++ cut '-d ’ -f1 + ssh-keygen -R 192.168.1.47 + sshpass -e ssh worker1.local ‘test -d /home/pioreactor/.pioreactor && echo ‘'‘exists’'’’ Warning: Permanently added ‘worker1.local’ (ECDSA) to the list of known hosts. + avahi-browse _pioreactor_worker._tcp -t + grep -q worker1 + echo ‘Unable to confirm if worker1 is a Pioreactor worker. Not found in ‘'‘avahi-browse _pioreactor_worker._tcp -t’'’. Did you install the worker image?’ + exit 1 e[0m Aborted!

Hm, try worker1 instead of worker1.local

EDIT: no ^ is not it.

Can you run avahi-browse _pioreactor_worker._tcp -t on the leader Raspberry Pi and paste the output?

Also, try pio discover-workers on the leader. Do you see worker1 there?

Finally, on the worker rasbperry pi, can you post the output of ls /etc/avahi/services/

[quote=“CamDavidsonPilon, post:2, topic:80, full:true”]
Hm, try worker1 instead of worker1.local

EDIT: no ^ is not it.

Can you run avahi-browse _pioreactor_worker._tcp -t on the leader Raspberry Pi and paste the output?

pioreactor@leader:~ $ avahi-browse _pioreactor_worker._tcp -t
No output

Also, try pio discover-workers on the leader. Do you see worker1 there?

I see:
leader
worker1
piroeactor1

By the way, leader and pioreactor1 are set up as leaders and worker1 is set up as a worker.

Finally, on the worker rasbperry pi, can you post the output of ls /etc/avahi/services/
[/quote]

ls /etc/avahi/services/
pioreactor_worker.service

Ack! A bug slipped in! The check should be

avahi-browse _pio-worker._tcp -t

(check that this lists worker1 when you run it)

I made the change from _pioreactor_worker to _pio-worker a few weeks back, but didn’t propagate it everywhere. I’ll fix this in the next release.

For now, here’s the fix. On your leader, type:

sudo nano /usr/local/bin/add_new_pioreactor_worker_from_leader.sh

and edit the line 28 from

avahi-browse _pioreactor_worker._tcp -t

to

avahi-browse _pio-worker._tcp -t

Ack! A bug slipped in! The check should be

avahi-browse _pio-worker._tcp -t

pioreactor@pioreactor1:~ $ avahi-browse _pio-worker._tcp -t
+ wlan0 IPv4 pioreactor-worker-on-leader _pio-worker._tcp local
+ wlan0 IPv4 pioreactor-worker-on-worker1 _pio-worker._tcp local
+ wlan0 IPv4 pioreactor-worker-on-pioreactor1 _pio-worker._tcp local
+ wlan0 IPv6 pioreactor-worker-on-pioreactor1 _pio-worker._tcp local
+ lo IPv4 pioreactor-worker-on-pioreactor1 _pio-worker._tcp local
+ wlan0 IPv6 pioreactor-worker-on-leader _pio-worker._tcp local
+ wlan0 IPv6 pioreactor-worker-on-worker1 _pio-worker._tcp local

When I run this on pioreactor@leader, I don’t get anything.

(check that this lists worker1 when you run it)

I made the change from _pioreactor_worker to _pio-worker a few weeks back, but didn’t propagate it everywhere. I’ll fix this in the next release.

For now, here’s the fix. On your leader, type:

sudo nano /usr/local/bin/add_new_pioreactor_worker_from_leader.sh

and edit the line 28 from

avahi-browse _pioreactor_worker._tcp -t

to

avahi-browse _pio-worker._tcp -t

I did this on pioreactor@leader and saved the file. I am still not seeing anything listed when I enter avahi-browse _pioreactor-worker._tcp -t on leader (but I see the list on pioreactor1)

hm, to confirm, when you run

avahi-browse _pio-worker._tcp -t 

(Note the - vs _).

on your leader.local, you don’t see any output. But when you run it on pioreactor1.local, you do see output.

A few thoughts:

  1. Is leader, pioreactor1, and worker on the same network?
  2. Can you try rebooting worker and leader (power cycle them) and try again?

If none of this works, just delete the entire block

if ! avahi-browse _pio-worker._tcp -t | grep -q $HOSTNAME; then
...

in /usr/local/bin/add_new_pioreactor_worker_from_leader.sh

But when you run it on pioreactor1.local, you do see output.
Yes. That is correct.

Yes, all are on the same network. I’ll try rebooting them now.

avahi-browse _pio-worker._tcp -t is still not showing anything on the leader.

I do see this in the event log however:

14:29:32 leader watchdog Uninitialized worker, pioreactor1, is available to be added to your cluster.
14:29:31 leader monitor Ready.
14:29:27 leader watchdog Uninitialized worker, worker1, is available to be added to your cluster.

I’m trying to install worker1 again using “worker1”. If that doesn’t work, I’ll try “worker1.local”

It worked! I just had to delete the block from the file.

Okay, great! I’ll add some more improvements to this flow. Thanks for the report!

Thanks.

Quick question. Is there any way to change the hostname without re-imaging the pi’s? Like if I wanted to rename pioreactor1 to develop1 or something.

Unfortunately no utility yet to do this. It’ll be less painful to just reflash the image.

Ok. How about changing the WiFi settings? Also, is there any way to connect to the Pioreactor if the WiFi goes down for some reason?

Also, apart from SSH’ing into the pioreactor, or navigating to the local UI page, are there any other ways to connect to the Pioreactor (e.g., wired connection)?

Wifi settings can be changed by editing the /etc/wpa_supplicant/wpa_supplicant.conf file.

You can use an ethernet cord to connect the RPi to your network (ethernet ports are only available on RPi’s model B though). Ethernet is typically more stable, but still susceptible to router issues should they occur.