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

If virtual-address section present in config processing fails. #66

Closed lukaszbrzosko closed 3 years ago

lukaszbrzosko commented 3 years ago

Environment

Application Services Version: 3.31.0 BIG-IP Version: 16.1.0

Summary

If we include virtual-address in input file for charon - processing fails and there is no output file present.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config:

    ltm virtual /tenant_6/application_6/vs__v4_i130_any {
    destination /Common/10.1.1.2:0
    ip-forward
    last-modified-time 2020-01-31:15:17:25
    mask 255.255.255.255
    profiles {
        /Common/fastL4 { }
    }
    source 0.0.0.0/0
    translate-address disabled
    translate-port disabled
    vlans {
        /Common/isp-1
    }
    vlans-enabled
    }
    ltm virtual-address /Common/10.1.1.2 {
    address 10.1.1.2
    arp enabled
    mask 255.255.255.255
    traffic-group /Common/traffic-group-1
    }
  2. Observe the following error message:

    (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)
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
    (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected Behavior

Expect not to get an error.

Actual Behavior

If we remove ltm virtual-address /Common/10.1.1.2 processing works as expected. As i checked it should be supported I guess: https://clouddocs.f5.com/products/extensions/f5-as3-configuration-converter/latest/userguide/faq.html

Unless I'm missing something here.

mdditt2000 commented 3 years ago

Verified crash using 1.15.0 but resolved in 1.15.1

% docker run --rm -v  "$PWD":/app/data f5-as3-config-converter:v1.15.1 -o data/ltm.json -c data/ltm.conf
2021-10-19 21:34:39 INFO 0 BIG-IP objects detected total
2021-10-19 21:34:39 INFO 0 BIG-IP objects recognized by AS3
2021-10-19 21:34:39 INFO 0 BIG-IP objects supported by ACC
2021-10-19 21:34:39 INFO 0 AS3 stanzas generated

Please try with 1.15.1 - https://github.com/f5devcentral/f5-as3-config-converter/releases/tag/v1.15.1

lukaszbrzosko commented 3 years ago

this is the version I've download on yesterday:

 ✘ brzosko@WRW-ML-00011994  ~/Documents  docker images | grep 1.15.1
f5-as3-config-converter                v1.15.1      ac68aeec5085   12 days ago    149MB

Running this that way:

 brzosko@WRW-ML-00011994  ~/Documents  docker run --rm -v  "$PWD":/app/data f5-as3-config-converter:v1.15.1 -o data/output_test.json -c data/bigip1.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)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I'm on MacOS one of my colleagues that is also on Mac see similar problem. Not sure if this is related.

jszczepanskif5 commented 3 years ago

Looks like a duplicate of https://github.com/f5devcentral/f5-as3-config-converter/issues/55, which I believe will have a fix in 1.16 looking at JIRA

mdditt2000 commented 3 years ago

@janakimeyyappan please email me for the 1.16.0 RC2 image that resolves #55

mdditt2000 commented 3 years ago

Resolved in #55