Page MenuHomePhabricator

Mail from cron regarding a failure of jsub
Closed, ResolvedPublic

Description

I am getting here a mail with the following body from cron daemon:

Traceback (most recent call last):

File "/usr/bin/jsub", line 684, in <module>
  main()
File "/usr/bin/jsub", line 594, in main
  touch(args.log_out, args.umask)
File "/usr/bin/jsub", line 280, in touch
  die("Failed to touch '%s': %e" % (path, e))

TypeError: float argument required, not exceptions.IOError

It seems that the error message itself has an error, so I do not see the reason causing this failure.

Event Timeline

The error was probably from the NFS outage, but the error reporting is obviously broken:

>>> try:
...     f = open('/dev/full', 'w'); f.write('a'); f.close();
... except Exception as t:
...     e = t
... 
>>> e
IOError(28, 'No space left on device')
>>> '%e' % e
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: float argument required, not exceptions.IOError
>>> '%r' % e
"IOError(28, 'No space left on device')"
>>> '%s' % e
'[Errno 28] No space left on device'

According to https://docs.python.org/2/library/stdtypes.html#string-formatting-operations, %s and %r are probably the only available conversion types for exceptions. I'd say the latter looks better.

Change 333232 had a related patch set uploaded (by Zhuyifei1999):
jsub: Change IOError string substitution conversion from '%e' to '%s'

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

Change 333232 merged by jenkins-bot:
jsub: Change IOError string substitution conversion from '%e' to '%s'

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

Mentioned in SAL (#wikimedia-labs) [2017-02-27T02:41:59Z] <scfc_de> Deployed jobtools and misctools 1.19/1.19~precise+1 (T155787, T156886).