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

# sk117539 - "Internal error in a hook script: fw1/bin/hook_fw1_wrapper_HOTFIX_R80.10" during upgrade of Management Server from R80 to R80.10 using CPUSE

| Property | Value |
|----------|-------|
| Solution ID | sk117539 |
| Date Created | 2017-05-22 |
| Last Modified | 2025-02-13 |
| Technical Level | General |
| Products | Security Management Server, Multi-Domain Security Management Server |
| Versions | R82.10, R82, R81.20, R82.20 |
| OS | Gaia |

## Solution

### Introduction

This article describes different scenarios when upgrade of a Management Server from R80 to R80.10 using CPUSE fails with  
"***Internal error in a hook script: fw1/bin/hook_fw1_wrapper_HOTFIX_R80.10***" error.

`Security Gateway / Security Management R80.10 - Failed on installation:`  
` Internal error in a hook script: fw1/bin/hook_fw1_wrapper_HOTFIX_R80.10. Contact CheckPoint Technical Services for further assistance.`

*Example* :  
[![](https://sc1.checkpoint.com/sc/SolutionsStatics/sk117539/Error.png)](https://sc1.checkpoint.com/sc/SolutionsStatics/sk117539/Error.png "Click the image to see it in full size in a new tab/window")

Each Scenario has its own cause and solution.  
See the Table of Contents below.

This is "in place" upgrade that runs on same machine. The installation process replacing binaries and running some script called "schema_changes.sh". This script performs 99% of whole upgrade including direct Postgre / Solr operations and running upgrade code. After that server restarts. If "schema_changes" fails in the middle (all actions are roll backed) - server restarts in any way and now we have binaries of r80.10 that trying to cooperate with database of r80. Therefore server unable to startup with most general exception: "java.lang.ClassCastException: \[Ljava.lang.Long; incompatible with java.lang.Integer". But this exception just says us that upgrade was failed and we still don't know why. Therefore in order to find the real cause of upgrade failure we need go from the end of cpm.elg till closest "stars row" and see what exception was just before this row. This is the real exception that point us to real upgrade problem. In this specific case there were several attempts to restart the server and therefore we have several similar exceptions from the end: "java.lang.ClassCastException: \[Ljava.lang.Long; incompatible with java.lang.Integer" and only after that I've found "security zone" exception.

**Table of Contents:**

* Scenario 1 - Upgrade of Secondary Management Server
* Scenario 2 - Multiple duplicated documents in the Solr database and wrong value of the "`securitydefined`" parameter in the database
* Scenario 3 - Upgrade of Multi-Domain Security Management Server
* Important Notes
* Related documents
* Related solutions

Show the Entire Article

### Scenario 1 - Upgrade of Secondary Management Server {#Scenario 1}

**Symptoms:**

* Upgrade of Secondary Management Server from R80 to R80.10 using CPUSE fails with "*Internal error in a hook script: fw1/bin/hook_fw1_wrapper_HOTFIX_R80.10*" error

Show / Hide solution  
**Additional Symptoms:**

* */opt/CPInstLog/DeploymentAgent.log* file on R80 Management Server shows:

  ` [DATE - TIME][HIGH MSG_ABOUT_TO_DOWNLOAD]: Starting to download R80.10 Gaia Software Updates Package for R80 `  
  ` ...`  
  ` [DATE - TIME][HIGH MSG_DOWNLOAD_SUCCESS]: Package R80.10 Gaia Software Updates Package for R80 was downloaded successfully.`  
  ` ...`  
  ` [DATE - TIME][HIGH DALOG_NORMAL]: Moving package Check_Point_R80.10_T421_FULL.tgz from pending install queue to install queue.`  
  ` ...`  
  ` [DATE - TIME][HIGH DALOG_NORMAL]: About to install: Check_Point_R80.10_T421_FULL.tgz. Log file: /opt/CPInstLog//install_CPUpdates_BUNDLE_R80_10_T421.log`  
  ` ...`  
  ` [DATE - TIME][HIGH MSG_INSTALL_ERROR_HOOK_SCRIPT_INTERNAL]: Install of package Check_Point_R80.10_T421_FULL.tgz Failed`  
  ` [DATE - TIME]: client url=https://gwevents.checkpoint.com/gwstats/services/ping/1_0_0/log`  
  ` proxy=(null)`  
  ` data=<?xml version="1.0" ?>`  
  ` <request>`  
  ` <!-- User information -->`  
  ` <...`  
  ` <configuration>`***SecondaryMGMT*** `</configuration>`  
  ` <...`  
  ` <!-- Operation information -->`  
  ` <operation name="Install" pkgName="CPUpdates" pkgKey="CheckPoint#CPUpdates#All#6.0#4#8#BUNDLE_R80_10_T421" size="1819397368" status="Failed" duration="XXX" last_error="Internal error in a hook script: . Contact Check Point Technical Services for further assistance." timestamp="XXX" installed_hfs="" last_error_code="MSG_INSTALL_ERROR_HOOK_SCRIPT_INTERNAL" last_error_category="HOOKS" />`  
  ` </request> `
* */opt/CPInstLog/install_CPUpdates_BUNDLE_R80_10_T421.log* file on R80 Management Server shows:

  `[DATE - TIME]: Starting install of Check_Point_R80.10_T421_FULL.tgz`  
  ` ...`  
  ` [DATE - TIME]: Installing fw1_wrapper_HOTFIX_R80_10_GA_FULL.tgz`  
  ` ...`  
  ` [DATE - TIME]: Log file: /opt/CPInstLog//install_fw1_HOTFIX_R80_10.log Package name: fw1 Hotfix ID: HOTFIX_R80_10 `  
  ` ... `  
  ` [DATE - TIME]: MESSAGE_INITIATING_INSTALL /var/log/tmp/bundle_tmpdir_CheckPoint#CPUpdates#All#6.0#4#8#BUNDLE_R80_10_T421_.../fw1/fw1_wrapper_HOTFIX_R80_10_GA_FULL.tgz `  
  ` [DATE - TIME]: DIFFINST_DoCompleteInstall`  
  ` [DATE - TIME]: Run complete, return value: 37`
* */opt/CPInstLog/install_fw1_HOTFIX_R80_10.log* file on R80 Management Server shows:

  `[DATE - TIME]: PostInstallation RC=37`  
  ` [DATE - TIME]: Failed on PostInstallation`  
  ` ...`  
  ` [DATE - TIME]: DIFFINST_DoCompleteInstall ret: 37`

**Issue:**

* 02520084
* 02449460

**Solution:**
> This problem was fixed. The fix is included in:
>
> * [Check Point R80.10](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk111841) - starting from Take 462 released on January 18th, 2018
> * [R80.20.M1 Management Feature Release](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk123473)
>
> If you wish not to install this GA replacement:
>
> **Install the [Jumbo HFA R80.10](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk116380) (Take 7 and above) on the Primary server**
>
> * Re-Install the Secondary machine with R80.10 GA
> * Install R80.10 JHF on the Secondary server
> * Establish SIC between peers and perform HA sync from the primary to secondary
>
> **Without [R80.10 Jumbo HFA](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk116380) installed on the Primary** - Follow these ***workaround*** steps:
>
> 1. Perform a clean install of the R80.10 Secondary Security Management Server.
>
>    The R80.10 Secondary Security Management Server must be installed in the same way  
>    as the R80.10 Primary Security Management Server was installed. Otherwise, **sync operation will fail**.
>
>    If, for example, the R80.10 Primary Server was installed as follows:
>    1. R80 GA
>    2. R80 Jumbo Hotfix Accumulator
>    3. Upgraded to R80.10
>
>    Then the same software path must be followed on the R80.10 Secondary Server:
>    1. Disconnect this Secondary Server from the Primary Server
>    2. Install R80 GA
>    3. In the First Time Configuration Wizard, configure this machine as Secondary Security Management Server
>    4. Install R80 Jumbo Hotfix Accumulator
>    5. Upgrade to R80.10
>    6. Connect this Secondary Server to the Primary Server
> 2. Connect with SmartConsole to the R80.10 Primary Security Management Server.
>
> 3. Create the R80.10 Secondary Security Management Server object and establish SIC.
>
> 4. Synchronize the configuration from the Primary Server to the Secondary Server:
>
>    Go to the main *Application Menu* - click on the *High availability...*

### Scenario 2 - Multiple duplicated documents in the Solr database and wrong value of the "`securitydefined`" parameter in the database {#Scenario 2}

**Symptoms:**

* Upgrade of Management Server from R80 to R80.10 using CPUSE fails with "*Internal error in a hook script: fw1/bin/hook_fw1_wrapper_HOTFIX_R80.10*" error

Show / Hide solution  
**Additional Symptoms:**

* */opt/CPInstLog/last_HFA_hook.elg* file on R80 Management Server shows:

  `Creating requried /usr/lib/ soft links`  
  ` `**Running hook of fw1 R80.10 Failed.**
* */opt/CPInstLog/hook_fw1_wrapper_HOTFIX_R80_10.log* file on R80 Management Server shows:

  `Operation finished with errors Check logs in: /log/cpm.elg and /opt/CPsuite-R80/fw1/log/cpm.elg`
* *$FWDIR/log/cpm.elg* file on R80 Management Server shows:

  `ERROR internal.operation.OperationSvcImpl [main]: caught exception "`**Cannot have more than one GatewayAggregator <NAME_OF_GW_OBJECT> with the same Gateway.objId**` XXX-XXX-XXX-XXX-XXX" from class com.checkpoint.infrastructure.utils.runtime.CpAssertionError`
* *$FWDIR/log/cpm.elg* file on R80 Management Server shows:

  `ERROR coresvc.internal.ValidationsSvcImpl [main]: severity of validation error [ValidationIncident{incidentType='OBJECT'{validationDisplayName='Unknown'{blade='null' {validationName='NotEmptyByFieldValidation', severity=BLOCKING_ERROR, message='`**Security Zone: specific security zone must be defined** `', validationContext=[FieldValidationContext{validatedO bjId='XXX-XXX-XXX-XXX-XXX'{fieldName='securityZoneSettings.null'}]}] is above the allowed level WARNING. Update is aborted! `  

  ` ERROR internal.operation.OperationSvcImpl [main]: caught exception "`**A blocking validation error was found: Security Zone: specific security zone must be defined**`" from class com.checkpoint.management.coresvc.ValidationException`

**Causes:**

* Multiple duplicated documents in the internal Solr database on R80 Management Server.

  *Example*:
  1. Query from Postgres:

     `[Expert@HostName:0]# psql_client cpm postgres`

     `cpm=# select name, deleted from dleobjectderef_data where objid = '1c5bd1d4-ea26-442b-8088-6ecfe39f9f64';`

     Result:

     ```
          name      | deleted
     ---------------+---------
      FW-1          | f
     (1 row)
     ```

  2. In another shell:

     `[Expert@HostName:0]# ./cpm.sh -solr -q objId:1c5bd1d4-ea26-442b-8088-6ecfe39f9f64 -fl objid,name__s,deleted,fromVersion__i,toVersion__i_nd`

     Results - two Solr documents with the same "objid" and the same "to_version" field:

     ` SolrDocument{name__s=FW-1, deleted=false, toVersion__i_nd=2147483647, [shard]=http://127.0.0.1:8983/solr/cpm_0_A}`  
     ` SolrDocument{name__s=FW-1, deleted=false, toVersion__i_nd=2147483647, [shard]=http://127.0.0.1:8983/solr/cpm_0_A} `
* Wrong value of the "`securitydefined`" parameter in the database (value "`t`" instead of "`f`") on R80 Management Server.

  *Example*:
  1. Query from Postgres:

     `[Expert@HostName:0]# psql_client cpm postgres`

     `cpm=# select name, objclass from dleobjectderef_data where objid = '2210dd89-122a-4e4e-b460-124430d5911f';`

     Result:

     ```
      name |                           objclass
     ------+--------------------------------------------------------------
      eth0 | com.checkpoint.management.cdm.objects.network.GatewayNetwork
     (1 row)
     ```

     `cpm=# select securityzonesettings_objid from jt_gateway_network_security_zone_settings_data where gatewaynetwork_objid = '2210dd89-122a-4e4e-b460-124430d5911f';`

     Result:

     ```
           securityzonesettings_objid
     --------------------------------------
      0ba36ff6-64b5-4521-ac98-8188a69b809b
     (1 row)
     ```

  2. `[Expert@HostName:0]# ./cpm.sh -solr -q objId:1c5bd1d4-ea26-442b-8088-6ecfe39f9f64 -fl objid,name__s,deleted,fromVersion__i,toVersion__i_nd`

     Results - two Solr documents with the same "objid" and the same "to_version" field:
     ` SolrDocument{name__s=FW-1, deleted=false, toVersion__i_nd=2147483647, [shard]=http://127.0.0.1:8983/solr/cpm_0_A}`  
     ` SolrDocument{name__s=FW-1, deleted=false, toVersion__i_nd=2147483647, [shard]=http://127.0.0.1:8983/solr/cpm_0_A} `
  3. `cpm=# \x`

     Result:
     `Expanded display is on.`
  4. `cpm=# select * from securityzonesettings_data where objid = '0ba36ff6-64b5-4521-ac98-8188a69b809b' and dlesession=0 and deleted=false;`

     Result:

     ```
     -[ RECORD 1 ]---------------+-------------------------------------
     objid                       | 0ba36ff6-64b5-4521-ac98-8188a69b809b
     calculatedsecurityzone      | 237a4cbc-7fb6-4d50-872a-4904468271c4
     checkpointobjid             |
     dlesession                  | 0
     domainid                    | 41e821a0-3720-11e3-aa6e-0800200c9fde
     folder                      | a2b435ae-6205-48ec-99eb-bd2909027d4d
     permissionprimitivepresetid | a0e13233-1a25-6fd7-b130-1dd25f85596a
     readprimitiveid             |
     securitydefined             | t
     securityzonename            | ExternalZone
     specificsecurityzone        |
     type                        | 0
     opid                        | 850194
     fromversion                 | 20
     toversion                   | 2147483647
     editingsession              | -1
     deleted                     | f
     ```

     The "`securitydefined`" field has default value "`f`" and was intended only for R80 Security Gateways (which were never released). Different value from the default in this field is the root cause (this value was changed in some way - most probably, was modified manually directly in the database).

**Solution:**
> 1. Connect to the command line on the R80 Security Management Server.
>
> 2. Log in to the Expert mode.
>
> 3. Connect to the Postgres:
>
>    *\[Expert@HostName:0\]# psql_client cpm postgres*
> 4. Disable the Security Zone:
>
>    *cpm=# alter table securityzonesettings_data disable trigger all;*
> 5. Change the value of the "`securitydefined`" pameter from "`t`" to "`f`":
>
>    *cpm=# update securityzonesettings_data set securitydefined='f' where securitydefined='t' and dlesession = 0 and not deleted;*
> 6. Enable the Security Zone:
>
>    *cpm=# alter table securityzonesettings_data enable trigger all;*
> 7. Exit from the Postgres:
>
>    *cpm=# \\q*
> 8. Run the script from [sk116056 - Duplicate objects, IPS profiles, policies are displayed in R80 / R80.10 SmartConsole](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk116056)
>
> 9. Try to upgrade again.

### Scenario 3 - Upgrade of Multi-Domain Security Management Server {#Scenario 3}

**Symptoms:**

* Upgrade of Multi-Domain Security Management Server from R80 to R80.10 using CPUSE fails with "*Internal error in a hook script: fw1/bin/hook_fw1_wrapper_HOTFIX_R80.10*" error

Show / Hide solution  
**Additional Symptoms:**

* *$FWDIR/log/cpm.elg* file on R80 Multi-Domain Security Management Server shows:

  `[DATE TIME PID] ERROR coresvc.internal.WorkSessionMgmtSvcImpl [main]: Tried to get a non existing session XXX-XXX-XXX-XXX-XXX, Couldn't find it in database`  
  ` [DATE TIME PID] INFO coresvc.internal.TransactionRetrySvcImpl [main]: execution(void com.checkpoint.management.mgmt_blade.coresvc.SessionAggregatorSvcImpl.getWorkSession (SessionAggregator)) created a new nested transaction`  
  ` .....`  
  ` [DATE TIME PID] ERROR coresvc.internal.DleServerInitializerBean [main]: Invocation of com.checkpoint.management.mgmt_blade.coresvc.SessionAggregatorSvcImpl.handleSessionAggregatorsOnStartup failed (null) java.lang.reflect.InvocationTargetException`  
  ` [DATE TIME PID] INFO mgmt_blade.coresvc.SessionAggregatorSvcImpl [main]: SessionAggregator SessionAggregator{name='', adminId=YYY-YYY-YYY-YYY-YYY, adminName='XXXXX', adminEmail='', adminPhoneNumber='', sessionDomainId=ZZZ-ZZZ-ZZZ-ZZZ-ZZZ, sessionDomainName='NNN', workSessionId=XXX-XXX-XXX-XXX-XXX, workSessionState=OPEN, numberOfLocks=0, numberOfOperations=0, workSessionName='null', workSessionDescription='null', clientSessionId='null', applicationName='SmartConsole', connectedFrom='null', clientConnected=false, internal=false, holdsSdbLock=false, connectionMode=READ_WRITE, loginTime=TIMESTAMP, logoutTime=TIMESTAMP, lastConnectedClientSessionId='AAA-AAA-AAA-AAA-AAA'} com.checkpoint.objects.SessionAggregator objId=BBB-BBB-BBB-BBB-BBB-BBB domain=CCC-CCC-CCC-CCC-CCC doesn't have a worksessionId XXX-XXX-XXX-XXX-XXX in DB. Clean it..........`  
  ` .........`  
  ` Caused by: java.lang.IllegalArgumentException: Folder object not found for id = DDD-DDD-DDD-DDD-DDD , and domainId = CCC-CCC-CCC-CCC-CCC`  
  ` ......... `

**Cause:**
> * Session aggregators objects in Solr point to deleted work sessions objects in Postgres.

**Solution:**
> 1. [Contact Check Point Support](http://www.checkpoint.com/services/contact/index.html) to get a Hotfix (script file) 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) file from the Multi-Domain Security Management Server involved in the case.
>
> 2. Transfer the received script file *delete_session_agg_of_deleted_worksessions.groovy* to the *$MDS_FWDIR/scripts* directory on the Multi-Domain Security Management Server.
>
> 3. Just in case, convert the script from DOS to UNIX format:
>
>    *\[Expert@HostName:0\]# dos2unix $MDS_FWDIR/scripts/delete_session_agg_of_deleted_worksessions.groovy*
> 4. Execute the script:
>
>    *\[Expert@HostName:0\]# $MDS_FWDIR/scripts/run_groovy_script.sh $MDS_FWDIR/scripts/delete_session_agg_of_deleted_worksessions.groovy*

**Important Notes:**

* In case the script runs successfully, but does not resolve the issue, there are corrupted records in Postgres. To resolve, contact [Check Point Support](http://www.checkpoint.com/services/contact/index.html).

### Important Notes {#Important Notes}

* There is ***no*** Advanced Database Migration upgrade (migrate export) from R80 to R80.10.

### Related documents {#Related documents}

* Release Notes ([R80](http://downloads.checkpoint.com/dc/download.htm?ID=46538), [R80.10](http://downloads.checkpoint.com/dc/download.htm?ID=54802))
* Installation and Upgrade Guide ([R80](http://downloads.checkpoint.com/dc/download.htm?ID=46530), [R80.10](http://downloads.checkpoint.com/dc/download.htm?ID=54829))
* Security Management Server Administration Guide ([R80](http://downloads.checkpoint.com/dc/download.htm?ID=46534) / [R80](http://downloads.checkpoint.com/dc/download.htm?ID=46535), [R80.10](http://downloads.checkpoint.com/dc/download.htm?ID=54842))
* Gaia Administration Guide ([R80.10](http://downloads.checkpoint.com/dc/download.htm?ID=54824))

### Related solutions {#Related solutions}

* [sk117237 - R80.10 Pre-Upgrade Verifier notifications and their solutions](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk117237)
* [sk117159 - Upgrade to R80.10 is blocked due to Pre-Upgrade Verification](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk117159)
* [sk116056 - Duplicate objects, IPS profiles, policies are displayed in R80 / R80.10 SmartConsole](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk116056)
* [sk114933 - How to promote the Secondary Management server to become the Primary server](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk114933)

---

# 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
