Dealing with Broken Index

Skip to end of metadata
Go to start of metadata
Table of Contents

Overview

In rare cases it may happen that the underlying Jackrabbit index used by Artifactory would become broken. This can occur if the Artifactory VM is abruptly killed when write operations are done on the index, therefore it is recommended to always shutdown Artifactory gracefully. Another reason this might happen is lack of disk space or disk problems.

Typically, when the index is broken, you'd see warnings in the logs similar to this:

or:

Resolution

Should this happen, it is easy to fix the broken index by rebuilding a new healthy index. Follow these steps:

  1. After Artifactory is shut-down, move the $ARTIFACTORY_HOME/data/index folder aside.
  2. Restart Artifactory.
  3. Allow some time for re-indexing to complete - it may take more than a couple of minutes on a large repository and will delay the startup process until finished.

Consistency Fix

If you are still experiencing errors you may need to start Artifactory with consistency fix checks on -

For Artifactory 2.4.x and above

Remove the following file and restart Artifactory:

(warning) Make sure to let the Artifactory startup process finish with no interruption. This may take considerably longer when consistency fix is active.

There is no other operation required after startup has finished.

For Artifactory 2.3.x and below

Start Artifactory once with the VM parameter -Dartifactory.jcr.fixConsistency=true

You can do this by commenting-out/changing the artifactory.jcr.fixConsistency property in artifactory.system.properties, just don't leave this on permanently, as it will slow-down the startup process dramatically on each Artifactory restart.

Labels:
  1. Mar 24, 2010

    Rebuilding the index also solves Problems if you experience the following messages (while browsing the artifacts you get an Error message "Internal error occurred" in the Web GUI):

    [ERROR] (o.a.w.RequestCycle  :1502) - Error attaching this container for rendering: [MarkupContainer [Component id = nodePanel]]
    org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [MarkupContainer [Component id = nodePanel]]
    [...]
    Caused by: java.lang.IndexOutOfBoundsException: bitIndex < 0: -1
            at java.util.BitSet.get(BitSet.java:441) [na:1.6.0_16]
    [...]