Closed connor-borchgrevink closed 8 months ago
For the first issue I changed the following line:
local_file = open(self.config.PROCESS_DIR + filename, "a+")
To:
local_file = open(self.config.PROCESS_DIR + filename, "a+", encoding='utf-8')
Without specifying the encoding for the output file it was throwing an exception (it was trying to use 'cp1252' encoding which doesn't like non-ASCII chars).
anyone find a solution for the second issue?
Having the same here. even if the script runs, it seems to sometimes fail to catch up with how fast new logs appear and since it's waiting 5seconds between retries, it losses ground...
But it also seems incapsula is not providing any support for this script so time to dig into the code and try to fix ourselves.
@mveroone changed some timers, check #42
Here please let me know if this is still an issue. A new 3.0.0 release is available and resolves a lot of known issues. Please review the readme if planning to upgrade. https://github.com/imperva/incapsula-logs-downloader/tree/release-3.0.0-beta
Can someone help me I'm getting the same Warning "WARNING Could not find file https://logs1.incapsula.com/"
Has anyone here managed to solve it?
Do you have the full URI in the configuration? With you specific information like https://logs1.incapsula.com/1982_2438/1982_2902779.log? Are you using version 3.0.0?
Hello!
I am running into two separate issues that both causing the script to hang up and stop downloading the logs.
if self.config.SAVE_LOCALLY == "YES": local_file = open(self.config.PROCESS_DIR + filename, "a+") try: local_file.writelines(decrypted_file) except: pass
It seems to have worked? I haven't had the same error message since adding it.
2020-06-23 09:32:38,161 INFO Sleeping for 5 seconds until next file download retry number 1 out of 3 2020-06-23 09:32:43,540 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:32:43,542 INFO Sleeping for 5 seconds until next file download retry number 2 out of 3 2020-06-23 09:32:48,943 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:32:48,944 INFO Sleeping for 5 seconds until next file download retry number 3 out of 3 2020-06-23 09:32:54,286 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:32:54,287 INFO Could not get log file 1982_2902779.log. It could be that the log file does not exist yet. 2020-06-23 09:32:54,287 INFO Sleeping for 30 seconds before trying to fetch logs again... 2020-06-23 09:33:24,648 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:33:24,649 INFO Sleeping for 5 seconds until next file download retry number 1 out of 3 2020-06-23 09:33:30,026 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:33:30,027 INFO Sleeping for 5 seconds until next file download retry number 2 out of 3 2020-06-23 09:33:35,311 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:33:35,312 INFO Sleeping for 5 seconds until next file download retry number 3 out of 3 2020-06-23 09:33:40,672 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:33:40,673 INFO Could not get log file 1982_2902779.log. It could be that the log file does not exist yet. 2020-06-23 09:33:40,673 INFO Sleeping for 30 seconds before trying to fetch logs again... 2020-06-23 09:34:11,044 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:34:11,045 INFO Sleeping for 5 seconds until next file download retry number 1 out of 3 2020-06-23 09:34:16,867 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:34:16,868 INFO Sleeping for 5 seconds until next file download retry number 2 out of 3 2020-06-23 09:34:22,153 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:34:22,154 INFO Sleeping for 5 seconds until next file download retry number 3 out of 3 2020-06-23 09:34:27,497 WARNING Could not find file https://logs1.incapsula.com/1982_2438/1982_2902779.log. Response code is 404 2020-06-23 09:34:27,499 INFO Could not get log file 1982_2902779.log. It could be that the log file does not exist yet. 2020-06-23 09:34:27,499 INFO Sleeping for 30 seconds before trying to fetch logs again...