> Source: [sk169934](https://support.checkpoint.com/results/sk/sk169934)

# sk169934 - CPsemd process restarts repeatedly

| Property | Value |
|----------|-------|
| Solution ID | sk169934 |
| Date Created | 2020-10-07 |
| Last Modified | 2021-11-17 |
| Technical Level | General |

## Symptoms

- * Process Cpsemd restart repeatedly by cpwd, in $CPDIR/log/cpwd.elg you can see that the cpwd restart cpsemd each \~13 minutes :  
  `
  [cpWatchDog PID]@hostname[DATE TIME] [ERROR] cpsemd (pid=xxx) did not send keep-alive message for 1 number of times`  
  `
  [cpWatchDog PID]@hostname[DATE TIME] cpsemd (pid=xxx) did not send keep-alive message for 2 number of times`  
  `
  [cpWatchDog PID]@hostname[DATE TIME] cpsemd (pid=xxx) did not send keep-alive message for 3 number of times`  
  `
  [cpWatchDog PID]@hostname[DATE TIME] Signal was sent to process cpsemd (pid=9206)`  
  `
  [cpWatchDog PID]@hostname[DATE TIME] cpsemd (pid=xxx) did not send keep-alive message for 4 number of times`  
  `
  [cpWatchDog PID]@hostname[DATE TIME] Killed process cpsemd with pid xxx`  
  `
  [cpWatchDog PID]@hostname[DATE TIME] Client(pid=xxx) was deregistered successfully`

* Following logs are seen in the $RTDIR/log/cpsemd.elg file:  

  `
  [CPSEMD PID]@hostname[DATE TIME] Error: Failed to connect to CPMI locally in try number #1. FWM is probably still initializing. Will try again in 10 seconds.`  
  `
  [CPSEMD PID]@hostname[DATE TIME] Error: Failed to connect to CPMI locally in try number #2. FWM is probably still initializing. Will try again in 10 seconds.`  
  `
  [CPSEMD PID]@hostname[DATE TIME] Error: Failed to connect to CPMI locally in try number #3. FWM is probably still initializing. Will try again in 10 seconds.`

* Logs with warning about cp_timed_blocker_handler can be seen in the $RTDIR/log/cpsemd.elg file:  
  `
  [CPSEMD PID]@hostname[DATE TIME] Warning:cp_timed_blocker_handler: A handler [0x82289f0] blocked for 119 seconds.`  
  `
  [CPSEMD PID]@hostname[DATE TIME] Warning:cp_timed_blocker_handler: Handler info: Library [cpsemd], Function offset [0x1e09f0].`  
  `
  [CPSEMD PID]@hostname[DATE TIME] Warning:cp_timed_blocker_handler: Handler info: Nearest symbol name `  
  `[_ZN23CAutomaticPolicyBuilder33__`**sched_SchedListenToNotification**`EPv], offset [0x1e09f0].`

* In $FWDIR/log/fwm.elg you can see following logs:  
  `
  [FWM PID]@hostname[DATE TIME] Warning:cp_timed_blocker_handler: A handler [0xf3a632e0] blocked for 653 seconds.`  
  `
  [FWM PID]@hostname[DATE TIME] Warning:cp_timed_blocker_handler: Handler info: Library [/opt/CPshrd-R80.30/lib/libComUtils.so], Function offset [0x1a2e0]
  `

## Cause

CPSEMD restarts by cpwd before FWM responds, while FWM is busy.

## Solution

[Contact Check Point Support](https://www.checkpoint.com/support-services/contact-support/) to get a Hotfix for this issue.   
A Support Engineer will make sure the Hotfix is compatible with your environment before providing the Hotfix.   
For faster resolution and verification please collect [CPinfo](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk92739) files from the Security Management and Security Gateways involved in the case.

As a workaround:

1. Disable SME blade in the management object in the SmartConsole and install database.

2. Restart FWM, and open SmartConsole in order to check that login is working

3. The environment variable "CONTROLLED_INTERNAL_NETWORK_CALCULATION needs to be set.

   1. To add environment variable "CONTROLLED_INTERNAL_NETWORK_CALCULATION

      **`# export CONTROLLED_INTERNAL_NETWORK_CALCULATION=1`**

      **`# vi /opt/CPshrd-R80.30/tmp/.CPprofile.sh`**

      Add the following line at the end:

      **`"CONTROLLED_INTERNAL_NETWORK_CALCULATION=1 ; export CONTROLLED_INTERNAL_NETWORK_CALCULATION"`**
   2. Save and close the file.

   3. Verify the variable was added:

      **`# echo $CONTROLLED_INTERNAL_NETWORK_CALCULATION`**

      Make sure that the output is 1
   4. Restart CP services two times on Seurity Management servers.(perform it twice)

      **`# cpstop; cpstart `**
   5. Verify FWM process has the environment variable, run:

      **`cat /proc/<pid of fwm>/environ | grep CONTROLLED_INTERNAL_NETWORK_CALCULATION`**
4. Run the calculate-internal-network manually from the send_command utility

   **` # send_command -local`**
5. Wait until the line "send_command\>" will appear on the screen, and enter: "calculate_internal_network".

   For example: **`send_command> calculate_internal_network`**
6. Wait around 10 minutes until the procedure will finish, see these lines:

   `Sending Calculate Internal Network command.`

   `Calculate Internal Network command complete.`
7. Run: **`# quit`**

8. Make sure the file /var/tmp/internalNetworkSet was created:

   **`ls -l /var/tmp/internalNetworkSet`**
9. Enable SME blade in the SmartConsole and install database.

10. Check to see if the issue is resolved.

In case you use Internal network as source in your events, you need to run every night the command:

**`# send_command -local -o calculate_internal_network`**

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
