fkie-cad / fkie-cad/FACT_docker

Permission denied: '/media/data/fact_fw_data/91'

Open
#34 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Hi all.
I have been trying to test the solution but I'm getting this error when I upload a file.

[2022-11-17 04:10:44][fail_safe_file_operations][ERROR]: Could not write file: [Errno 13] Permission denied: '/media/data/fact_fw_data/91'
fact-backend_1 | Traceback (most recent call last):
fact-backend_1 | File "/usr/local/lib/python3.8/dist-packages/common_helper_files/fail_safe_file_operations.py", line 61, in write_binary_to_file
fact-backend_1 | create_dir_for_file(file_path)
fact-backend_1 | File "/usr/local/lib/python3.8/dist-packages/common_helper_files/file_functions.py", line 50, in create_dir_for_file
fact-backend_1 | Path(file_path).resolve().parent.mkdir(parents=True, exist_ok=True)
fact-backend_1 | File "/usr/lib/python3.8/pathlib.py", line 1288, in mkdir
fact-backend_1 | self._accessor.mkdir(self, mode)
fact-backend_1 | PermissionError: [Errno 13] Permission denied: '/media/data/fact_fw_data/91'
fact-backend_1 | Process Unpacking-Worker-0:
fact-backend_1 | Traceback (most recent call last):
fact-backend_1 | File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
fact-backend_1 | self.run()
fact-backend_1 | File "/opt/FACT_core/src/helperFunctions/process.py", line 56, in run
fact-backend_1 | raise exception
fact-backend_1 | File "/opt/FACT_core/src/helperFunctions/process.py", line 51, in run
fact-backend_1 | Process.run(self)
fact-backend_1 | File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
fact-backend_1 | self._target(*self._args, **self._kwargs)
fact-backend_1 | File "/opt/FACT_core/src/scheduler/unpacking_scheduler.py", line 64, in unpack_worker
fact-backend_1 | extracted_objects = unpacker.unpack(fo)
fact-backend_1 | File "/opt/FACT_core/src/unpacker/unpack.py", line 37, in unpack
fact-backend_1 | file_path = self._generate_local_file_path(current_fo)
fact-backend_1 | File "/opt/FACT_core/src/unpacker/unpack.py", line 93, in _generate_local_file_path
fact-backend_1 | local_path = self.file_storage_system.generate_path(file_object.uid)
fact-backend_1 | File "/opt/FACT_core/src/storage/fsorganizer.py", line 30, in generate_path
fact-backend_1 | return self.generate_path_from_uid(file_object.uid)
fact-backend_1 | AttributeError: 'str' object has no attribute 'uid'

From the webserver, it shows upload successfully. However, If click on the analysis page, it shoes the file does not exist.

I followed this instructions:
$ docker pull ghcr.io/fkie-cad/fact-core-frontend:4.0.1
$ docker pull ghcr.io/fkie-cad/fact-core-backend:4.0.1
$ docker pull ghcr.io/fkie-cad/fact-core-scripts:4.0.1
$ ./start.py pull
$ ./start.py compose-env \
--firmware-file-storage-dir path_to_fw_data_dir
# Have a look if it looks right
$ eval $(./start.py compose-env --firmware-file-storage-dir path_to_fw_data_dir)
$ export FACT_DOCKER_POSTGRES_PASSWORD=mypassword
$ docker volume create fact_postgres_data
$ docker-compose up -d database
# Wait some seconds until the db is ready
$ ./start.py initialize-db \
--network fact_docker_fact-network
$ docker-compose up

The last command shos this warning:

fact-backend_1 | [2022-11-17 04:09:22][start_fact_backend][WARNING]: Could not change permissions of docker-mount-base-dir. Ignoring.

My Linux system is
Linux 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux.

I appreciate any indication/help

Thank you.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the compose-env command, the configured firmware storage directory, and the docker-compose setup. Reproduce the upload while checking the backend warning about changing permissions and the traces in fail_safe_file_operations.py, unpacking_scheduler.py, unpack.py, and fsorganizer.py. Done means uploaded files can be unpacked and opened from the analysis page without permission or missing-file errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.