What to do if your archives are corrupt/ no worky
Question: I think my archive files are corrupted/broken, how can I fix them? I get an error rebuilding my site, how can I fix it?
Answer: There is probably some issue with your files that needs to be addressed. Here is a general process to recover your files/site.
-  Do a fresh install of GreyMatter somewhere and get it running. Make an test post and get your configurations as close to what you had before.
-  Copy over your original gm-authors.cgi and your original gm-templates.
-  Do a rebuild of your new files and see that your templates are applied correctly and then do another test post as one of the original authors.
-  Copy over your archive files (just the ones that end in .cgi, the html ones will be built by GM). Verify that the files names are sequention (i.e. that you have a 00000001.cgi upto the number of entries you have).
-  Delete the contents of your gm-counter.cgi and your gm-entrylist.cgi, but leave the files.
-  Do a Diagnostic and Repair and verify that your gm-counter file looks correct (the first number in the file should be your total entries count). Verify that gm-entrylist looks good (should have as many lines it as there are entries in the archives).
-  Do a rebuild all files.
Also, here is some good general advice
- Check ownership and permissions on the .cgi and .html files
- Check file system space
- Check the error_log on apache ( or your error log for whatever web server you are using).
- Check the GreyMatter log.
- Check if your archives directory, see if there is a certain number that the .html files stop at. This may give you a clue as to which entry is giving GreyMatter trouble.For example, if I had the files 00000001.cgi – 00000010.cgi and after rebuilding I only had files 00000001.html – 00000005.html, I would look at files 00000005.cgi and 00000006.cgi to see if there was a problem with the file. The file formats/layouts are detailed in the Gm Developer Documentation, available current release and on the download website.
- See if your files contain windows line endings. This can happen if the files are uploaded without explicitly specifying to upload the files as ‘ascii’ files. Some editors can show if there are bad characters in the files.
Discussion: GreyMatter may have issues with bad characters, but it does have a good ability to regenerate files that it needs such as gm-counter.cgi and gm-entrylist.cgi. Diagnostics and Repair on the Configuration screen is informative and an excellent place to start debugging when issues occur.