When fixing T222529, Linker::userLink was changed to warn when called with an empty user name (change Id65bdf9666). Since then, the log has recorded numerous such warnings from several code paths ([[https://logstash.wikimedia.org/app/kibana#/dashboard/mediawiki-errors?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:'2019-05-25T11:17:39.776Z',mode:absolute,to:'2019-05-25T13:17:39.779Z'))&_a=(description:'',filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'logstash-*',key:type,negate:!f,type:phrase,value:mediawiki),query:(match:(type:(query:mediawiki,type:phrase)))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'logstash-*',key:level,negate:!t,params:!(INFO,DEBUG),type:phrases,value:'INFO,%20DEBUG'),query:(bool:(minimum_should_match:1,should:!((match_phrase:(level:INFO)),(match_phrase:(level:DEBUG)))))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'logstash-*',key:fatal_exception.message,negate:!t,type:phrase,value:'PHP%20Fatal%20Error:%20entire%20web%20request%20took%20longer'),query:(match:(fatal_exception.message:(query:'PHP%20Fatal%20Error:%20entire%20web%20request%20took%20longer',type:phrase)))),('$state':(store:appState),meta:(alias:!n,disabled:!t,index:'logstash-*',key:channel.raw,negate:!f,params:!(error,exception,fatal,jsonTruncated),type:phrases,value:'error,%20exception,%20fatal,%20jsonTruncated'),query:(bool:(minimum_should_match:1,should:!((match_phrase:(channel.raw:error)),(match_phrase:(channel.raw:exception)),(match_phrase:(channel.raw:fatal)),(match_phrase:(channel.raw:jsonTruncated)))))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'logstash-*',key:normalized_message.raw,negate:!f,type:phrase,value:'%5B%7Bexception_id%7D%5D%20%7Bexception_url%7D%20%20%20ErrorException%20from%20line%20309%20of%20%2Fsrv%2Fmediawiki%2Fphp-1.34.0-wmf.6%2Fincludes%2Fdebug%2FMWDebug.php:%20PHP%20Warning:%20Linker::userLink%20received%20an%20empty%20username.%20Are%20there%20database%20errors%20that%20need%20to%20be%20fixed%3F%20%5BCalled%20from%20Linker::'),query:(match:(normalized_message.raw:(query:'%5B%7Bexception_id%7D%5D%20%7Bexception_url%7D%20%20%20ErrorException%20from%20line%20309%20of%20%2Fsrv%2Fmediawiki%2Fphp-1.34.0-wmf.6%2Fincludes%2Fdebug%2FMWDebug.php:%20PHP%20Warning:%20Linker::userLink%20received%20an%20empty%20username.%20Are%20there%20database%20errors%20that%20need%20to%20be%20fixed%3F%20%5BCalled%20from%20Linker::',type:phrase))))),options:(darkTheme:!f),panels:!((col:7,id:Event-Level,panelIndex:3,row:3,size_x:3,size_y:3,type:visualization),(col:10,id:Top-Domains,panelIndex:5,row:6,size_x:3,size_y:3,type:visualization),(col:1,id:Trending-Messages,panelIndex:6,row:9,size_x:12,size_y:4,type:visualization),(col:10,id:MediaWiki-Versions,panelIndex:8,row:3,size_x:3,size_y:3,type:visualization),(col:1,id:Trending-Backtrace-File,panelIndex:10,row:13,size_x:12,size_y:3,type:visualization),(col:1,id:Top-Channels-table,panelIndex:11,row:3,size_x:6,size_y:3,type:visualization),(col:1,id:Top-Hosts-table,panelIndex:12,row:6,size_x:6,size_y:3,type:visualization),(col:7,id:Top-Wikis-table,panelIndex:13,row:6,size_x:3,size_y:3,type:visualization),(col:1,columns:!(level,channel,host,wiki,message),id:MediaWiki-Events-List,panelIndex:15,row:16,size_x:12,size_y:16,sort:!('@timestamp',desc),type:search),(col:1,id:Fatal-Events-Over-Time,panelIndex:16,row:1,size_x:12,size_y:2,type:visualization)),query:(query_string:(analyze_wildcard:!t,query:'%22Linker::userLink%22')),timeRestore:!t,title:mediawiki-errors,uiState:(P-10:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),P-11:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),P-12:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),P-13:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),P-16:(vis:(colors:(events:%237EB26D,exception:%23E24D42,fatal:%23BA43A9,phperror:%23EF843C))),P-3:(spy:(mode:(fill:!f,name:!n)),vis:(legendOpen:!f)),P-5:(spy:(mode:(fill:!f,name:!n)),vis:(legendOpen:!f,params:(sort:(columnIndex:!n,direction:!n)))),P-6:(spy:(mode:(fill:!f,name:!n)),vis:(params:(sort:(columnIndex:!n,direction:!n))))),viewMode:view)|see graphana]]). CodeSearch turns up [[https://codesearch.wmflabs.org/search/?q=Linker%3A%3AuserLink&i=nope&files=&repos=|over 80 usages]] that potentially have this problem.
The logs and callers need to be surveyed and any problematic calls fixed. From the logs, it seems to following two are the most problematic:
[ ] Linker::revUserTools calls $rev->getUserText( Revision::FOR_THIS_USER ) which will return an empty string if the user name is suppressed.
[ ] LogFormatter::makeUserLink seems to frequently get bogus User from getPerformerElement(), coming from LogEntry::getPerformer. (see also related {T224811}).
NOTE: the Logstash link will only function for 30 days, until June 25! New occurrences are not logged any more due to T224050 (change I93826e486951e9).