Page MenuHomePhabricator

exception raised for "sre.dns.admin show"
Closed, ResolvedPublic

Description

In the context of T378038 I looked at how to display the current pool status of all sites.

https://wikitech.wikimedia.org/wiki/DNS#Change_GeoDNS_/_Depool_a_Site mentions the command cookbook sre.dns.admin show for this.

When running this I noticed an exception is being raised:

[cumin2002:~] $ sudo cookbook sre.dns.admin show
=> CURRENT STATE:
text-addrs: pooled at all sites
text-next: pooled at all sites
upload-addrs: pooled at all sites
ncredir-addrs: pooled at all sites
Exception raised while initializing the Cookbook sre.dns.admin:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/spicerack/_menu.py", line 199, in run
    runner = self.instance.get_runner(args)
  File "/srv/deployment/spicerack/cookbooks/sre/dns/admin.py", line 47, in get_runner
    return DNSAdminRunner(args, self.spicerack)
  File "/srv/deployment/spicerack/cookbooks/sre/dns/admin.py", line 78, in __init__
    raise RuntimeError("show action called; outputting current admin_state. No changes were made.")
RuntimeError: show action called; outputting current admin_state. No changes were made.

Event Timeline

Thanks for filing this task! It's a known issue as documented in T365454#10179477 as well.

That being said and in the meantime, I am curious to hear if you have a suggestion on how to improve this text. One of the ideas I had was to print that this exception is expected and is not a cause for panic. The other of course (until fixed in Spicerack) was that we can move this to run() but that would mean that every show action is logged to IRC and I don't think that's ideal.

That being said and in the meantime, I am curious to hear if you have a suggestion on how to improve this text.

Here's my idea. Just change the docs to tell people to run the command with "2>/dev/null" for now.

Then either T378038 is resolved and we look up the state on this new place. (Maybe what generates the dashboard runs this same command to pull the info).

Or T365454 is resolved and we can move it back to normal. Whichever comes first.

[cumin2002:~] $ sudo cookbook sre.dns.admin show 2>/dev/null
=> CURRENT STATE:
text-addrs: pooled at all sites
text-next: pooled at all sites
upload-addrs: pooled at all sites
ncredir-addrs: pooled at all sites
Volans triaged this task as Medium priority.Oct 28 2024, 2:19 PM
ssingh claimed this task.
ssingh added a subscriber: Volans.

This has now been fixed, thanks to @Volans!

sukhe@cumin1002:~$ sudo cookbook sre.dns.admin show
=> CURRENT STATE:
text-addrs: pooled at all sites
text-next: pooled at all sites
upload-addrs: pooled at all sites
ncredir-addrs: pooled at all sites
show action called; outputting current admin_state. No changes were made.
sukhe@cumin1002:~$ echo $?
0