f5devcentral / f5-automation-config-converter

Convert BIG-IP configs to AS3 and DO declarations
https://clouddocs.f5.com/products/extensions/f5-automation-config-converter/latest/
Apache License 2.0
35 stars 13 forks source link

Error when converting a conf spanning Common and a partition if no objects are to be placed in Common/Shared #55

Closed jszczepanskif5 closed 3 years ago

jszczepanskif5 commented 3 years ago

Environment

Summary

If the uploaded conf file includes objects from both a partition and Common, ACC will raise an error if no objects end up getting placed inside the Common tenant in the resulting declaration.

Steps To Reproduce

  1. Convert following config:

    ltm virtual /tenant1/sample {
    creation-time 2021-09-21:03:26:25
    destination /Common/10.10.10.10:80
    ip-protocol tcp
    last-modified-time 2021-09-21:03:26:25
    mask 255.255.255.255
    profiles {
        /Common/tcp { }
    }
    source 0.0.0.0/0
    translate-address enabled
    translate-port enabled
    }
    ltm virtual-address /Common/10.10.10.10 {
    address 10.10.10.10
    arp enabled
    inherited-traffic-group true
    mask 255.255.255.255
    traffic-group /Common/traffic-group-1
    }
  2. Observe the following error message:

    
    (node:21) UnhandledPromiseRejectionWarning: TypeError: Error converting input file. Please email us at solutionsfeedback@f5.com and include the following error:

Cannot convert undefined or null to object at Function.keys () at module.exports (/app/src/converter.js:463:38) at mainRunner (/app/src/main.js:57:23) at main (/app/src/main.js:131:30)

p-semenov-f5 commented 3 years ago

Jira issue created CHARON-467

p-semenov-f5 commented 3 years ago

Resolved

jbaribeault commented 3 years ago

I see this is marked as resolved, but even on v1.15.1 (latest release) that the issue still exists. Is there a workaround (like creating a dummy object for common) that would allow me to have acc crunch configs with this scenario? The example above was used to test:

docker run --rm -v "$PWD":/app/data f5-as3-config-converter:v1.15.1 -o data/output.json -c data/bigip_broken.conf
(node:1) UnhandledPromiseRejectionWarning: TypeError: Error converting input file. Please email us at solutionsfeedback@f5.com and include the following error:
Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at module.exports (/app/src/converter.js:463:38)
    at mainRunner (/app/src/main.js:57:23)
    at main (/app/src/main.js:131:30)
jszczepanskif5 commented 3 years ago

The fix seems to be scheduled for 1.16 looking at the internal board. In the meantime I believe adding some dummy object in /Common should work like you suggest, so like for the example above adding a fake virtual makes ACC not crash anymore:

ltm virtual /tenant1/sample {
    creation-time 2021-09-21:03:26:25
    destination /Common/10.10.10.10:80
    ip-protocol tcp
    last-modified-time 2021-09-21:03:26:25
    mask 255.255.255.255
    profiles {
        /Common/tcp { }
    }
    source 0.0.0.0/0
    translate-address enabled
    translate-port enabled
}
ltm virtual-address /Common/10.10.10.10 {
    address 10.10.10.10
    arp enabled
    inherited-traffic-group true
    mask 255.255.255.255
    traffic-group /Common/traffic-group-1
}
ltm virtual /Common/foo { 
    profiles {
        /Common/fastL4 { }
    }
}