docker-keepalived icon indicating copy to clipboard operation
docker-keepalived copied to clipboard

malformed unicast peer

Open sine19 opened this issue 5 years ago • 6 comments
trafficstars

Im getting this error when starting keepalived docker

(Line 21) Configuration error: VRRP instance[VI_1] malformed unicast peer address[#PYTHON2BASH:['xx.x.xx.x','xx.x.xx.xx']]. Skipping...

Any idea what it is?

I'm using the 2.0.17 version and updated it to the latest stable version 2.0.20. Still the same issue

sine19 avatar Mar 10 '20 04:03 sine19

startup.sh seems to never convert the yaml string to bash (line 28):

for peer in $(complex-bash-env iterate KEEPALIVED_UNICAST_PEERS)  
do  
sed -i "s|{{ KEEPALIVED_UNICAST_PEERS }}|${!peer}\n {{ KEEPALIVED_UNICAST_PEERS }}|g"  
 ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf  
done  
sed -i "/{{ KEEPALIVED_UNICAST_PEERS }}/d"  
 ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf  

I took a closer look into into complex-bash-env and it doesn't seem to interpret "#PYTHON2BASH:" at all

Soren90 avatar Mar 11 '20 10:03 Soren90

We have found the issue. The KEEPALIVED_UNICAST_PEERS variable had quotes in it, which made the PYTHON2BASH not work:

[root@keepalived system]# docker exec -it keepalived bash
bash-5.0# env
KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['10.4.52.12','10.4.52.6']"

Soren90 avatar Mar 12 '20 10:03 Soren90

We have found the issue. The KEEPALIVED_UNICAST_PEERS variable had quotes in it, which made the PYTHON2BASH not work:

[root@keepalived system]# docker exec -it keepalived bash
bash-5.0# env
KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['10.4.52.12','10.4.52.6']"

I have the same problem,Has someone solved it?

NoPerfectName avatar May 22 '20 03:05 NoPerfectName

@NoPerfectName Try to use is like this

"KEEPALIVED_UNICAST_PEERS=#PYTHON2BASH:['10.4.52.12','10.4.52.6']"

sine19 avatar May 22 '20 07:05 sine19

@BertrandGouny this ticket can be closed.

linkvt avatar Nov 22 '20 20:11 linkvt

It works when using this format (i.e. using no double quotes at all): KEEPALIVED_UNICAST_PEERS=#PYTHON2BASH:['1.1.1.1', '1.1.1.2', '1.1.1.3'] I'm using an env-file instead of command line variables, so that may be of influence.

BarryLuijten avatar Jan 17 '22 07:01 BarryLuijten