Use case: Consistency check and fix takes days to complete some time, We can not afford this much down time.
Approach: There are different kind of inconsistencies like,
Orphaned child
Error message : NodeState CHILD_UUID references inexistent parent uuid PARENT_UUID
Current solution : restore entire backup
Parent referencing inexistent child
Error message : NodeState PARENT_UUID references inexistent child {}CHILD_NAME with id CHILD_UUID
Current solution : consistency check/fix should repair such issue Or if you know UUID then slective UUID check
and fix should resolve this issue.
Child referencing invalid parent
Error message : ChildNode has invalid parent uuid: INVALID_PARENT_UUID (instead of VALID_PARENT_UUID)
Current solution : Use CRX Console
Parent not referencing existing child
Error message : javax.jcr.ItemNotFoundException: failed to build path of CHILD_UUID: PARENT_UUID has no child
entry for CHILD_UUID
Current solution : Use CRX Console
Node already exists
Error message : javax.jcr.ItemExistsException: at
rm login.txt
curl -c login.txt "http://<host>:<port>/crx/login.jsp?UserId=admin&Password=admin"
rm progress.txt
curl -b login.txt -f -o progress.txt -d "type=traversal&traversalLogEach=true&fixInconsistencies=true&rootNode=/" "http://<host>:<port>/crx/config/check_frame.jsp"
Phase 2: Then You can use following program to find out all inconsistencies in log
- You can use attached file (Unzip files) to monitor your crx log (/logs/crx/error.log in CQ5.4 and /logs/error.log in CQ5.5) file and send an email in case something is wrong. To use this application
- Compile java file using javac -classpath .:mail.jar:activation.jar FindCorruption.java
- Create a cron Job that runs every hour to monitor your log file (For windows you can use service)
- Use following command to run command java -classpath .:mail.jar:activation.jar FindCorruption
- Make sure that You put all the files attached in same location Or change PROPERTY_FILE_LOCATION property in FindCorruption.java
- Configure your mail server and output folder location information in findCurruption.properties. For configuring email server please check http://dev.day.com/docs/en/cq/current/administering/notification.html
- What you expect is an email when program find corruption pattern in log. This also send you location of all files you need to quickly fix inconsistencies "that can be fixed by consistency check and fix"
You can modify this program to just scan logs and output instruction some where else.
Simple Java Program to find pattern can be found here
Note: This is just an example, You can write your own version using powerful parsing scripting languages to do same task. Again this is not supported by Adobe or by Me, Feel free to add your comment though of how it can be improved.
Hi,
ReplyDeletecan't see the pictures for "For CQ5.4 or CQ5.5". Please can you add them again?
In CQ5 I don't have "/crx/config/check_frame.jsp"
Regards,
Robert
CQ5.5
DeleteHello,
DeleteFor CQ5.5 you should use /system/console/repositorycheck
Yogesh