Skip to content

"Add VPC" Button does nothing if no Advanced Zone with securitygroupsenabled=false #2698

Closed

Description

@cocoon
ISSUE TYPE
  • Bug Report
COMPONENT NAME
UI
CLOUDSTACK VERSION
4.11.1.0-rc1

From: http://packages.shapeblue.com/testing/4111rc1/centos7/4.11/
But should be the same in previous versions (like 4.11)

CONFIGURATION

Zone 1 = Basic
Zone 2 = Advanced + securitygroupsenabled = true

OS / ENVIRONMENT

N/A

SUMMARY

CloudStack UI --> Network --> Switch View to VPC
Click Button "Add VPC"

Problem: nothing happens
Tested in browsers: FireFox, Edge

Error happens here: TypeError: advZones[0] is undefined
https://github.com/apache/cloudstack/blob/master/ui/scripts/network.js#L5202
(https://github.com/apache/cloudstack/blob/4.11/ui/scripts/network.js#L5202)

Cause:

When there is no Zone with networktype Advanced + securitygroupsenabled = false
https://github.com/apache/cloudstack/blob/master/ui/scripts/network.js#L5163

STEPS TO REPRODUCE

Have no advanced Zone with securitygroupsenabled = no

CloudStack UI --> Network --> Switch View to VPC
Click Button "Add VPC"


EXPECTED RESULTS
Expected: error that there is no compatiple Zone + requirements that are needed
ACTUAL RESULTS

nothing happens visually (JavaScript error)

TypeError: advZones[0] is undefined

Activity

  1. added this to the 4.11.1.0 milestone on Jun 7, 2018
  2. yadvr commented on Jun 8, 2018

    @yadvr
    Member

    @DaanHoogland @PaulAngus can you advise/triage this?

  3. DaanHoogland commented on Jun 8, 2018

    @DaanHoogland
    Contributor

    For my part this is a UI limitation and not a blocker for 4.11.1. If @cocoon leaves us with a patch I am happy to include it, though.

  4. yadvr commented on Jun 8, 2018

    @yadvr
    Member

    @cocoon I've fixed the UI failure/issue in this PR: #2704
    However, note that VPC will not work with SG+Adv Zone.
    The create VPC form will show up with the fix in the above PR, but the list of zones will be empty (if all the zones have SG enabled).

  5. cocoon commented on Jun 8, 2018

    @cocoon
    Author

    Great thanks, I was just working on something similar, it was still not a fix but it would at least display a Notice and not show the dialog and still throwing the error in the background.
    Because if it returns early and displays the Dialog, the Notification-Window is behind the setup dialog.

    var advZones = $.grep(zones, function(zone) {
                                                            return zone.networktype == 'Advanced' && !zone.securitygroupsenabled;
                                                        });
    
    
    //Validate that a valid zone was found or notify
    if (!Array.isArray(advZones) || !advZones.length) {
      cloudStack.dialog.notice({
        message: 'No valid Zone was found! Required: Advanced Zone with SecurityGroups disabled.'
      });
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions