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

BIG-IP config to AS3 conversion fails: TypeError: origObj[minMonitor].map is not a function #14

Closed rjouhann closed 3 years ago

rjouhann commented 3 years ago

Environment

Summary

The monitors used in this application might not be supported by ACC

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config:

    ltm node /tenant_2/application_2/10.1.20.104 {
    address 10.1.20.104
    metadata {
        references {
            value 1
        }
    }
    }
    ltm node /tenant_2/application_2/10.1.20.103 {
    address 10.1.20.103
    metadata {
        references {
            value 1
        }
    }
    }
    ltm virtual-address /tenant_2/application_2/10.1.10.114 {
    address 10.1.10.114
    arp enabled
    inherited-traffic-group true
    mask 255.255.255.255
    traffic-group /Common/traffic-group-1
    }
    ltm profile tcp-analytics /tenant_2/application_2/Analytics_TCP_Profile {
    app-service none
    collect-city enabled
    collect-continent enabled
    collect-country enabled
    collect-nexthop enabled
    collect-post-code enabled
    collect-region enabled
    collect-remote-host-ip enabled
    collect-remote-host-subnet enabled
    collected-by-client-side enabled
    collected-by-server-side enabled
    collected-stats-external-logging disabled
    collected-stats-internal-logging enabled
    description none
    external-logging-publisher none
    }
    ltm pool /tenant_2/application_2/Pool {
    members {
        /tenant_2/application_2/10.1.20.103:80 {
            address 10.1.20.103
            monitor min 1 of {
                /Common/tcp
            }
            metadata {
                source {
                    value declaration
                }
            }
        }
        /tenant_2/application_2/10.1.20.104:80 {
            address 10.1.20.104
            monitor min 1 of {
                /Common/tcp
            }
            metadata {
                source {
                    value declaration
                }
            }
        }
    }
    min-active-members 1
    monitor min 1 of {
        /Common/tcp
    }
    }
    ltm virtual /tenant_2/application_2/serviceMain {
    creation-time 2020-10-29:21:49:58
    description myTcpApp1
    destination /tenant_2/application_2/10.1.10.114:80
    ip-protocol tcp
    last-modified-time 2020-11-02:15:56:08
    mask 255.255.255.255
    persist {
        /Common/source_addr {
            default yes
        }
    }
    pool /tenant_2/application_2/Pool
    profiles {
        /Common/f5-tcp-progressive { }
        /tenant_2/application_2/Analytics_TCP_Profile { }
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    translate-address enabled
    translate-port enabled
    }
  2. Observe the following error message: When using VS-Code extension + ACC

    [2021-02-12T17:20:27.035Z] DEBUG: Docker command failed, output, [Error: Command failed: docker run --rm -v /Users/jouhannet/Documents/git:/app/data f5-appsvcs-charon:1.9.0 -o data/converted.as3.json -c data/toConvert.conf --unsupported --unsupported-objects unSupported.json
    at checkExecSyncError (child_process.js:639:11)
    at Object.execSync (child_process.js:675:15)
    at Object.execSync (electron/js2c/asar_bundle.js:5:12113)
    at /Users/jouhannet/.vscode/extensions/f5devcentral.vscode-f5-chariot-0.4.0/out/extension.js:79:34
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)] {
    status: 1,
    signal: null,
    output: [
    null,
    <Buffer 45 72 72 6f 72 20 63 6f 6e 76 65 72 74 69 6e 67 20 69 6e 70 75 74 20 66 69 6c 65 2e 20 50 6c 65 61 73 65 20 65 6d 61 69 6c 20 75 73 20 61 74 20 73 6f ... 740 more bytes>,
    <Buffer >
    ],
    pid: 71079,
    stdout: <Buffer 45 72 72 6f 72 20 63 6f 6e 76 65 72 74 69 6e 67 20 69 6e 70 75 74 20 66 69 6c 65 2e 20 50 6c 65 61 73 65 20 65 6d 61 69 6c 20 75 73 20 61 74 20 73 6f ... 740 more bytes>,
    stderr: <Buffer >
    }

When using Journeys App + ACC

Error converting input file. Please email us at solutionsfeedback@f5.com and include the following error:

TypeError: origObj[minMonitor].map is not a function
    at Object.customPostHandling (/app/src/maps/custom/pool.js:86:56)
    at module.exports (/app/src/converter.js:275:57)
    at module.exports (/app/src/main.js:58:23)
    at /app/serve:98:15
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
Server listening on http://localhost:8080 ...    -- this line is from my API wrapper

Expected Behavior

Conversion should succeed.

Actual Behavior

AS3 conversion fails.

mdditt2000 commented 3 years ago

@rjouhann ACC doesn't like the ltm pool /tenant_2/application_2/Pool. Unfortunately it crashes the API :(

Doesnt like

monitor min 1 of { /Common/tcp }

ltm pool /tenant_2/application_2/Pool {
    members {
        /tenant_2/application_2/10.1.20.103:80 {
            address 10.1.20.103
            monitor min 1 of {
                /Common/tcp
        }
    }
}

$ docker run --rm -v "$PWD":/app/data -p 8080:8080 vzhuravlevf5/zvvaccdev:dev serve Server listening on http://localhost:8080 ... 5 BIG-IP objects detected total 5 BIG-IP objects recognized by AS3 3 BIG-IP objects supported by Charon 2 AS3 stanzas generated Error converting input file. Please email us at solutionsfeedback@f5.com and include the following error:

TypeError: origObj[minMonitor].map is not a function at Object.customPostHandling (/app/src/maps/custom/pool.js:86:56) at module.exports (/app/src/converter.js:275:57) at module.exports (/app/src/main.js:72:23) at /app/serve:96:11 at processTicksAndRejections (internal/process/task_queues.js:93:5)

Checking with PD

mdditt2000 commented 3 years ago

Created Jira CHARON-179 task

@rjouhann sent you a email with the merge request.

mdditt2000 commented 3 years ago

Merge branch 'min_monitor' into 'develop' - Completed @rjouhann this can be closed.