Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ivory

failed with error message: message: Missing header: [X-chkp-sid]

Hello,

I'm getting strange errors when I tried to run my playbook; I tried many things that was recommended but I can't seem to fix the issues. Please assist, thanks.

 

Error -

Command 'add-host {u'name': u'host_demo_2', u'ip-address': u'1.2.10.110'}' failed with error message: message: Missing header: [X-chkp-sid]

code: generic_err_missing_required_header

. All changes are discarded and the session is invalidated.

 

Playbook-

---
- hosts: localhost
  tasks:
    - name: include vars
      include_vars:
        dir: group_vars/{{pin_env}}

    - name: "login"
      check_point_mgmt:
        command: login
        parameters:
          username: '{{checkpoint_user}}'
          password: '{{checkpoint_password}}'
          management: '{{mgmt_server}}'
        fingerprint: '{{mgmt_fingerprint}}'
      register: login_response

    - name: add host
      check_point_mgmt:
        command: add-host
        parameters:
          name: 'host_demo_2'
          ip-address: '1.2.10.110'
        session-data: '{{login_response}}'

    - name: "publish"
      check_point_mgmt:
        command: publish
        session-data: '{{login_response}}'

    - name: logout
      check_point_mgmt:
        command: logout
        session-data: '{{login_response}}'

 

0 Kudos
2 Replies
Highlighted
Admin
Admin

Re: failed with error message: message: Missing header: [X-chkp-sid]

Most likely you haven't enabled the API server from all IPs.
https://community.checkpoint.com/t5/Developers-API-CLI/Ansible-Unable-to-obtain-sid/m-p/31928
0 Kudos
Highlighted
Ivory

Re: failed with error message: message: Missing header: [X-chkp-sid]

Thanks for the response. I was able to resolve the issues, the problem was related to account permission in smart dashboard.

0 Kudos