cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Load balancer protocols bug

Open DagSonsteboSB opened this issue 7 years ago • 4 comments

ISSUE TYPE
  • Bug Report
  • Improvement Request
COMPONENT NAME
  • ACS 4.11 VR load balancer
  • ACS 4.11 CreateLoadBalancerRule API call
CLOUDSTACK VERSION
  • ACS 4.11.x
CONFIGURATION
  • Advanced zone
  • Isolated guest network
  • Load balancer rules
OS / ENVIRONMENT
  • N/A
SUMMARY
  • Load balancer protocols for UDP and TCP-proxy are not labelled correctly in the GUI: ** image ** Note label is label.lb.protocol_udp / label.lb.protocol_tcp-proxy (underscores used to signify the inserted space) ** Whatever protocol is chosen is persisted in the DB with the above strings.
  • However HAproxy and iptables configuration will always be configured with "TCP".
  • This may or may not be down to two protocol parameters here: https://github.com/apache/cloudstack/blob/4.11.2.0/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java#L316 where the first one is always set to "TCP"
STEPS TO REPRODUCE
  • Create LB rule using each protocol
  • Observe the configuration which ends up on the HAproxy configuration on the VR does NOT change and always uses TCP.
EXPECTED RESULTS
  • Protocols UDP and TCP-proxy being honoured
ACTUAL RESULTS
  • All LB rules are configured as TCP.

DagSonsteboSB avatar Apr 01 '19 14:04 DagSonsteboSB

This exists in master:

ui/l10n/en.js:"label.lb.protocol.http":"HTTP",
ui/l10n/en.js:"label.lb.protocol.ssl":"SSL",
ui/l10n/en.js:"label.lb.protocol.tcp":"TCP",
ui/l10n/en.js:"label.lb.protocol.udp":"UDP",

yadvr avatar Jun 28 '19 07:06 yadvr

I believe that the issue is here: https://github.com/apache/cloudstack/blob/master/ui/scripts/network.js#L6846-L6862

image

Enumerating the protocols is introducting a space after '.protocol.', the label cannot then be resolved by the language files.

    var protocols = protocolCapabilities.value.split(',');

        if (!protocols) {
            return [];
        }

        var data = [];
        $(protocols).each(function() {
            data.push({id: this.valueOf(), name: this.valueOf(), description: _l('label.lb.protocol.' + this.valueOf())});
        });

PaulAngus avatar Nov 20 '19 14:11 PaulAngus

Did a quick fix replacing spaces but only half fixed it: image

maybe the other half is in the actual label missing.

DaanHoogland avatar Nov 28 '19 14:11 DaanHoogland

right i am; 'tcp.proxy' and 'tcp-proxy' are used interchangably. will create a PR to try and unify

DaanHoogland avatar Nov 28 '19 14:11 DaanHoogland