This is a regression tester for the mirrors serving reg.g-vo.org. It is intended to run from cron. Essentially, it will make cron send a mail to the cron-running user when something is wrong, an it will write an HTML file with some details. See http://vo.ari.uni-heidelberg.de/arivo/RegTAP for how this is deployed for the Heidelberg group. Hints on debugging ================== Even absent bugs/outages, etc., on our side, in a distributed system like the VO Registry there are always some problems that cause mirrors to diverge. Here, I'm collecting some things to help diagnose issues. This uses some shell scripts that come in this repo. (1) First, figure out who the registries think manages the authority of the problematic record:: $ whomanages xcatdb >>>>> Heidelberg ivo://esavo/registry >>>>> Potsdam >>>>>> Paris ivo://esavo/registry If, as above, the mirrors don't agree on who that is or see one as unmanaged, first fix that. Here, let's first see where the registry records for the publishing registry in question came from:: $ whenceandwhen "ivo://esavo/registry" >>>>> Heidelberg 2016-03-09T20:00:00 ivo://esavo/registry >>>>> Potsdam >>>>>> Paris 2016-03-09T20:00:00 ivo://esavo/registry Ok, so Potsdam didn't get that registry record. Which is weird. Let's see if the esavo currently spits out a record for itself (this assumes reg.g-vo.org works well enough to discover the publishing registry's access url:: $ getrecordoai ivo://esavo/registry ivo://esavo/registry In this case, the registry record came through just fine, no error messages. At this point one needs to ssh into the potsdam mirror to figure out what happened during the harvest of the eurovo registry. $ harveststatus ivo://esavo/registry >>>>> Heidelberg 2016-05-04T13:13:35.255965 2016-07-11T01:16:03.674269 >>>>> Potsdam 2016-05-19T02:44:28.718799 2016-07-11T14:31:05.384512 >>>>>> Paris 2016-06-02T01:36:47.097804 2016-07-11T01:16:32.846068 Hm -- perhaps there was a glitch on the eurovo registry on May 19th? At this point we need to ssh into the server; let's take the potsdam one here. The stuff that was harvested from the publishing registries is within /var/gavo/inputs/rr/data/ (authority of the registry!). So, let's see if we can make out a record for the registry:: $ cd /var/gavo/inputs/rr/data/esavo $ grep 'ivo://esavo/registry' *.oaixml (this is admittedly a bit brittle because of whitespace in the element content, but for this registry that's fine). In this case, that search was futile, which means that fairly clearly we got a bad response from esavo. Let's just reharvest (on the mirror):: $ cd /var/gavo/inputs/rr $ screen $ python bin/harvestRegistries.py -F '%esavo/registry%' && gavo imp q Depending on the size of the publishing registry this may take a while, hence the screen. (2) A fairly common thing to happen is registries dropping records without producing (suitable) status="deleted" records. The typical symptom is that the mirrors agree on ``whomanages``, and ``whenceandwhen`` has a relatively old harvesting date on one of them. Since it's unclear how much is amiss in such cases, one should just do a full re-harvest (see above). It'd still consider it a good idea to try to debug the problem and tell the operators something is amiss. (3) A good default thing to do to try and analyze a problem with inconsistent records is to first see where the record comes from and which registry it originated from:: $ whenceandwhen ivo://nasa.heasarc/skyview/wfc >>>>> Heidelberg 2011-06-14T00:00:00 ivo://nasa.heasarc/registry >>>>> Potsdam >>>>>> Paris and then see what the harvest status of the originating registry is:: $ harveststatus ivo://nasa.heasarc/registry >>>>> Heidelberg 2016-06-26T14:31:00.032078 2016-07-14T01:15:36.287957 >>>>> Potsdam 2016-05-19T02:48:26.531142 2016-07-13T14:31:08.264383 >>>>>> Paris -- so, at least for paris it's not surprisng that the record is missing. To see what's wrong when a mirror fails to harvest a registry, go there and do an immediate harvest:: $ cd /var/gavo/inputs/rr $ python bin/harvestRegistries.py -f 'ivo://nasa.heasarc/registry' Any messages would go to /var/gavo/logs/dcInfos. In this case, there was nothing of note. The next step is to try and process any new files harvested:: $ gavo imp q -- which in this case did nothing at all. At this point one should check what was actually harvested; the files are in ``data/authority-of-the registry``:: $ ls data/nasa.heasarc In this particular case, there was nothing there, and further investigation in rr.resource showed that the the publishing registry in question just had moved. Sigh. A:: $ python bin/harvestRofR.py $ python bin/harvestRegistries.py fixed this particular problem (as would have just waiting). (4) If there's stuff in the data directory, try to locate the OAI response that contains the identifier in question:: $ cd data/nasa.heasarc $ grep "ivo://nasa.heasarc/skyview/wfc" *.oaixml 20160714132452.oaixml:ivo://nasa.heasarc/skyview/wfc 20160714132452.oaixml: ivo://nasa.heasarc/skyview/wfc 20160714132452.oaixml:ivo://nasa.heasarc/skyview/wfcf1 20160714132452.oaixml: ivo://nasa.heasarc/skyview/wfcf1 So -- something is there (note that there are two different ivoids in there). Going to the actual record, I found that while the oai header of the wfc record doesn't say a thing of this being deleted, these people set Resource/status to deleted. Which is a big pain but not even forbidden. Here, the difference resulted from the Heidelberg mirror haveing parsed the respective files with an old software version that didn't take Resource/status into account. Once could just re-harvest the respective registry; an alternative is to mark the respective OAI as unread and parse them again:: $ psql gavo -c "delete from rr.imported where path like '%nasa.heasarc%'" $ gavo imp q