Adding or loading tables seems to fail after instance upgrade (NoSuchMethodError)

Having upgraded a Data Gate instance, you receive an error message in the Data Gate main window, which indicates an add-table or load-table failure. The error message is in fact a false error message; all selected tables have been added or loaded properly. To keep the false error message from reappearing, follow the steps in this section.

Symptoms

An error window in the Cloud Pak for Data main window shows a message similar to the following:
Error Handler dispatch failed: java.lang.NoSuchMethodError: 
com/fasterxml/jackson/core/util/BufferRecycler.releaseToPool()V 
(loaded from file:
/head/clone-api/work/jetty-0_0_0_0-8188-clone-api_war-_clone_system-any-/webapp/WEB-INF/lib/jackson- 
core-2.15.4.jar by WebAppClassLoader{clone-api}@6adc203b) 
called from class com.fasterxml.jackson.databind.ObjectMapper 
(loaded from file:/head/clone-api/work/jetty-0_0_0_0-8188-clone-api_war-_clone_system-any-/webapp/WEB-INF/lib/jackson- 
databind-2.18.2.jar by WebAppClassLoader{clone-api}@6adc203b).

Causes

The message is caused by the jackson-databind dependency, which has not been properly updated during the upgrade. It does not indicate a real add or load failure.

Resolving the problem

To keep this message from reappearing in the future, complete these steps:

  1. Open a shell in the data-gate-api container of the Data Gate pod:
    oc exec -it -c data-gate-api ${DG_POD_ID} -- bash
    
    
    where the value of DG_POD_ID can be determined as follows:
    1. Determine the ID of the Data Gate instance you want to upgrade by running the oc get dginstance command, as in this example:
      oc get dginstance -n ${PROJECT_CPD_INST_OPERANDS}
      NAME                 VERSION   BUILD      STATUS      RECONCILED   AGE
      dg1699914520773847   5.0.0     5.0.0.82   Completed   5.0.0        6h58m

      The instance ID in this example is dg1699914520773847.

    2. Determine the ID of the Data Gate instance's server pod by running the following command:
      
      DG_POD_ID=$(oc get pod -l icpdsupport/app=dg-instance-server,\
      icpdsupport/serviceInstanceId=`echo ${DG_INSTANCE_ID} | 
      sed 's/^dg//'` -o jsonpath='{.items[0].metadata.name}')
      where DG_INSTANCE_ID is the instance ID you identified in step 1.a.
  2. Remove the .JETTY.INITIALIZED file inside the data-gate-api container:
    rm /head/clone-api/.JETTY.INITIALIZED
  3. Delete the pod:
    oc delete pod ${DG_POD_ID}

    where DG_POD_ID is the pod ID you identified in step 1.b.

  4. The pod is re-created and restarts automatically. Wait until the pod is running again.
Verifying the fix:
  1. Open a shell in the data-gate-api container of the restarted Data Gate pod:
    oc exec -it -c data-gate-api ${DG_POD_ID} -- bash
    
    

    For the value of DG_POD_ID, see step 1.b.

  2. List the affected libraries:
    ls -la /head/clone-api/work/jetty-0_0_0_0-8188-clone-api_war-_clone_system-any-/webapp/WEB-INF/lib/jackson*
  3. Verify that the correct versions are shown.
  4. Retry the operation that was seemingly failing before.