Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboard CLI not working after latest PR merge (Single-host onboarding) #21

Closed
saratrajan opened this issue Feb 22, 2023 · 16 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@saratrajan
Copy link

saratrajan commented Feb 22, 2023

We have been using Akamai Onboard CLI for a few months now without any hiccups and are suddenly facing the below error (with no change in our setup) while trying to onboard a brand-new property. My hunch is this is a regression caused by the latest feature roll out (single-host).

Error with CLI

INFO   : Trying to create property rules json from merging files specified in folder_info
Traceback (most recent call last):
  File "/home/vsts/.akamai-cli/src/cli-onboard/bin/akamai-onboard.py", line 413, in <module>



    status = cli(prog_name='akamai onboard')
  File "/home/vsts/.akamai-cli/venv/cli-onboard/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/vsts/.akamai-cli/venv/cli-onboard/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/vsts/.akamai-cli/venv/cli-onboard/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vsts/.akamai-cli/venv/cli-onboard/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vsts/.akamai-cli/venv/cli-onboard/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/vsts/.akamai-cli/venv/cli-onboard/lib/python3.10/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/vsts/.akamai-cli/venv/cli-onboard/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/vsts/.akamai-cli/src/cli-onboard/bin/akamai-onboard.py", line 285, in create
    utility_papi_object.createAndUpdateProperty(config, onboard_object, wrapper_object, utility_object)
  File "/home/vsts/.akamai-cli/src/cli-onboard/bin/utility_papi.py", line 132, in createAndUpdateProperty
    if utility_object.doCliPipelineMerge(onboard_object, create_mode=False, merge_type='pm'):
TypeError: utility.doCliPipelineMerge() missing 1 required positional argument: 'onboard_object'

Commands in action

We are using the below command while invoking onboard workflow

akamai onboard --edgerc $(pwd)/.edgerc create --file property_onboard.json

Onboard JSON

Below is a snippet of our property_onboard.json which is based on stable template

{
    "property_info": {
        "property_name": "{{ propertyName }}",
        "secure_network": "ENHANCED_TLS",
        "contract_id": "{{ akamaiContractId }}",
        "group_id": "{{ akamaiGroupId }}",
        "product_id": "{{ akamaiProductId }}",
        "rule_format": "latest",
        "default_cpcode": {
            "create_new_cpcode": true,
            "new_cpcode_name": "{{ propertyName }}"

        },
        "file_info": {
            "use_file": false,
            "source_template_file": "",
            "source_values_file": ""
        },
        "folder_info": {
            "use_folder": true,
            "folder_path": "{{ pipelineName }}",
            "env_name": "{{ propertyName }}"
        }
    },
    "public_hostnames": [
        "{{ propertyName }}"
    ],
    "edge_hostname": {
        "mode": "new_enhanced_tls_edgehostname",
        "use_existing_edgehostname": {
            "edge_hostname": ""
        },
        "new_standard_tls_edgehostname": {},
        "new_enhanced_tls_edgehostname": {
            "ssl_cert_info": {
                "use_existing_enrollment_id": true,
                "existing_enrollment_id": "{{ enrollmentId }}",
                "existing_slot_number": "{{ slotNumber }}",
                "create_new_ssl_cert": false,
                "ssl_cert_template_file": "",
                "ssl_cert_template_values": "",
                "temp_existing_edge_hostname": ""

            }
        }
    },
    "activate_property_staging": false,
    "update_waf_info": {
        "add_selected_host": false,
        "waf_config_name": "",
        "update_match_target": false,
        "waf_match_target_id": ""
    },
    "activate_waf_policy_staging": false,
    "activate_property_production": false,
    "activate_waf_policy_production": false,
    "notification_emails": [
        ""
    ]
}

Quick question

Is there a way to pin desired version while running akamai install cli-onboard ? I would like to test this out with older version (<=v1.0.3) and would like to remain with the stable version until this issue has been resolved.

Any input is highly appreciated. Thanks in advance.

Best,
Sarat

@saratrajan
Copy link
Author

I can confirm that my setup works perfectly fine with onboard CLI version 1.0.5. However, I fail to see that version within Github's releases or tags - interesting!! Where might have that one gone? 🤔

I will try to fork and push the 1.0.5 version on Github for those who want to revert to a stable version.

Cheers,
Sarat

@pwongcha
Copy link
Contributor

Hi @saratrajan, sorry about tag. We just tag 1.0.5.
In the meantime, we are replicating the issue and will get back to you.

@saratrajan
Copy link
Author

Hi @saratrajan, sorry about tag. We just tag 1.0.5. In the meantime, we are replicating the issue and will get back to you.

@pwongcha Thank you for adding the stable tag. I was going to leave you a link to my forked release, but you beat me to it!

Please let me know if you need additional information on helping you reproduce this issue. All I had to do to fix the error was to switch back to v1.0.5, so it is certainly not an issue with my configs - that I can tell you.

Appreciate all the good work you/team are doing on these CLIs of Akamai workflows. Rock on! 👍

Best,
Sarat

@pwongcha pwongcha self-assigned this Feb 24, 2023
@pwongcha pwongcha added the bug Something isn't working label Feb 25, 2023
juliesulkin pushed a commit that referenced this issue Feb 28, 2023
#### BUG FIXES:
* create pipeline mode fail
* additional validations prevent cli to move on to create config
* create mode using mode new_standard_tls_edgehostname
* handle security match target update when match target is already 'ALL HOSTNAMES'
@juliesulkin
Copy link
Collaborator

@saratrajan we pushed out a fix for this. Can you please update the CLI and confirm? Thanks!

@saratrajan
Copy link
Author

@juliesulkin nice to hear from you again!
I will keep this thread posted, however I see that you have already Closed this issue!

@juliesulkin
Copy link
Collaborator

Hi @saratrajan! If you are still experiencing the issue after the latest update we will reopen the issue .

@saratrajan
Copy link
Author

saratrajan commented Mar 1, 2023

@juliesulkin I see that you have added extra validations for email address with the commit (with fix). Why was this added along with the fix? Can we try fixing the missed out parameter in code first?

Getting the below error! I believe this is because we are using a Service Account API as you already know, within pipeline workflows, which does not have an associated email address!

I think we can ignore the onboard json format for now as it is trivial.

INFO   : Start Akamai CLI onboard
INFO   : Successfully read property_onboard.json
WARNING: You are not using the latest template. Please use new setup.json template if you want to use secure by default
WARNING: Validating setup file information. Please wait, may take a few moments
INFO   : **************                                     valid property name
INFO   : **************                                     valid product_id
INFO   : **************                                     valid group_id
INFO   : **************                                     valid contract_id
INFO   : new_enhanced_tls_edgehostname                    edge hostname mode
ERROR  :                                                          invalid email address
ERROR  : Please review all errors

@pwongcha
Copy link
Contributor

pwongcha commented Mar 1, 2023

@saratrajan can you supply noreply@akamai.com for now?

@saratrajan
Copy link
Author

@pwongcha can you please let me know where to supply this? Is it done on Control Center? Please suggest.

@saratrajan
Copy link
Author

I just went through the code and realized that it is the notification emails. This is an optional field. Why are we failing onboarding if this is empty? @juliesulkin

@pwongcha
Copy link
Contributor

pwongcha commented Mar 1, 2023

On property_onboard.json file, add one more key:value at the end
"notification_emails": ["noreply@akamai.com"]

@saratrajan
Copy link
Author

saratrajan commented Mar 1, 2023

@pwongcha Shouldn't that be optional? Even docs suggest the same. I am testing it now anyway. But please fix the part of code which fails if email list is empty. This is going to break setup of a lot of users!

Appreciate your assistance in this regard.

Cheers,
Sarat

@pwongcha
Copy link
Contributor

pwongcha commented Mar 1, 2023

Can you create a new issue?
But FYI notification emails are now required data per API doc [https://techdocs.akamai.com/property-mgr/reference/post-property-activations]
We will fix it and make it backward compatible.

@saratrajan
Copy link
Author

Sure, will create a new issue. Notification emails will only come into picture for Activation - right?
We should not mandate it if activations for Staging and Prod are set to False in onboard.json.

Agree?

@pwongcha
Copy link
Contributor

pwongcha commented Mar 1, 2023

100% agree

@saratrajan
Copy link
Author

Created a new issue @pwongcha

#24 (comment)

100% agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants