Page MenuHomePhabricator

update-interwiki-cache failed: <AttributeError> 'Namespace' object has no attribute 'force'
Closed, ResolvedPublic

Description

reedy@deploy1001:/srv/mediawiki-staging$ scap update-interwiki-cache 
           ___ ____
         ⎛   ⎛ ,----
          \  //==--'
     _//|,.·//==--'    ____________________________
    _OO≣=-  ︶ ᴹw ⎞_§ ______  ___\ ___\ ,\__ \/ __ \
   (∞)_, )  (     |  ______/__  \/ /__ / /_/ / /_/ /
     ¨--¨|| |- (  / ______\____/ \___/ \__^_/  .__/
         ««_/  «_/ jgs/bd808                /_/

Username for 'https://gerrit.wikimedia.org': reedy
Password for 'https://reedy@gerrit.wikimedia.org': 
remote: Processing changes: new: 1, refs: 1, done    
remote: 
remote: New Changes:
remote:   https://gerrit.wikimedia.org/r/438022 Updating interwiki cache
remote: 
Has your change merged yet? [y/N]: y
15:02:30 Copying to deploy1001.eqiad.wmnet from deploy1001.eqiad.wmnet
15:02:30 Started rsync common
15:02:30 Finished rsync common (duration: 00m 00s)
15:02:30 Started cache_git_info
15:02:44 Finished cache_git_info (duration: 00m 13s)
15:02:44 Started sync-masters
sync-masters: 100% (ok: 1; fail: 0; left: 0)                                    
15:02:53 Finished sync-masters (duration: 00m 09s)
15:02:53 Started sync-pull-masters
sync-pull-masters: 100% (ok: 1; fail: 0; left: 0)                               
15:02:55 Finished sync-pull-masters (duration: 00m 01s)
15:02:55 Unhandled error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/scap/cli.py", line 336, in run
    exit_status = app.main(app.extra_arguments)
  File "/srv/mediawiki-staging/scap/plugins/updateinterwikicache.py", line 19, in main
    return super(UpdateInterwikiCache, self).main(*extra_args)
  File "/usr/lib/python2.7/dist-packages/scap/main.py", line 686, in main
    return super(SyncFile, self).main(*extra_args)
  File "/usr/lib/python2.7/dist-packages/scap/main.py", line 75, in main
    if not self.arguments.force:
AttributeError: 'Namespace' object has no attribute 'force'
15:02:55 update-interwiki-cache failed: <AttributeError> 'Namespace' object has no attribute 'force'

Details

Related Gerrit Patches:
operations/mediawiki-config : masterScap: UpdateInterwikiCache fix subclassing

Event Timeline

Reedy created this task.Jun 7 2018, 3:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 7 2018, 3:03 PM

I think this is because UpdateInterwikiCache tries to use super().main but SyncFile.main has decorators that set up argparse things, which aren't getting called.

But I don't think we actually want them all, e.g. we don't want file for this. And message is getting set by the subclass. Easiest fix may be to just add @cli.argument('--force', action='store_true', help='Skip canary checks') to UpdateInterwikiCache.main.

Change 441571 had a related patch set uploaded (by Thcipriani; owner: Thcipriani):
[operations/mediawiki-config@master] Scap: UpdateInterwikiCache fix subclassing

https://gerrit.wikimedia.org/r/441571

Vvjjkkii renamed this task from update-interwiki-cache failed: <AttributeError> 'Namespace' object has no attribute 'force' to 1gbaaaaaaa.Jul 1 2018, 1:05 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from 1gbaaaaaaa to update-interwiki-cache failed: <AttributeError> 'Namespace' object has no attribute 'force'.Jul 2 2018, 3:10 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.

@Niharika and myself came across this issue today while doing T197549.

The logs provided were:

18:07:40 Copying to deploy1001.eqiad.wmnet from deploy1001.eqiad.wmnet
18:07:40 Started rsync common
18:07:40 Finished rsync common (duration: 00m 00s)
18:07:40 Started cache_git_info
18:07:46 Finished cache_git_info (duration: 00m 06s)
18:07:46 Started sync-masters
sync-masters: 100% (ok: 1; fail: 0; left: 0)                                    
18:08:03 Finished sync-masters (duration: 00m 16s)
18:08:03 Started sync-pull-masters
sync-pull-masters: 100% (ok: 1; fail: 0; left: 0)                               
18:08:05 Finished sync-pull-masters (duration: 00m 01s)
18:08:05 Unhandled error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/scap/cli.py", line 339, in run
    exit_status = app.main(app.extra_arguments)
  File "/srv/mediawiki-staging/scap/plugins/updateinterwikicache.py", line 19, in main
    return super(UpdateInterwikiCache, self).main(*extra_args)
  File "/usr/lib/python2.7/dist-packages/scap/main.py", line 667, in main
    return super(SyncFile, self).main(*extra_args)
  File "/usr/lib/python2.7/dist-packages/scap/main.py", line 74, in main
    if not self.arguments.force:
AttributeError: 'Namespace' object has no attribute 'force'
18:08:05 update-interwiki-cache failed: <AttributeError> 'Namespace' object has no attribute 'force'

I'd like to note however that the patch uploaded at https://gerrit.wikimedia.org/r/443476 takes as user email the address of deploy1001 in which the user is operating ($shellname@deploy1001.equiad.wmnet) instead of the normal user address here at Gerrit. Shall I file a Task for that one?

Change 441571 merged by jenkins-bot:
[operations/mediawiki-config@master] Scap: UpdateInterwikiCache fix subclassing

https://gerrit.wikimedia.org/r/441571

thcipriani closed this task as Resolved.Jul 11 2018, 12:13 AM
thcipriani claimed this task.
thcipriani added subscribers: 20after4, thcipriani.

Thanks to @20after4 for patch review, I think this should be resolved. Please reopen if problem persists.