Deploying to Apigee on a Jenkins box in AWS - how do I fix the error, 'The string \“--\” is not permitted within comments.'?

Not applicable

I can do a deploy to Apigee on my local machine, but when I try to do it from a Jenkins box that lives in AWS, I get a strange error: 'The string \"--\" is not permitted within comments.'

Here's the full error:

XMLFileListUtil:140
    =============Searching for XML files in the following directory ================
    /var/lib/jenkins/jobs/company-apigee-proxy-deploy-nonprod/workspace/deploy/company-apigee-ourproxy/target/apiproxy/proxies
    00:14:03,571 DEBUG XMLFileListUtil:144 - =============Nuber of files found is================
    1
    00:14:03,771  INFO FileReader:71 - ============= Reading the config file located at ================
    /var/lib/jenkins/jobs/company-apigee-proxy-deploy-nonprod/workspace/deploy/company-apigee-ourproxy/config.json
    00:14:03,817 ERROR ConfigureMojo:124 - The string \"--\" is not permitted within comments. 

Googling for this error message just shows a bunch of people who have "--" in XML comments, which I do not. (I've exhaustively looked through all the files where it might be using full text "find in path" search in IntelliJ. There's some normal XML comments in some of the files, but NO cases of "--" within a comment. I even tried stripping the XML comments but it made no difference.)

The Ansible code I use to kick off the script which triggers the Apigee deploy is:

- name: execute deploy.sh script
      command: bash -lc "bash deploy.sh"
      register: deploy_script_output
      args:
        chdir: "{{ deploy_subdir }}"

I've tried several variations on this too, like using "shell:" and "script:" but it seems to make no difference.

The .XML file it complains about is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <TargetEndpoint name="ourproxy">
        <Description/>
        <FaultRules>
            <FaultRule name="handleTargetErrors">
                #common_code#
            </FaultRule>
        </FaultRules>
        <PreFlow name="PreFlow">
            <Request/>
            <Response/>
        </PreFlow>
        <PostFlow name="PostFlow">
            <Request/>
            <Response/>
        </PostFlow>
        <Flows/>
        <HTTPTargetConnection>
            <SSLInfo>
                <Enabled>true</Enabled>
                <ClientAuthEnabled>true</ClientAuthEnabled>
                <KeyStore>FROM CONFIG.JSON</KeyStore>
                <KeyAlias>FROM CONFIG.JSON</KeyAlias>
            </SSLInfo>
            <URL>FROM CONFIG.JSON</URL>
        </HTTPTargetConnection>
    </TargetEndpoint>

The "#common_code#" is a "fragment" that's brought in dynamically via the Apigee plugin from elsewhere and has this in it:

<Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>
    <Step>
        <Name>am_common_redacted</Name>
    </Step>

I've scoured all my .XML and .JSON files for "--" where it shouldn't be, but I cannot find it. What's really bizarre is when I run the deploy script on my local machine, it works, which really makes me doubt it's the contents of the files that's the issue. It's some weird environment cause.

Does anyone have ideas? I am completely baffled by this.

0 1 315
1 REPLY 1

Not applicable

I stripped out all XML comments in all my files and got past the error. This makes no sense, as all comments were well-formed XML, and none of them had "--" inside of a comment. But whatever. I'm moving on to the next error now. 🙂