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

Traceback when calling intelmqdump without write access to the log file #2529

Open
sebix opened this issue Sep 16, 2024 · 0 comments
Open

Traceback when calling intelmqdump without write access to the log file #2529

sebix opened this issue Sep 16, 2024 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior component: intelmqdump

Comments

@sebix
Copy link
Member

sebix commented Sep 16, 2024

As any user not intelmq or root (or write access to /var/log/intelmq/intelmqdump.log), call intelmqdump:

$ intelmqdump 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/intelmq/bin/intelmqdump.py", line 197, in main
    logger = utils.log('intelmqdump',
  File "/usr/lib/python3/dist-packages/intelmq/lib/utils.py", line 392, in log
    handler = RotatingFileHandler(f"{log_path}/{name}.log",
  File "/usr/lib/python3.10/logging/handlers.py", line 155, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding=encoding,
  File "/usr/lib/python3.10/logging/handlers.py", line 58, in __init__
    logging.FileHandler.__init__(self, filename, mode=mode,
  File "/usr/lib/python3.10/logging/__init__.py", line 1169, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.10/logging/__init__.py", line 1201, in _open
    return open_func(self.baseFilename, self.mode,
PermissionError: [Errno 13] Permission denied: '/var/log/intelmq/intelmqdump.log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/intelmqdump", line 33, in <module>
    sys.exit(load_entry_point('intelmq==3.3.1', 'console_scripts', 'intelmqdump')())
  File "/usr/lib/python3/dist-packages/intelmq/bin/intelmqdump.py", line 203, in main
    logger = utils.log('intelmqdump', log_level=log_level, log_path=False)
UnboundLocalError: local variable 'log_level' referenced before assignment
  1. intelmqdump should try to become user intelmq and stop if it fails as does intelmqctl.
  2. There should not be a second exception if write permissions are missing
@sebix sebix added bug Indicates an unexpected problem or unintended behavior component: intelmqdump labels Sep 16, 2024
@sebix sebix changed the title Traceback when calling intelmqdump with write access to the log file Traceback when calling intelmqdump without write access to the log file Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: intelmqdump
Projects
None yet
Development

No branches or pull requests

1 participant