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

Edit aborted while trying to approve automation task #21085

Closed
zigaSRC opened this issue Mar 1, 2021 · 23 comments
Closed

Edit aborted while trying to approve automation task #21085

zigaSRC opened this issue Mar 1, 2021 · 23 comments
Assignees

Comments

@zigaSRC
Copy link

zigaSRC commented Mar 1, 2021

It is impossible to approve or deny an automation task request because filling out the reason field results in an "Edit Aborted!" error.

ManageIQ version is kasparov-1
I'm using chrome, although the same thing happens on firefox and edge.
If you need any more information please let me know.

See video.

@Fryguy
Copy link
Member

Fryguy commented Mar 4, 2021

@kavyanekkalapu Can you please take a look at this one?

@zigaSRC
Copy link
Author

zigaSRC commented Mar 5, 2021

I would just like to add that approval via API works.

The problem seems to be that the session :edit key is not being set or is set incorrectly. Haven't managed to get further as I'm not exactly that familiar with the way ManageIQ is implemented and how to debug but here's the:

@zigaSRC
Copy link
Author

zigaSRC commented Jul 7, 2021

@kavyanekkalapu Could you please take a look at this one when you get the chance? Thanks :)

@kavyanekkalapu
Copy link
Member

@zigaSRC I tried automation task approval in kasparov env, seems working for me , not able to reproduce it.

Screen Shot 2021-07-15 at 9 27 59 PM

@zigaSRC
Copy link
Author

zigaSRC commented Jul 16, 2021

@kavyanekkalapu It did work for us for a while as well, then at some point it started to cause problems. Is it possible something wasn't cleaned up properly? Where could I check if there's a rouge session left over from a while ago that would prevent editing the requests? Is there some table in the DB?

@kavyanekkalapu
Copy link
Member

kavyanekkalapu commented Jul 16, 2021

@zigaSRC When the error occurs, could you grab server log?

@zigaSRC
Copy link
Author

zigaSRC commented Jul 16, 2021

@kavyanekkalapu Look at 2021-07-16T15:08:18.845175 for the aborted message.
evm.log

@zigaSRC
Copy link
Author

zigaSRC commented Jul 22, 2021

@kavyanekkalapu Updated to lasker-1, same issue.

@kavyanekkalapu
Copy link
Member

@zigaSRC I will check this week, thanks.

@kavyanekkalapu
Copy link
Member

@zigaSRC Is it possible to post the sample request you are trying?

For Example, this is the service request i am trying and it is working for me.

#<ServiceTemplateProvisionRequest id: 2, description: "Provisioning Service [Dancer-MySQL-Example] from [...", approval_state: "pending_approval", type: "ServiceTemplateProvisionRequest", created_on: "2021-07-17 20:34:32", updated_on: "2021-07-21 18:26:22", fulfilled_on: "2017-10-18 20:34:56", requester_id: 1, requester_name: "admin`", request_type: "clone_to_service", request_state: "finished", message: "Server [EVM] Service [Dancer-MySQL-Example] Provis...", status: "Error", options: {:dialog=>{"dialog_existing_project_name"=>"default", "dialog_new_project_name"=>nil, "dialog_param_DATABASE_USER"=>"test1", "dialog_param_DATABASE_PASSWORD"=>"test1", "dialog_param_PERL_APACHE2_RELOAD"=>nil, "dialog_param_SECRET_KEY_BASE"=>nil, "dialog_param_CONTEXT_DIR"=>nil, "dialog_param_SOURCE_REPOSITORY_URL"=>"https://github.com/xxx/dancer-ex.git", "dialog_param_SOURCE_REPOSITORY_REF"=>nil, "dialog_param_GITHUB_WEBHOOK_SECRET"=>nil, "dialog_param_DATABASE_SERVICE_NAME"=>"database", "dialog_param_CPAN_MIRROR"=>nil, "dialog_param_APPLICATION_DOMAIN"=>nil, "dialog_param_NAME"=>"dancer-mysql-example", "dialog_param_NAMESPACE"=>"openshift", "dialog_param_MEMORY_LIMIT"=>"512Mi", "dialog_param_MEMORY_MYSQL_LIMIT"=>"512Mi", "dialog_param_DATABASE_NAME"=>"sampledb"}, :workflow_settings=>{:resource_action_id=>161, :dialog_id=>6}, :initiator=>nil, :src_id=>7, :cart_state=>"ordered", :requester_group=>"EvmGroup-super_administrator", :delivered_on=>2017-10-18 20:34:44 UTC, :user_message=>"Server [EVM] Service [Dancer-MySQL-Example] Provision Step [execute] Status [Error Processing execute] "}, userid: "admin1", source_id: 7, source_type: "ServiceTemplate", destination_id: nil, destination_type: nil, tenant_id: 1, service_order_id: 4, process: true, cancelation_status: nil, initiated_by: nil>
irb(main):021:0> => true

@zigaSRC
Copy link
Author

zigaSRC commented Aug 2, 2021

@kavyanekkalapu sorry for the late response.
Just to be clear I'm talking about automate requests and not service requests. Automation -> Automate -> Requests

Here's a request returned by the API, that is waiting for approval:

{
    "href": "https://example.com/api/automation_requests/48861",
    "id": "48861",
    "description": "Automation Task",
    "approval_state": "pending_approval",
    "type": "AutomationRequest",
    "created_on": "2021-08-02T10:32:34Z",
    "updated_on": "2021-08-02T10:32:47Z",
    "fulfilled_on": null,
    "requester_id": "2",
    "requester_name": "user",
    "request_type": "automation",
    "request_state": "pending",
    "message": "Waiting for manual approval.",
    "status": "Ok",
    "options": {
        "namespace": "Self_provisioning/addDiskToVM",
        "class_name": "addDisk",
        "instance_name": "Default",
        "user_id": "2",
        "vm": {},
        "dialog_values": {
            "dialog_configuration_type": "none",
            "dialog_datastore": "[DS4800_VG3_VOL3]",
            "dialog_disk_format": "true",
            "dialog_disk_size": "1",
            "dialog_lv_name": "",
            "dialog_mount_point": "",
            "dialog_size_unit": "1024",
            "dialog_vg_name": ""
        },
        "executed_on_servers": [
            4
        ]
    },
    "userid": "[email protected]",
    "source_id": null,
    "source_type": null,
    "destination_id": null,
    "destination_type": null,
    "tenant_id": "1",
    "service_order_id": null,
    "process": true,
    "cancelation_status": null,
    "initiated_by": "user",
    "actions": [
        {
            "name": "approve",
            "method": "post",
            "href": "https://example.com/api/automation_requests/48861"
        },
        {
            "name": "deny",
            "method": "post",
            "href": "https://example.com/api/automation_requests/48861"
        },
        {
            "name": "cancel",
            "method": "post",
            "href": "https://example.com/api/automation_requests/48861"
        },
        {
            "name": "edit",
            "method": "post",
            "href": "https://example.com/api/automation_requests/48861"
        }
    ]
}

@zigaSRC
Copy link
Author

zigaSRC commented Aug 24, 2021

@kavyanekkalapu Any new info on this?

@kavyanekkalapu
Copy link
Member

@zigaSRC I tried with above data in both lasker and latest master and couldn't reproduce it. for the user you using, do you have permissions for approving request flow?

@zigaSRC
Copy link
Author

zigaSRC commented Aug 27, 2021

@kavyanekkalapu Yes, I do. Even tried it with the default admin account... No luck.

I don't think it's a bug in general. Something must have gone wrong at one point in the past and from then on it hasn't been working. Are there any states or variables that might have been set and weren't cleared properly? Any way to reset that?
It survived an update so it must be something that persists - a field in the DB?

@kavyanekkalapu
Copy link
Member

@zigaSRC Could you delete cache, history and cookies once and try?

@zigaSRC
Copy link
Author

zigaSRC commented Aug 30, 2021

@kavyanekkalapu Nothing changed. As soon as I start typing a reason the "edit aborted" message appears.

@zigaSRC
Copy link
Author

zigaSRC commented Oct 11, 2021

Took a while, but I managed to get to the bottom of it. The problem is with the get_data_size method as it throws an error when there's a request with a vm in the options. Changed the automate code to just pass the id of the vm instead of the whole thing.

@kavyanekkalapu
Copy link
Member

Took a while, but I managed to get to the bottom of it. The problem is with the get_data_size method as it throws an error when there's a request with a vm in the options. Changed the automate code to just pass the id of the vm instead of the whole thing.

@zigaSRC Interesting, do you want to raise a pr with your changes?

@zigaSRC
Copy link
Author

zigaSRC commented Oct 12, 2021

@kavyanekkalapu I didn't change any part of the ManageIQ code, just adapted mine in the automation domain to work around the problem.

If you're looking for the culprit it's this. It throw's a "can't dump" exception which causes the session not to be read which leads to the errors I was seeing.

As far as I am concerned this issue can be closed as the session is probably not the place to store a large amount of data like the vm object. It would be nice to see some warnings in the documentation though, especially as I don't expect the options to a $evm.execute('create_automation_request',... call to end up in a session when approving/denying a request :)

@Fryguy
Copy link
Member

Fryguy commented Oct 12, 2021

Interesting - this feels very similar to that google cloud issue we just fixed. cc @jrafanie

@jrafanie
Copy link
Member

yeah, sounds like a remnant from ManageIQ/manageiq-ui-classic#7877 and could have been mitigated by #21455 or ManageIQ/manageiq-providers-google#198. Can you verify if it's still an issue @zigaSRC on master?

@miq-bot miq-bot added the stale label Feb 27, 2023
@miq-bot
Copy link
Member

miq-bot commented Feb 27, 2023

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@miq-bot miq-bot closed this as completed May 29, 2023
@miq-bot
Copy link
Member

miq-bot commented May 29, 2023

This issue has been automatically closed because it has not been updated for at least 3 months.

Feel free to reopen this issue if this issue is still valid.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants