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

Could not find file #46

Closed
l-natali opened this issue Jul 8, 2022 · 18 comments
Closed

Could not find file #46

l-natali opened this issue Jul 8, 2022 · 18 comments

Comments

@l-natali
Copy link

l-natali commented Jul 8, 2022

I have run script and saw that logs was writting to the selected directory. But after script was stopped and I launched it again I see error:
2022-07-07 12:40:19,749 WARNING Could not find file https://logs1.incapsula.com/xxxxx_xxxxxxx/11149_205.log. Response code is 404
2022-07-07 12:40:19,750 INFO Sleeping for 1 seconds until next file download retry number 2 out of 3

I decreased sleep/wait timer but it didn't help, error still here.

Does anybody know how to fix it?

Thanks in advance!

@l-natali
Copy link
Author

Fixed it via LastKnownDownloadedFileId.txt cleaning

@joeymoore
Copy link
Collaborator

@l-natali This "error" of 404 is normal as the assumed next log to downloaded may not have been created yet on the platform. Deleting the LastKnown will only cause the script to start downloading logs again from the beginning.

@jclo1
Copy link

jclo1 commented Aug 2, 2022

Hi @l-natali I have the same error with the script. (404)

did you have any issues removing the LastKnownDownloadedFileId.txt entry?

How far you started collecting the logs again?

@n1majne3
Copy link

n1majne3 commented Aug 3, 2022

@l-natali This "error" of 404 is normal as the assumed next log to downloaded may not have been created yet on the platform. Deleting the LastKnown will only cause the script to start downloading logs again from the beginning.

hi, @joeymoore I found the 10 times retries will easily to reach due to the 404 issue, and onece it "attemptting to revover", it will start to downloading logs again from the beginning. not sure if incresing the the retries could fix?

@l-natali
Copy link
Author

l-natali commented Aug 4, 2022

Hi @l-natali I have the same error with the script. (404)

did you have any issues removing the LastKnownDownloadedFileId.txt entry?

How far you started collecting the logs again?

Hi @jclo1 I didn't remove LastKnownDownloadedFileId.txt entirely. I cleaned it via vi(m) text editor - open file in vi(m), type "dd" and saved this file. After it straight away I sterted collecting logs again.

@mahegs
Copy link

mahegs commented Oct 20, 2022

I have encountered this same issue. I have cleaned the LastKnownDownloadedFileId.txt and logs started over, but when they caught up, I again hit the same file that could not be found, and cannot progress beyond that point. I then set the log number in my LastKnownDownloadedFileId.tx to the log right before the one that cannot be found, the one before was successfully downloaded and the next in sequence is not available/ready. Essentially, I have no new log files ready in the last 4 days.

2022-10-19 12:11:58,151 INFO LogsDownloader initializing is done
Oct 19 12:11:58 is103.fb bash[16313]: 2022-10-19 12:11:58,975 INFO Successfully downloaded file from URL https://logs1.incapsula.com/xxxx_xxxxxxx/xxxx_6714641.log
Oct 19 12:11:59 is103.fb bash[16313]: 2022-10-19 12:11:59,001 INFO File 3094_6714641.log download and processing completed successfully
Oct 19 12:11:59 is103.fb bash[16313]: 2022-10-19 12:11:59,001 INFO Sleeping for 2 seconds before fetching the next logs file
Oct 19 12:12:01 is103.fb bash[16313]: 2022-10-19 12:12:01,903 INFO Successfully downloaded file from URL https://logs1.incapsula.com/xxxx_xxxxxxx/xxxx_6714642.log
Oct 19 12:12:02 is103.fb bash[16313]: 2022-10-19 12:12:02,401 INFO File 3094_6714642.log download and processing completed successfully
Oct 19 12:12:02 is103.fb bash[16313]: 2022-10-19 12:12:02,403 INFO Sleeping for 2 seconds before fetching the next logs file
Oct 19 12:12:05 is103.fb bash[16313]: 2022-10-19 12:12:05,026 WARNING Could not find file https://logs1.incapsula.com/xxxx_xxxxxxx/xxxx_6714643.log. Response code is 404
Oct 19 12:12:05 is103.fb bash[16313]: 2022-10-19 12:12:05,026 INFO Sleeping for 5 seconds until next file download retry number 1 out of 3

Are there any other steps I can try to get to new data?

@mahegs
Copy link

mahegs commented Oct 20, 2022

LastKnownDownloadedFileId.tx

I was able to view the sequence of logs available for download via the logs.index. We were indeed missing several in the sequence, which was causing the file not found errors. I was able to update the LastKnownDownloadedFileId.txt to the log before they were complete again. I restarted the service, and logs are downloading again.

These are the logs we have in order, after the missing file:
xxxx_6714639.log
xxxx_6714641.log
xxxx_6714642.log - no 6714643 or 6714644
xxxx_6714645.log - no 6714646
xxxx_6714647.log
xxxx_6714648.log
xxxx_6714649.log

I updated the LastKnownDownloadedFileId.txt file to list the 671646 file as the last known, and restarted the incapsulaLogs.service and log collection has resumed as expected. I do not know what causes the missing log files, but I have reached out to support for more info.

@joeymoore
Copy link
Collaborator

@l-natali @jclo1 @n1majne3 @mahegs 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

@l-natali
Copy link
Author

@l-natali @jclo1 @n1majne3 @mahegs 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

It doesn't an issue anymore.

@mahegs
Copy link

mahegs commented Apr 4, 2023 via email

@joeymoore
Copy link
Collaborator

@mahegs did you make the needed changes to the config file as all the variable names were changed to prepend the existing vars with IMPERVA_*

@mahegs
Copy link

mahegs commented Apr 5, 2023 via email

@joeymoore
Copy link
Collaborator

joeymoore commented Apr 5, 2023 via email

@mahegs
Copy link

mahegs commented Apr 5, 2023 via email

@joeymoore
Copy link
Collaborator

joeymoore commented Apr 5, 2023 via email

@mahegs
Copy link

mahegs commented Apr 5, 2023 via email

@joeymoore
Copy link
Collaborator

joeymoore commented Apr 5, 2023 via email

@mahegs
Copy link

mahegs commented Apr 5, 2023 via email

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

5 participants