jazzband/django-configurations

Getting some weird logging error with python 3.8 and 3.9

Closed this issue · 1 comments

I seriously cannot find the source of the error, but as far as I can see, it results from utility.execute(), attaching the stack trace for reference:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 440, in format
    return self._format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 436, in _format
    return self._fmt % record.__dict__
KeyError: 'acstime'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 1085, in emit
    msg = self.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 929, in format
    return fmt.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 671, in format
    s = self.formatMessage(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 640, in formatMessage
    return self._style.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 442, in format
    raise ValueError('Formatting field not found in record: %s' % e)
ValueError: Formatting field not found in record: 'acstime'
Call stack:
  File "/home/amartya/repos/ecom_general/manage.py", line 24, in <module>
    main()
  File "/home/amartya/repos/ecom_general/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 61, in execute
    super().execute(*args, **options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 96, in handle
    self.run(**options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 103, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 638, in run_with_reloader
    start_django(reloader, main_func, *args, **kwargs)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 623, in start_django
    reloader.run(django_main_thread)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 329, in run
    self.run_loop()
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 335, in run_loop
    next(ticker)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 383, in tick
    self.notify_file_changed(filepath)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 358, in notify_file_changed
    trigger_reload(path)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 251, in trigger_reload
    logger.info('%s changed, reloading.', filename)
Message: '%s changed, reloading.'
Arguments: (PosixPath('/home/amartya/repos/ecom_general/ecom_general/config/base.py'),)
django-configurations version , using configuration Dev
INFO Watching for file changes with StatReloader
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 440, in format
    return self._format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 436, in _format
    return self._fmt % record.__dict__
KeyError: 'acstime'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 1085, in emit
    msg = self.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 929, in format
    return fmt.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 671, in format
    s = self.formatMessage(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 640, in formatMessage
    return self._style.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 442, in format
    raise ValueError('Formatting field not found in record: %s' % e)
ValueError: Formatting field not found in record: 'acstime'
Call stack:
  File "/home/amartya/repos/ecom_general/manage.py", line 24, in <module>
    main()
  File "/home/amartya/repos/ecom_general/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 61, in execute
    super().execute(*args, **options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 96, in handle
    self.run(**options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 103, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "/home/amartya/repos/ecom_general/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 637, in run_with_reloader
    logger.info('Watching for file changes with %s', reloader.__class__.__name__)
Message: 'Watching for file changes with %s'
Arguments: ('StatReloader',)

The error was somewhere else, a simple ugrep solved it, sorry for the trouble