Troubleshooting Hue restoration

An inaccessible Hue UI and a duplicate key error are issues you might encounter after attempting to manually restore Hue.

Inaccessible Hue UI

If the Hue UI is not accessible, try the following workarounds.

  1. Kill the Hue frontend pod, providing the Hue frontend pod ID, for example huefrontend-5bdc7bc7b8-8lpgj.
    $ kubectl get pods -n <new Virtual Warehouse ID> # the pod name
    
    $ kubectl delete pod <Hue frontend pod ID> -n <new Virtual Warehouse ID>
  2. Increase virtual warehouse memory if the database size is large.
    ## edit hue backend container to max 16GB (note: there are two containers:
    ## busybox and hue)
    
    $ kubectl edit sts huebackend -n <new Virtual Warehouse ID>

Duplicate key error

If you see the following duplicate key error, perform the steps below:

django.db.utils.IntegrityError: Problem installing fixture '/tmp/data.json': Could not load desktop.Document(pk=2): duplicate key value violates unique constraint "desktop_document_content_type_id_object_id_xyzxyz_uniq" DETAIL: Key (content_type_id, object_id)=(8, 6) already exists. 
This error likely occurs if you open Hue before completing the restoration and do not follow the prerequisite above not to open the Hue web interface.
  1. Connect to Hue pod on new Hive/Impala Virtual Warehouse cluster.
    $ kubectl exec -it huebackend-0 -n <new Virtual Warehouse ID> -c hue – /bin/bash
  2. Clean the Hue database by running this command from the hue pod:

    ./build/env/bin/hue flush

  3. Go to step 6 in Restoring Hue to attempt to load the data again.