imperva / incapsula-logs-downloader

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

Error with docker with mounted volum decryprion error self.handle_log_decrypted_content(logfile, decrypted_file) #92

Open bisontim opened 1 month ago

bisontim commented 1 month ago

Hi I would like to use the docker version but I have problems when I mount a persisten volume for /process folder. It seems decryption fails.

I obtain the error: 2024-06-04 09:29:20,699 Thread-10 INFO Downloaded https://logs3.incapsula.com/9843_1897139/9843_1244595.log 2024-06-04 09:29:20,700 Thread-10 ERROR Saving file 9843_1244595.log locally: [Errno 18] Invalid cross-device link: '/incoming/9843_1244595.log.tmp' -> '/process/9843_1244595.log' Traceback (most recent call last): File "/usr/local/bin/LogsDownloader.py", line 236, in handle_file self.handle_log_decrypted_content(logfile, decrypted_file) File "/usr/local/bin/LogsDownloader.py", line 254, in handle_log_decrypted_content os.rename(os.path.join(os.path.join(self.config.INCOMING_DIR, "{}.tmp".format(filename))), OSError: [Errno 18] Invalid cross-device link: '/incoming/9843_1244595.log.tmp' -> '/process/9843_1244595.log'

If I don't mount a persistent volume on docker for /process folder, it works.

What could I do? Thanks a lot

bisontim commented 1 month ago

With a previous version of LogsDownloader.py, it works well, I can mount without problems

AaronSeibert commented 1 month ago

Can you provide the distribution, kernel version, and docker version of the host running the docker daemon?

bisontim commented 1 month ago

I.m running on: Ubuntu 22.04.4 LTS Docker version 26.1.3, build b72abbb

Thanks a lot

PBond83 commented 3 weeks ago

I have the same issue. There is any solution?

bisontim commented 3 weeks ago

I have the same issue. There is any solution?

I am using an older version of LogsDownloader.py i think the problem is on the decrypt ...

PBond83 commented 3 weeks ago

Which version is it??

bisontim commented 3 weeks ago

Which version is it??

I used an old commit, probably before security decrypt implementation. I attach my working version LogsDownloader.py.txt