Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after Update: Name 'logging' is not defined #677

Open
davidancalagon opened this issue Feb 1, 2025 · 4 comments
Open

Error after Update: Name 'logging' is not defined #677

davidancalagon opened this issue Feb 1, 2025 · 4 comments

Comments

@davidancalagon
Copy link

Appears that my docker container was auto-updated by watchtower last night, and after update it will not start, generating the below error in the log:

2025-02-01T01:48:57.579903218Z TUBESYNC_RESET_DOWNLOAD_DIR=True, Resetting /downloads directory permissions
2025-02-01T02:07:58.905891481Z File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line
2025-02-01T02:07:58.906446975Z utility.execute()
2025-02-01T02:07:58.906457796Z File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 363, in execute
2025-02-01T02:07:58.906538893Z settings.INSTALLED_APPS
2025-02-01T02:07:58.906543601Z File "/usr/local/lib/python3.11/dist-packages/django/conf/init.py", line 82, in getattr
2025-02-01T02:07:58.906812836Z self._setup(name)
2025-02-01T02:07:58.906820085Z File "/usr/local/lib/python3.11/dist-packages/django/conf/init.py", line 69, in _setup
2025-02-01T02:07:58.906888247Z self._wrapped = Settings(settings_module)
2025-02-01T02:07:58.906892703Z ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-01T02:07:58.906895334Z File "/usr/local/lib/python3.11/dist-packages/django/conf/init.py", line 170, in init
2025-02-01T02:07:58.907020166Z mod = importlib.import_module(self.SETTINGS_MODULE)
2025-02-01T02:07:58.907027698Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-01T02:07:58.907030764Z File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
2025-02-01T02:07:58.907245568Z return _bootstrap._gcd_import(name[level:], package, level)
2025-02-01T02:07:58.907317240Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-01T02:07:58.907325272Z File "", line 1206, in _gcd_import
2025-02-01T02:07:58.907328369Z File "", line 1178, in _find_and_load
2025-02-01T02:07:58.907331023Z File "", line 1149, in _find_and_load_unlocked
2025-02-01T02:07:58.907333634Z File "", line 690, in _load_unlocked
2025-02-01T02:07:58.907343497Z File "", line 940, in exec_module
2025-02-01T02:07:58.907346531Z File "", line 241, in _call_with_frames_removed
2025-02-01T02:07:58.907349338Z File "/app/tubesync/settings.py", line 185, in
2025-02-01T02:07:58.907386390Z from .local_settings import *
2025-02-01T02:07:58.907391254Z File "/app/tubesync/local_settings.py", line 34, in
2025-02-01T02:07:58.907485364Z if not logging:
2025-02-01T02:07:58.907489539Z ^^^^^^^
2025-02-01T02:07:58.907507824Z NameError: name 'logging' is not defined
2025-02-01T02:07:58.942914883Z s6-rc: warning: unable to start service tubesync-init: command exited 1

@ZeblodS
Copy link

ZeblodS commented Feb 1, 2025

I have a similar issue (yet not exactly the same, even though it seems to originate from the same lines in the code somehow...) since the last update of my docker image.

tubesync  | s6-rc: info: service s6rc-oneshot-runner: starting
tubesync  | s6-rc: info: service s6rc-oneshot-runner successfully started
tubesync  | s6-rc: info: service fix-attrs: starting
tubesync  | s6-rc: info: service tubesync-init: starting
tubesync  | s6-rc: info: service fix-attrs successfully started
tubesync  | s6-rc: info: service legacy-cont-init: starting
tubesync  | s6-rc: info: service legacy-cont-init successfully started
tubesync  | Traceback (most recent call last):
tubesync  |   File "/app/manage.py", line 18, in <module>
tubesync  |     main()
tubesync  |   File "/app/manage.py", line 14, in main
tubesync  |     execute_from_command_line(sys.argv)
tubesync  |   File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
tubesync  |     utility.execute()
tubesync  |   File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 363, in execute
tubesync  |     settings.INSTALLED_APPS
tubesync  |   File "/usr/local/lib/python3.11/dist-packages/django/conf/__init__.py", line 82, in __getattr__
tubesync  |     self._setup(name)
tubesync  |   File "/usr/local/lib/python3.11/dist-packages/django/conf/__init__.py", line 69, in _setup
tubesync  |     self._wrapped = Settings(settings_module)
tubesync  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^
tubesync  |   File "/usr/local/lib/python3.11/dist-packages/django/conf/__init__.py", line 170, in __init__
tubesync  |     mod = importlib.import_module(self.SETTINGS_MODULE)
tubesync  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tubesync  |   File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
tubesync  |     return _bootstrap._gcd_import(name[level:], package, level)
tubesync  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tubesync  |   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
tubesync  |   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
tubesync  |   File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
tubesync  |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
tubesync  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
tubesync  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
tubesync  |   File "/app/tubesync/settings.py", line 185, in <module>
tubesync  |     from .local_settings import *
tubesync  |   File "/app/tubesync/local_settings.py", line 37, in <module>
tubesync  |     log.info(f'Using database connection: {database_dict["ENGINE"]}://'
tubesync  |     ^^^
tubesync  | NameError: name 'log' is not defined
tubesync  | s6-rc: warning: unable to start service tubesync-init: command exited 1

@ZeblodS
Copy link

ZeblodS commented Feb 1, 2025

I made my container work again by replacing the file /app/tubesync/local_settings.py by the version from four days ago: https://github.com/meeb/tubesync/blob/d9c73d3dd73288f5846e8af084614e59cac9be6e/tubesync/tubesync/local_settings.py.container

Apparently a bad commit has been pushed...

@tcely
Copy link
Contributor

tcely commented Feb 2, 2025

You can also pull the latest image.

See #670

@ZeblodS
Copy link

ZeblodS commented Feb 2, 2025

You can also pull the latest image.

See #670

My bad, I though the latest image was pulled but it wasn't: I had to remove the container and prune before Docker actually pulled the latest image...

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants