Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
hermanmaleiane
Explorer

Locked session on web api call

Hi team,

 

Hope you are doing well.

I'm trying to use the add host method in the web api to create hosts into existing group.

I was able to run it using postman with the below body:

{
  "name" : "xxxxx",
  "ip-address" : "xxxxxxx",
  "comments" : "xxxxxxx ",
  "groups" : "xxxxxxx"
}
 
I got the response and then ran the publish method with the same X-chkp-sid, and i got task-id as a response. 
 
The problem is when i go to the painel, the object is locked (Locked by other session).
In the attached image you can see the message displayed for other users.
 
I was trying to follow this discussion but it's not helpful. 
 
How can i solve this problem?
 
Thanks in adavance 
 
 

 

0 Kudos
6 Replies
_Val_
Admin
Admin

You also need to close the session after "publish" action, in other word, to log out

0 Kudos
hermanmaleiane
Explorer

Thank you @_Val_ .

When i try a new request i got this error:

{
"code" : "generic_error",
"message" : "Action cannot be executed on object: N-DENY-XX due to: Object 'N-DENY-XX' is locked by another session."
}

 

How can i bypass this error. I need to brute force close this session 

 

0 Kudos
_Val_
Admin
Admin

As said before, all previous sessions should be properly closed to unlock the object again. Clean your sessions, try again.

0 Kudos
hermanmaleiane
Explorer

On sessions view it appears disconnected.

session.png

0 Kudos
hermanmaleiane
Explorer

Hi @_Val_ ,

Sorry for this.

I was able to run a command to discard all web_api sessions and i tried again to add host and add to specific group but i got the same result. 

This time i complete all the steps with logout method. 

Response from add-host

{
"uid": "XXXXXXX",
"name": "XXXXXXX",
"type": "host",
"domain": {
"uid": "XXXXXXX",
"name": "SMC User",
"domain-type": "domain"
},
"ipv4-address": "XXXXXXX",
"interfaces": [],
"nat-settings": {
"auto-rule": false
},
"groups": [
{
"uid": "XXXXXXX",
"name": "XXXXXXX",
"type": "group",
"domain": {
"uid": "XXXXXXX",
"name": "SMC User",
"domain-type": "domain"
},
"icon": "General/group",
"color": "slate blue"
}
],
"comments": "Imported from soar API",
"color": "black",
"icon": "Objects/host",
"tags": [],
"meta-info": {
"lock": "unlocked",
"validation-state": "ok",
"last-modify-time": {
"posix": 1663687538594,
"iso-8601": "2022-09-20T17:25+0200"
},
"last-modifier": "XXXXXXX",
"creation-time": {
"posix": 1663687538594,
"iso-8601": "2022-09-20T17:25+0200"
},
"creator": "XXXXXXX"
},
"read-only": true
}

 

Response from publish 

"task-id": "01234567-89ab-cdef-9516-e10f427f328e"

 

Response from logout 

 

{
    "message""OK"
}
 
Can you please help with this issue?

 

 

 

 

 

 

 

0 Kudos
_Val_
Admin
Admin

This is very odd and should not happen. Please open a TAC case for this, it's the fastest way.

I would also run a set of sample actions through mgmt_cli tool, to see if it has the same result.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events