Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
John_Fleming
Advisor

R80.40 - can't cancel task

I started using the python SDK to set log servers. In my first attempt I was playing with setting the log server to a CLM for a given simple cluster. I noticed afterwards I didn't have anything in the API call to publish so I went to the gui and hit publish and disconnect now its just sitting at %10.  

Any idea how to cancel this task? Discard & disconnect rows "An internal error occurred."

0 Kudos
14 Replies
John_Fleming
Advisor

So looks like setting the log server via API will basically eff up the API on the CMA until I mdsstop. 😕

This is JH 87 BTW.

0 Kudos
PhoneBoy
Admin
Admin

Ouch, sounds like a TAC case is in order.
Also tagging @Omer_Kleinstern 

0 Kudos
John_Fleming
Advisor

I haven't had a chance to debug or bother diamond, which i'll wait until next week. 

0 Kudos
Alex_Zelinsky
Employee
Employee

Please specify more details, is this set-simple-cluster api? And what exactly did you try to do

0 Kudos
John_Fleming
Advisor

I plan on creating a replication I just haven't had time. Yes set simple cluster and send-logs-to-server. I set name and send-logs-to-server as a single member list. 

The docs say its an object but others say string or list and description says Servers so i'm not %100 what I should be sending. I didn't try logs and alerts (or whatever that other one was).

0 Kudos
Alex_Zelinsky
Employee
Employee

I set it as follows:

Here is an example of setting log server for a cluster:
mgmt_cli --session-id "$session_id" set-simple-cluster name "$CLUSTERNAME" ipv4-address "$CLUSTERMGMTIP" ipv6-address "$IPV6_CLUSTERMGMTIP" \ version "$GWVERSION" os-name "Gaia" cluster-mode "opsec-ha" firewall true ips false vpn false \ send-logs-to-server.0 "$MGMTNAME" send-alerts-to-server.0 "$MGMTNAME"
It's network object name, and you can provide a few.
However the issue of cancelling task is not related.
Actually there is now way to cancel a task.
To better understand your issue I need more details and cpm.elg when you're getting INteranl Error.
I undertsatand you get that error when you try to discradand disconnect API session from SC, right?

 

0 Kudos
John_Fleming
Advisor

Hi Alex, I haven't had a chance to put something meaningful in here yet. I can't send logs or anything as the customer will not allow this. Its a pretty strict env. I'll see if I can replicate and send is the smallest replication of the python code to trigger when I get a few. Should be this week.

0 Kudos
John_Fleming
Advisor

Test env is stood up. I'll start working on the code python code next.

First.. Nachos for they indeed rule.

0 Kudos
John_Fleming
Advisor

Eff.. couldn't replicate. I'm going to move this code back to the lab and see if it fails again. I'll check log files you pointed out and engage support if needed.

Any input on debugs I should turn on?

0 Kudos
John_Fleming
Advisor

Here is the python code.

from cpapi import APIClient, APIClientArgs
import pprint
pp = pprint.PrettyPrinter(indent=4)

api_server='10.1.18.100'
username='admin'
password='somepw'
domain_name='Test_Domain'

def main():
    client_args = APIClientArgs(server=api_server)
    with APIClient(client_args) as domain_client:
        login_res = domain_client.login(username, password, domain=domain_name)
        if login_res.success is False:
            print("Try upgrading to R81 maybe?")
            exit(81)
        json_data = { "name": "TestCluster",
                      "send-logs-to-server": "TestDomainLogServer" }
        print("Calling set cluster api")
        simple_cluster_output = domain_client.api_call("set-simple-cluster", json_data)
        pp.pprint(simple_cluster_output)
        print("Calling publish api")
        publish_output = domain_client.api_call("publish",{})
        pp.pprint(publish_output)

if __name__ == "__main__":
    main()

 

 

0 Kudos
Alex_Zelinsky
Employee
Employee

turn on the following logs in $MDS_FWDIR/conf/tdlog.com

log4j.logger.com.checkpoint.management.gateway_legacy.services.internal.LegacyGatewayObjectCrudSvcImpl=DEBUG
log4j.logger.com.checkpoint.management.gateway_legacy.objects.cluster.ClusterUtils=DEBUG
log4j.logger.com.checkpoint.management.gateway_legacy.web_services.internal.LegacyGatewayObjectCrudSvcRemoteImpl=DEBUG

 

What version do you run? R80.40 jumbo?

 

0 Kudos
Alex_Zelinsky
Employee
Employee

Python code seems pretty simple and straightforward.

Do you see the following line printing:

pp.pprint(simple_cluster_output)

 and what does it print?

 

 

0 Kudos
John_Fleming
Advisor

Everything ran clean on the replication so nothing useful other then http 200 etc. 

0 Kudos
Alex_Zelinsky
Employee
Employee

well, let me know if it happens again

 

0 Kudos