Debugging & Logging

Leider verhält sich Software nicht immer wie erwartet, es treten Bugs auf, oder die Konfiguration hat sich geändert. Vielleicht ist auch ein externer Dienst nicht (mehr) erreichbar. In solchen Fällen ist möglich, auf dem Server in den Logfiles nach Fehlern zu suchen.

Sie können sich diese im Installationsverzeichnis mit docker logs oder docker compose logs anzeigen lassen. Weitere Informationen zu diesen Tools finden Sie in der Dokumentation von Docker für docker logs und docker-compose logs.

Die folgenden Ausgaben stellen den gleichen Fehler unter den verschiedenen Tools dar. In diesem Fall ist der Austauschordner \\samba_share\ nicht erreichbar, offensichtlich stimmt der Name nicht (Failure in name resolution).

  • Ausgabe von docker logs:
$ cd /opt/docker-deploy/detect
$ docker logs detect_vm-backend-1
...
  File "/usr/local/lib/python3.8/site-packages/smbprotocol/_compat.py", line 15, in reraise
    raise exc
ValueError: Failed to connect to 'samba_share:445': [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/logging/__init__.py", line 1085, in emit
    msg = self.format(record)
  File "/usr/local/lib/python3.8/logging/__init__.py", line 929, in format
    return fmt.format(record)
  File "/usr/local/lib/python3.8/logging/__init__.py", line 668, in format
    record.message = record.getMessage()
  File "/usr/local/lib/python3.8/logging/__init__.py", line 373, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/usr/local/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 80, in _worker
    work_item.run()
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/apscheduler/executors/base.py", line 125, in run_job
    retval = job.func(*job.args, **job.kwargs)
  File "/home/app/backend/detect/file_import/samba/samba_file_watcher.py", line 90, in scan
    logger.error('Unable to connect', value_error)
Message: 'Unable to connect'
Arguments: (ValueError("Failed to connect to 'samba_share:445': [Errno -3] Temporary failure in name resolution"),)
''[2023-03-16 15:16:42 +0000]' [10] [INFO] [samba_file_watcher] Files found on '\\samba_share\folder' for pattern '*.xml': '
  • Ausgabe von docker compose logs:
...
backend_1            | ValueError: Failed to connect to 'samba_share:445': [Errno -3] Temporary failure in name resolution
backend_1            | 
backend_1            | During handling of the above exception, another exception occurred:
backend_1            | 
backend_1            | Traceback (most recent call last):
backend_1            |   File "/usr/local/lib/python3.8/logging/__init__.py", line 1085, in emit
backend_1            |     msg = self.format(record)
backend_1            |   File "/usr/local/lib/python3.8/logging/__init__.py", line 929, in format
backend_1            |     return fmt.format(record)
backend_1            |   File "/usr/local/lib/python3.8/logging/__init__.py", line 668, in format
backend_1            |     record.message = record.getMessage()
backend_1            |   File "/usr/local/lib/python3.8/logging/__init__.py", line 373, in getMessage
backend_1            |     msg = msg % self.args
backend_1            | TypeError: not all arguments converted during string formatting
backend_1            | Call stack:
backend_1            |   File "/usr/local/lib/python3.8/threading.py", line 890, in _bootstrap
backend_1            |     self._bootstrap_inner()
backend_1            |   File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
backend_1            |     self.run()
backend_1            |   File "/usr/local/lib/python3.8/threading.py", line 870, in run
backend_1            |     self._target(*self._args, **self._kwargs)
backend_1            |   File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 80, in _worker
backend_1            |     work_item.run()
backend_1            |   File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
backend_1            |     result = self.fn(*self.args, **self.kwargs)
backend_1            |   File "/usr/local/lib/python3.8/site-packages/apscheduler/executors/base.py", line 125, in run_job
backend_1            |     retval = job.func(*job.args, **job.kwargs)
backend_1            |   File "/home/app/backend/detect/file_import/samba/samba_file_watcher.py", line 90, in scan
backend_1            |     logger.error('Unable to connect', value_error)
backend_1            | Message: 'Unable to connect'
backend_1            | Arguments: (ValueError("Failed to connect to 'samba_share:445': [Errno -3] Temporary failure in name resolution"),)