IndexError when adding a new landscape-server unit

Bug #1455079 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
haproxy (Juju Charms Collection)
Fix Released
High
Данило Шеган

Bug Description

I did a landscape-server deployment from the trunk charm (lp:landscape-charm) which went fine. I then added a landscape-server unit, and haproxy failed with this backtrace in reverseproxy-relation-changed hook:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/reverseproxy-relation-changed", line 1302, in <module>
    main(hook_name)
  File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/reverseproxy-relation-changed", line 1275, in main
    reverseproxy_interface("changed")
  File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/reverseproxy-relation-changed", line 959, in reverseproxy_interface
    config_changed()
  File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/reverseproxy-relation-changed", line 909, in config_changed
    if not create_services():
  File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/reverseproxy-relation-changed", line 579, in create_services
    relation_info['services'])
  File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/reverseproxy-relation-changed", line 494, in parse_services_yaml
    services.get(service_name, {}), service)
  File "/var/lib/juju/agents/unit-haproxy-0/charm/hooks/reverseproxy-relation-changed", line 521, in merge_service
    servers.extend(new_service["backends"][i]["servers"])
IndexError: list index out of range

Related branches

description: updated
Revision history for this message
Данило Шеган (danilo) wrote :

FWIW, the root of the problem is that Landscape tries to do something like the following:

  https://pastebin.canonical.com/131488/

Basically, old_service has more backends than the new_service. I see no reason why this should be allowed, but if I am missing something, please let me know.

Revision history for this message
Данило Шеган (danilo) wrote :

*shouldn't* be allowed

Revision history for this message
Данило Шеган (danilo) wrote :

Sorry for the private pastebin, public version of the test I have there is in the branch.

Changed in haproxy (Juju Charms Collection):
assignee: nobody → Данило Шеган (danilo)
status: New → In Progress
David Britton (dpb)
Changed in haproxy (Juju Charms Collection):
importance: Undecided → High
David Britton (dpb)
Changed in haproxy (Juju Charms Collection):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.