Skip to content

(python logger) TypeError: not all arguments converted during string formatting #23

Open
@leoj3n

Description

@leoj3n

The log.error function in manage.py:

log = logging.getLogger('manage.py')

Seems to be throwing errors of its own:

2019-04-26T06:31:09.2507594Z Traceback (most recent call last):
2019-04-26T06:31:09.2508644Z   File "/usr/lib/python2.7/logging/__init__.py", line 861, in emit
2019-04-26T06:31:09.2515852Z     msg = self.format(record)
2019-04-26T06:31:09.2523519Z   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2019-04-26T06:31:09.2535172Z     return fmt.format(record)
2019-04-26T06:31:09.2544375Z   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2019-04-26T06:31:09.2555912Z     record.message = record.getMessage()
2019-04-26T06:31:09.2562774Z   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2019-04-26T06:31:09.2570721Z     msg = msg % self.args
2019-04-26T06:31:09.2590664Z TypeError: not all arguments converted during string formatting
2019-04-26T06:31:09.2597323Z Logged from file manage.py, line 126

log.error(e, 'unable to get primary status while shuting down')

2019-04-26T06:31:20.5227903Z Traceback (most recent call last):
2019-04-26T06:31:20.5231264Z   File "/usr/lib/python2.7/logging/__init__.py", line 861, in emit
2019-04-26T06:31:20.5240031Z     msg = self.format(record)
2019-04-26T06:31:20.5242918Z   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2019-04-26T06:31:20.5246011Z     return fmt.format(record)
2019-04-26T06:31:20.5251598Z   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2019-04-26T06:31:20.5263066Z     record.message = record.getMessage()
2019-04-26T06:31:20.5272224Z   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2019-04-26T06:31:20.5276909Z     msg = msg % self.args
2019-04-26T06:31:20.5283054Z TypeError: not all arguments converted during string formatting
2019-04-26T06:31:20.528812Z Logged from file manage.py, line 278

log.error(e, 'unable to get primary status')

I think these calls to log.error don't follow the correct function signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions