GoogleIt Mail IT Print IT PermaLinkSNTT: An Agent To Diagnose A Nasty Problem
10:02:50 PM

It's been ages since I've posted anything for Show 'n Tell Thursday.


Yeah, I know... It's Tuesday. So sue me.


I think that in all the years I've been doing Lotus Notes and Domino, there has been one type of really nasty problem that has been the most difficult to diagnose. Even experienced experts occasionally slip up and cause the problem, and even teams of experts looking at the symptoms can easily be totally stumped. I recently solved the fourth recurrence of a problem that had been baffling members of my team for weeks, and this is no slouch team -- with more than 70 years of collective Notes/Domino experience. The root cause, that I finally did figure out, is exactly the type of problem that I'm talking about.


This type of problem can come and go without apparent explanation. That's what happened to us several times over the past few weeks. In one of the cases, faced with results that defied explanation for days, I actually came up with what appeared to be an explanation. It was a far-fetched explanation, but it at least had some grounding in experiences that I've had in Notes/Domino, so I was at least a little optimistic -- but when we tried deliberately to force conditions that would prove my explanation, we just couldn't make the problem occur! And besides, by the time we got to the point of testing my theory, the problem that we had been working on had gone away all by itself. Or so it seemed, until it came back again.


So, what was the problem? Before I tell you that, let me tell you what the symptom was.


We have a complex application, and key part of several of the agents in the application is code that does NotesDatabase.getDocumentByUnid() calls. It works like a charm, of course. This code has been shipping for a long time. We've been in the middle, however, of testing new code for a new version, and we've set up some challenging environments for those tests. When iterating from one build to the next, sometimes our code just stopped working in one of the test environments. The NotesDatabase.getDocumentByUnid() calls started returning "Invalid universal id". There were no ReaderNames fields. ACLs were correct. Groups in the Domino Directory were correct. Permissions in the Server Document were correct. Agent runtime settings were correct. Everything was double and triple-checked by mulitple sets of highly experienced eyes. Debugging code in the application was activated and bumped up to its highest level, and everything was working -- except the getDocumentByUnid. A document was opened in the database containing the agent.. A unid is read from a NotesItem in the document. The database where document pointed to by the unid lives was opened. But the getDocumentByUnid() call failed.


Much hair was pulled out. Tests were run. Databases were compacted and fixed up. The test environment was rebuilt, and everything started to work, but we're shipping a product and failures that have no explanation are not easily tolerated, even if we've worked around them. A Lotus support incident was opened. Yes... we were desperate for an explanation.


The diagnosis finally hit me when I was reviewing the results of some tests that one of our team members had done at the request of Lotus Support. These tests had worked while our code was failing. There were several differences between the tests and our production code. None of those differences seemed important, but I knew there had to be some difference that was significant, and I finally hit on it. When our code executed, the database was open, but it was the wrong database. The test code was using NotesSession.getDatabase(), but our code uses NotesDatabase.openByReplicaID(). We had more than one replica of the same database on the server, and the document with the unid we were looking for was in one replica, but NotesDatabase.openByReplicaID() was opening the other replica.


What makes this even more frustrating is that it isn't the first time I've been bitten by this problem. I've run into problems caused by multiple replicas of one database on a server several times over the years. Someone makes a "backup copy" of a database but keeps it inside the Domino\Data tree, and there you go. Behavior from that point on is unpredictable in several ways. The bad behavior that is most often seen is in replication with other servers, which can be baffling in its inconsistently freaky result; but code that accesses databases by replica ID is similiarly freaky, as our situation demonstrated. You just never know which replica of the database your code is going to hit. One agent runs and stores replica IDs and unids in documents, and another agent runs later and finds the database by replica ID but doesn't find the unid;.


Duplicate replicas are rare enough that you just don't think of it as an explanation automatically, but common enough that I suspect most 10+-year veterans of Notes/Domino have probably run into it at least once. And as evidenced by the man-hours that my team burned on it's maddeningly difficult to figure out when it happens.


So, what's to be done about this? No amount of reminding yourself "don't do it", is necessarily going to protect you from someone copying a directory full of databases to "make a backup" of the last release, or some such thing. Even very experienced developers and admins can slip up. Procedures that seem to be benign, and have not caused problems in the past, suddenly lead to utter chaos. My team's experience proves this. You can run the catalog task and look for duplicates by browsing through catalog.nsf -- but that's far from ideal. I've put in a request to Lotus to consider having the server generate warnings, but as of now Domino never warns you about this. A very simple agent, however, can detect duplicate replicas, wherever they are on your server. So that's what's to be done. That's what I've done, anyhow.


Here's the simple agent. It's just a few dozen lines of Java code. I considered naming it "Weirdness Detector", but settled on "Scan Replicas" instead. Download it, sign it, set the ACL and replicate it to your server, then run it via tell amgr run "scanreplicas.nsf" 'scan replicas'. It will print the filenames and and replica IDs of any duplicates to the console and to log.nsf, like this:


10/02/2007 10:05:10 PM Agent Manager: Agent printing: Duplicate Replica ID:
projects\webmail\test.nsf and projects\iris\webmail\test.nsf | 852565FD0075793B


As written, this agent won't solve the problem for you, but it can help you diagnose it -- if you know that weirdness is happening and you think to run it.


Detecting the problem before weirdness starts... that's the next step. Since duplicate replicas can be created any time by anyone with permissions or access to the server filesystem, it might be a good idea to modify the agent code to send out an email alert whenever it detects duplicates and schedule it to run hourly. That, however, is left as an exercise for the reader. At least for now.

This page has been accessed 764 times. .
Comments :v

1. Devin Olson10/03/2007 10:11:43 AM
Homepage: http://www.devinolson.net


Been there, done that, got the hat, and the shirt. And forgotten about it completely.

Thanks for reminding us all about this very sneaky problem.

Thanks also for the agent. It will help quite a bit.

-Devin.




2. Carol Anne10/03/2007 11:58:01 AM


Could you share what minimum version of N/D one needs to run the NSF? Thanks.




3. Richard Schwartz10/03/2007 02:28:11 PM
Homepage: http://www.rhs.com/poweroftheschwartz


I've only tested it on 7.x, but I can't think of anything that I've used that would be incompatible with 6, or maybe even 5.

-rich




4. Ulrick Krause10/04/2007 01:07:13 AM
Homepage: http://www.eknori.de


Richard,

thanks for this. Great tipp!




5. Kevin Pettitt10/11/2007 11:50:04 AM
Homepage: http://www.lotusguru.com


The OpenNTF project "DomainPatrol" has a reporting feature that will flag duplicate replicas. You'll have to run the scanner at least once to populate the database (basically with information from catalog.nsf), and run the report manually.

Haven't looked that closely, but I suspect it wouldn't take much to set up a scheduled agent based on this code to notify whenever a dupe is detected. I'm also wondering if there isn't a way to use event handlers somehow, perhaps as a way to trigger a scanning agent whenever a new database is added to the server. Of course, there may not be an "event" to handle if the database is added at the OS level. Some sort of hourly agent that isn't catalog.nsf dependent might be the best approach assuming you could keep any performance hit to a negligible level.




6. chenyingying10/17/2016 12:15:13 AM


http://www.seattleseahawksjerseys.us.com
http://www.canadagooseoutlet.eu.com
http://www.louisvuittonoutletdeals.us.com
http://www.uggbootsuk.com.co
http://www.raybansunglasses.me.uk
http://www.cheap--nfljerseys.us.com
http://www.bostoncelticsjerseys.com
http://www.giuseppe-zanotti.us
http://www.louisvuittonoutlet.net.co
http://www.jordan4.net
http://www.coachfactoryoutletclearances.us.com
http://www.tomsshoesuk.org.uk
http://www.louisvuittonparis.fr
http://www.pradahandbags.net
http://www.ralphlaurenoutletuk.in.net
http://www.cartierwatches.in.net
http://www.nike-rosherun.in.net
http://www.raybanoutlet.net.co
http://www.cincinnatibengalsjerseys.us.com
http://www.michaelkorsoutlet-onlinestore.us.com
http://www.adidasshoes.net
http://www.outlet-celine.com
http://www.uggsoutlet.de.com
http://www.jordan13.org
http://www.adidasoutletshoes.com
http://www.uggsbootsstore.com
http://www.canadagoosejackets.com.co
http://www.miamiheatjerseys.us.com
http://www.michaelkors--outlet.us.org
http://www.coachfactoryoutletonline.com.co
http://www.coachfactory-outlet.in.net
http://www.cheapoakleysunglasses.net.co
http://www.montblanc-pens.name
http://www.uggsoutlet.gr.com
http://www.michael-kors-handbags.us.org
http://www.clevelandcavaliersjerseys.us.com
http://www.ralphlauren-outlet.net.co
http://www.uggbootssale.de.com
http://www.pradaoutlet.net.co
http://timberland.officialfree.net
http://www.airmaxssale.com
http://www.canada-gooseoutlet.name
http://www.uggssale.com.co
http://www.louisvuitton.nom.co
http://www.nfljerseyswholesales.us
http://www.toryburch-outlet.in.net
http://www.louboutinshoessale.com
http://www.ugg-store.co.uk
http://www.nikeoutletstore.us.com
http://www.coachoutletstoreonlineclearances.com.co
http://www.gucci-outlet.name
http://www.ralphlaurenclearance.in.net
http://www.monclerjackets.com.co
http://www.raybanssunglasses.com.co
http://www.louisvuitton-discount.com
http://www.oakleyvaultoutlet.in.net
http://www.aididasyeezy.org.uk
http://www.cheapburberryoutlet.name
http://www.hermesbagusa.com
http://www.nike-airmaxpascher.fr
http://www.oklahomacitythunderjerseys.us.com
http://www.katespade-handbags.eu.com
http://www.adidas-yeezy.us.com
http://www.get-louisvuittonoutlet.com
http://www.uggcanada.in.net
http://www.newenglandpatriotsjerseys.us.com
http://www.christianlouboutinoutlet.com.co
http://www.coachoutletstoreonlineclearances.us.org
http://www.louisvuittonoutlet.de.com
http://www.burberry-outlet.com.co
http://www.coachfactoryoutletonlinesale.us.com
http://www.supra-shoes.net
http://www.raybansunglassess.com.co
http://www.ralphlaurenoutletonline.com.co
http://www.louis-vuittonoutlet.com.co
http://www.niketrainers.uk
http://www.authenticlouisvuittonhandbags.us.com
http://www.rayban-sunglasses.com.co
http://www.louis-vuittonoutlet.us.com
http://www.abercrombiekidsoutlet.name
http://www.true-religionoutlet.net.co
http://www.cheaprolexforsale.com
http://www.ralphlaurenuk.com.co
http://www.michaelhandbagsoutlet.us.com
http://www.michael-korsoutlets.eu.com
http://www.louisvuitton.me
http://www.kevindurantshoes.name
http://www.abercrombieoutletonline.cc
http://www.michaelkorsoutletforsale.com
http://www.jordansforsale.in.net
http://www.sunglassesoakley.com.co
http://www.coachcanadaoutlet.com.co
http://www.oakley-sunglasses.net.co
http://www.pittsburghsteelersjerseys.us.com
http://www.christianlouboutinsale.me.uk
http://www.adidassuperstar.name
http://ugg.uggsstore.eu
http://www.ralph-lauren.me.uk
http://www.lebronjames-shoes.net
http://www.canadagoose.de.com
chenyingying20161017




7. chenjinyan11/22/2016 02:59:00 AM
Homepage: http://


http://timberland.officialfree.net
http://timberlandboots.hugeoff.net
http://www.adidasoriginals.in.net
http://www.adidas.in.net
http://www.adidassuperstar.name
http://www.airjordan-pascher.fr
http://www.beatsbydrdresolo.us
http://www.celine-outlet.us
http://www.cheap-jordans.us.com
http://www.cheapjordansshoes.in.net
http://www.cheap--nfljerseys.us.com
http://www.cheapoakleysunglasses.net.co
http://www.cheaprolexwatches.name
http://www.christianlouboutin.name
http://www.christianlouboutinoff.us
http://www.christianlouboutinoutlet.com
http://www.louboutin.us.com
http://www.coachoutletstoreonlineclearances.us.com
http://www.edhardyclothing.in.net
http://www.ghdhairstraighteners.com.co
http://www.gucci-outlet.net.co
http://www.gucci-outlet.org
http://www.insanityworkout.cc
http://www.instylercurlingiron.com
http://www.jordan13.org
http://www.jordan3.net
http://www.jordan4.net
http://www.jordan6.net
http://www.jordan8.net
http://www.jordanconcords.net
http://www.jordanretro.name
http://www.cheapjordansshoes.us.com
http://www.kevindurantshoes.name
http://www.kobebryantshoes.name
http://www.kobeshoes.org
http://www.lebronjames-shoes.name
http://www.lebronjames-shoes.net
http://www.louboutinfemme-pascher.fr
http://www.louboutinshoes.cc
http://www.louisvuitton-handbags.com.co
http://www.louisvuittonlvoutlet.us.com
http://www.louis-vuittonoutlet.us.com
http://www.louis-vuittonoutlets.us.org
http://www.montblanc.com.co
http://www.montblanc-pens.name
http://www.nike-airmax.me.uk
http://www.nike-rosherun.in.net
http://www.outlet-celine.com
http://www.pandorajewelry.name
http://www.pandorajewelry.net.co
http://www.ralphlaurenpolo.in.net
http://www.raybansunglasses.uk
http://www.retrojordans.name
http://www.rolexwatchesoutlet.us
http://www.todsoutlet.in.net
http://www.toms-shoes.cc
http://www.true-religionjeans.us.org
http://www.truereligion-jeans.us
http://www.vansshoes.name
http://www.ralphlauren-outlet.net.co
http://www.michaelkorsoutletclearance.us.org
http://www.cheaprolexforsale.com
http://www.jordanshoes.us.org
http://www.michaelkorsoutlet-store.us.org
http://www.tomsshoes-outlet.com
http://www.basketballshoes.name
http://www.replicawatches.name
http://www.coachfactoryoutletmall.us.com
http://www.asicsshoes.name
http://www.outletsmichaelkors.us.com
http://www.tomswedges.us
http://www.rolexwatchesforsale.name
http://www.katespade.eu.com
http://www.designerhandbags.us.org
http://www.michael-korsbags.us.com
http://www.sunglassesoakley.com.co
http://www.cheapraybansunglasses.net.co
http://www.fitflopssaleclearance.us.org
http://www.coachclearance.us.com
http://www.tomssale.in.net
http://www.fitflops.org
http://www.cheaptoryburchoutlet.com
http://www.nfljerseyswholesales.us
http://www.raybansunglasses.me.uk
http://www.hollisterclothing.net
http://www.cheapjordansforsale.us
http://www.supra-shoes.net
http://www.truereligionjeans-outlet.us.com
http://www.rayban-sunglasses.com.co
http://www.oakley-sunglasses.net.co
http://www.oakleys-sunglasses.us.org
http://www.juicy-couture.us
http://www.louisvuittonofficial.us.com
http://www.truereligion.net.co
http://www.louisvuittonoutletstores.us
http://www.truereligion-jeans.com.co
http://www.north-faceoutlet.net.co
http://www.adidasoutletstore.net
http://www.adidasshoes.net
http://www.nikeoutletstore.us.com
http://www.coachfactoryoutlet-onlinestore.us.com
http://www.michaelkorsoutletcanada.com.co
http://www.oakleysunglassess.com.co
http://www.raybansunglassess.com.co
http://www.ray-ban-sunglasses.com.co
http://www.coachcanadaoutlet.com.co
http://www.coachfactoryoutletclearances.us.com
http://www.cheapoakleysunglassess.com.co
http://www.ralphlaurenoutletonline.in.net
http://www.hermesbagusa.com
http://www.burberryoutlet.in.net
http://www.raybansunglassesoutlet.net.co
http://www.michaelkorsuk.com.co
http://www.louboutinshoessale.com
http://www.abercrombieandfitchoutlet.in.net
http://www.abercrombieoutletonline.cc
http://www.hollistercoclothing.com
http://www.raybansonsale.com.co
http://www.tomsshoesuk.org.uk
http://www.authenticlouisvuittonhandbags.us.com
http://www.toms.us.org
http://www.ralphlaurenoutletuk.in.net
http://www.outletmichaelkorshandbags.us.com
http://www.longchamp.us.com
http://www.oakleyvaultoutlet.in.net
http://www.uggoutletsale.in.net
http://www.pandorajewelry.in.net
http://www.uggbootaustralia.us.com
http://www.ugg.eu.com
http://www.niketrainers.uk
http://www.canadagooseuk.uk
http://www.cheapuggboots.org.uk
http://www.uggslippers.com.co
http://www.uggsboots.us.org
http://www.canadagoosejacketsoutlet.us.com
http://www.cheapuggsboots.us.com
http://www.adidastrainers.uk
http://www.ugguk.me.uk
http://www.moncler.me.uk
http://www.monclerjacketsuk.me.uk
http://www.christianlouboutin-paris.fr
http://www.raybanpascher.fr
http://www.montblancpen.us.com
http://www.fitflopsuk.me.uk
http://www.nba-jerseys.us.com
http://www.longchamp-sac.fr
http://www.moncler--paris.fr
http://www.canadagoose-pascher.fr
http://www.newyorkknicksjerseys.us.com
http://www.newenglandpatriotsjerseys.us.com
http://www.cincinnatibengalsjerseys.us.com
http://www.uggboots-onsale.us.org
http://www.uggbootscheap.us.com
http://www.uggs.me.uk
http://www.curry3.name
http://www.mbt.us.com
http://www.adidasnmd-shoes.us.com
http://www.fitflops.us.com
http://www.rolexwatches.us.com
http://www.christianlouboutin-pas-cher.fr
http://www.nhljerseys.org
http://www.niketn-pascher.fr
http://www.louis-vuitton-borse.it
http://www.uggsaustralia.it
http://www.sanantoniospursjerseys.us.com
http://www.oklahomacitythunderjerseys.us.com
http://www.losangelesclippersjerseys.com
http://www.uggsbootsoutlet.us.org
http://www.thenorthface.net.co
http://www.canadagoose.com.co
http://www.adidas-yeezy.us.com
http://www.adidas-nmd.co.uk
http://www.christianlouboutinsale.me.uk
http://www.redbottoms.org.uk
http://www.timberlandboots.net.co
http://www.mlbjerseys.org
http://www.uggs-pascher.fr
http://www.monclerpascherhomme.fr
http://www.ugg-italia.it
http://www.seattleseahawksjerseys.us.com
http://www.minnesotavikingsjerseys.us.com
http://www.goldenstatewarriorsjerseys.us.com
http://www.washingtonwizardsjerseys.com
http://www.true-religion.me.uk
http://www.aididasyeezy.org.uk
http://www.ralphlaurenclearance.in.net
http://www.rosherun.org
http://www.ugg-boots.fr
http://www.uggbootsparis.fr
http://www.nike-airmaxpascher.fr
http://www.nike--rosherun.fr
http://www.louisvuittonparis.fr
http://www.jordanfemmepascher.fr
http://www.dallasmavericksjerseys.com
http://www.denverbroncosjerseys.us.com
http://www.pittsburghsteelersjerseys.us.com
http://www.tommyhilfigeroutlet.us.org
http://www.hogan-scarpe.it
http://www.bostoncelticsjerseys.com
http://www.clevelandcavaliersjerseys.us.com
http://www.miamiheatjerseys.us.com
http://www.chicagobullsjerseys.com
http://www.seattleseahawksjersey.us.com
http://www.clarisonic.com.co
http://www.louisvuittonoutletonlineshop.com
http://www.louisvuitton.de.com
http://www.louisvuitton.nom.co
http://www.louisvuitton.me
http://www.officialmichaelkorsoutlet.us.com
http://www.oakleysunglasses-outlet.com.co
http://www.pradahandbags.net
http://www.pradaoutlet.net.co
http://www.gucci--outlet.com.co
http://www.gucci.me.uk
http://oakley.sunglassesonline.us.com
http://www.canadagooseoutletsale.us.com
http://www.adidasyeezy350.us.com
http://www.oakleystore.com.co
http://www.cheapraybans.us.org
http://www.raybanssunglasses.com.co
http://www.coachfactoryoutlet-online.eu.com
http://www.louboutinshoesoutlet.co.uk
http://www.nikeoutletstores.us.com
http://www.michaelkors--outlet.com.co
http://www.uggoutletonline.in.net
http://www.raybanoutlet.net.co
http://www.louisvuitton-discount.com
http://www.uggbootscanada.ca
http://www.uggcheap.us.com
http://www.oakleysunglassescanada.ca
http://www.jordansforsale.in.net
http://www.michaelkorshandbagsonsale.com
http://www.airmaxssale.com
http://uggs.uggaustralia.qc.com
http://www.coachoutletstoreonlinesale.us.com
http://www.tiffanyandco.nom.co
http://www.katespadehandbagsoutlet.us.com
http://www.chanelbags.in.net
http://www.michaelkorsoutletstores.us.org
http://www.tiffanyandcojewelry.com.co
http://www.katespadeoutlets.us.com
http://www.gucci-outlet.in.net
http://www.poloralphlaurenukonline.co.uk
http://www.giuseppe-zanotti.us.com
http://www.louis-vuittonoutlet.eu.com
http://www.michaelkorsoutletofficial.us.com
http://www.gucci-inc.com
http://www.mulberryuk.org.uk
http://www.chaneloutlet.in.net
http://www.discountuggboots.us.com
http://www.uggaustralia.us.org
http://www.mcmbags.com.co
http://www.nikeoutlet-online.com
http://www.michael--korsoutlet.us.com
http://www.coachfactoryoutlet-online.us.org
http://www.coachoutletofficial.us.com
http://www.michaelkors--outlet.us.com
http://www.katespade-outlet.net.co
http://www.nikefactoryoutlet.org
http://www.tomsshoes.us.org
http://www.hollister.in.net
http://www.abercrombiefitch.us.com
http://www.ray-banssunglasses.com.co
http://www.northface.us.com
http://www.poloralph-lauren.us.org
http://www.hollister-uk.org.uk
http://www.prada.us.org
http://www.hilfigeroutlet.in.net
http://www.louis--vuitton.us.org
http://www.burberry-outletonline.com.co
http://www.uggsclearance.us.org
http://www.uggclassic.us.com
http://www.ugg-canada.ca
http://www.ugg-bootsuk.co.uk
http://www.ugg-outlet.ca
http://www.uggsuk.org.uk
http://www.uggoutlet.org
http://www.uggsoutletcheap.us.com
http://www.uggoutletdiscount.us.com
http://www.outletslouisvuitton.us.com
http://www.louisvuitton-outlet.ca
http://www.louisvuittonhandbagsoutlet.us.org
http://www.coachoutletcheap.us.com
http://www.outletcanadagoose.com.co
http://www.canadagoosecanada.com.co
http://www.gooseoutlet.us.com
http://www.outletcanadagoose.name
http://www.canadagoosecanada.us.org
http://www.louis-vuitton.me.uk
http://www.coachoutletonlinesale.eu.com
http://www.coachfactoryoutlet-stores.us.org
http://www.uggsoutlet-online.us.com
http://www.uggoutlet-stores.us.com
http://www.uggsoutletsale.us.com
http://www.outlet-uggboots.us.com
http://www.coachhandbagsnew.us.com
http://www.cheapuggssale.us.com
http://www.canadagooseca.us.com
201611.22chenjinyan




Enter Comments^


Email addresses provided are not made available on this site.





You can use UUB Code in your posts.

[b]bold[/b]  [i]italic[/i]  [u]underline[/u]  [s]strikethrough[/s]

URL's will be automatically converted to Links


:-x :cry: :laugh: :-( :cool: :huh: :-) :angry: :-D ;-) :-p :grin: :rolleyes: :-\ :emb: :lips: :-o
bold italic underline Strikethrough





Remember me    




About The Schwartz

rss.jpg


All opinions expressed here are my own, and do not represent positions of my employer.