imperva / incapsula-logs-downloader

A Python script for downloading log files from Incapsula
MIT License
30 stars 35 forks source link

New Script error (14 Jan 2021) #28

Closed fbarbozaa closed 8 months ago

fbarbozaa commented 3 years ago

[user@server bin]# python3.9 LogsDownloader1.py -c /etc/incapsula/logs/config -l /var/log/incapsula/logsDownloader/ -v info --- Logging error --- Traceback (most recent call last): File "/usr/local/lib/python3.9/configparser.py", line 789, in get value = d[option] File "/usr/local/lib/python3.9/collections/init.py", line 941, in getitem return self.missing(key) # support subclasses that define missing File "/usr/local/lib/python3.9/collections/init.py", line 933, in missing raise KeyError(key) KeyError: 'syslog_port'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/LogsDownloader1.py", line 98, in init self.config = self.config_reader.read() File "/usr/local/bin/LogsDownloader1.py", line 548, in read config.SYSLOG_PORT = os.environ.get('IMPERVA_SYSLOG_PORT', config_parser.get('SETTINGS', 'SYSLOG_PORT')) File "/usr/local/lib/python3.9/configparser.py", line 792, in get raise NoOptionError(option, section) configparser.NoOptionError: No option 'syslog_port' in section: 'SETTINGS'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/logging/handlers.py", line 74, in emit self.doRollover() File "/usr/local/lib/python3.9/logging/handlers.py", line 403, in doRollover self.rotate(self.baseFilename, dfn) File "/usr/local/lib/python3.9/logging/handlers.py", line 115, in rotate os.rename(source, dest) OSError: [Errno 28] No space left on device: '/var/log/incapsula/logsDownloader/logs_downloader.log' -> '/var/log/incapsula/logsDownloader/logs_downloader.log.2021-06-07' Call stack: File "/usr/local/bin/LogsDownloader1.py", line 656, in logsDownloader = LogsDownloader(path_to_config_folder, path_to_system_logs_folder, system_logs_level) File "/usr/local/bin/LogsDownloader1.py", line 100, in init self.logger.error("Exception while getting LogsDownloader config file - Could Not find Configuration file - %s", traceback.format_exc()) Message: 'Exception while getting LogsDownloader config file - Could Not find Configuration file - %s' Arguments: ('Traceback (most recent call last):\n File "/usr/local/lib/python3.9/configparser.py", line 789, in get\n value = d[option]\n File "/usr/local/lib/python3.9/collections/init.py", line 941, in getitem\n return self.missing(key) # support subclasses that define missing\n File "/usr/local/lib/python3.9/collections/init.py", line 933, in missing\n raise KeyError(key)\nKeyError: \'syslog_port\'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/usr/local/bin/LogsDownloader1.py", line 98, in init\n self.config = self.config_reader.read()\n File "/usr/local/bin/LogsDownloader1.py", line 548, in read\n config.SYSLOG_PORT = os.environ.get(\'IMPERVA_SYSLOG_PORT\', config_parser.get(\'SETTINGS\', \'SYSLOG_PORT\'))\n File "/usr/local/lib/python3.9/configparser.py", line 792, in get\n raise NoOptionError(option, section)\nconfigparser.NoOptionError: No option \'syslog_port\' in section: \'SETTINGS\'\n',) 2021-06-17 17:19:57,203 ERROR Exception while getting LogsDownloader config file - Could Not find Configuration file - Traceback (most recent call last): File "/usr/local/lib/python3.9/configparser.py", line 789, in get value = d[option] File "/usr/local/lib/python3.9/collections/init.py", line 941, in getitem return self.missing(key) # support subclasses that define missing File "/usr/local/lib/python3.9/collections/init.py", line 933, in missing raise KeyError(key) KeyError: 'syslog_port'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/LogsDownloader1.py", line 98, in init self.config = self.config_reader.read() File "/usr/local/bin/LogsDownloader1.py", line 548, in read config.SYSLOG_PORT = os.environ.get('IMPERVA_SYSLOG_PORT', config_parser.get('SETTINGS', 'SYSLOG_PORT')) File "/usr/local/lib/python3.9/configparser.py", line 792, in get raise NoOptionError(option, section) configparser.NoOptionError: No option 'syslog_port' in section: 'SETTINGS'

Could Not find Configuration file

AaronSeibert commented 3 years ago

The stack trace is pretty clear here - the config file specified by the -c flag couldn't be found. If it exists please check permissions.