fkie-cad / fkie-cad/FACT_docker
[cwe_checker] Error during trying to start container plugin
- Dominant language
- Python
- Stars
- 29
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
`cwe_checker` can't be executed, since the container can't be created. According to the logs, it seems something is broken with the volume where the files are stored, but as far as I could check, the folder exists. We're using the latest `stable` image, and with the previous build (the earlier docker checksum) I didn't experience problems.
Here is the stacktrace:
```log
[2022-07-28 14:48:37][analysis][INFO]: Analysis Completed:
UID: a9bb44df19d9ea51c0d6a4ff75b3fd4054a9114b7b333279ff86bea30e13cab9_18900
Processed analysis: ['unpacker', 'file_type', 'software_components', 'cpu_architecture', 'cwe_checker']
Files included: set()
[2022-07-28 14:48:37][docker][WARNING]: [Docker]: encountered docker error while processing
Process ExceptionSafeProcess-14:1432:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/docker/api/client.py", line 268, in _raise_for_status
response.raise_for_status()
File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.41/containers/create
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/opt/FACT_core/src/helperFunctions/process.py", line 57, in run
raise exception
File "/opt/FACT_core/src/helperFunctions/process.py", line 52, in run
Process.run(self)
File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/FACT_core/src/analysis/PluginBase.py", line 123, in process_next_object
finished_task = self.analyze_file(task)
File "/opt/FACT_core/src/analysis/PluginBase.py", line 69, in analyze_file
fo = self.process_object(file_object)
File "/opt/FACT_core/src/plugins/analysis/cwe_checker/code/cwe_checker.py", line 128, in process_object
file_object = self._do_full_analysis(file_object)
File "/opt/FACT_core/src/plugins/analysis/cwe_checker/code/cwe_checker.py", line 102, in _do_full_analysis
output = self._run_cwe_checker_in_docker(file_object)
File "/opt/FACT_core/src/plugins/analysis/cwe_checker/code/cwe_checker.py", line 66, in _run_cwe_checker_in_docker
result = run_docker_container(
File "/opt/FACT_core/src/helperFunctions/docker.py", line 35, in run_docker_container
container = client.containers.run(image, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/docker/models/containers.py", line 819, in run
container = self.create(image=image, command=command,
File "/usr/local/lib/python3.8/dist-packages/docker/models/containers.py", line 878, in create
resp = self.client.api.create_container(**create_kwargs)
File "/usr/local/lib/python3.8/dist-packages/docker/api/container.py", line 428, in create_container
return self.create_container_from_config(config, name)
File "/usr/local/lib/python3.8/dist-packages/docker/api/container.py", line 439, in create_container_from_config
return self._result(res, True)
File "/usr/local/lib/python3.8/dist-packages/docker/api/client.py", line 274, in _result
self._raise_for_status(response)
File "/usr/local/lib/python3.8/dist-packages/docker/api/client.py", line 270, in _raise_for_status
raise create_api_error_from_http_exception(e)
File "/usr/local/lib/python3.8/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.41/containers/create: Bad Request ("invalid mount config for type "bind": bind source path does not exist: /media/data/fact_fw_data/ee/eed9c131aab170dfb0fe38caddf4347afabbbe7345a69137987a95875cc00f89_18500")
[2022-07-28 14:48:37][PluginBase][ERROR]: Worker 1: Exception during analysis cwe_checker on eed9c131aab170dfb0fe38caddf4347afabbbe7345a69137987a95875cc00f89_18500
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with plugins/analysis/cwe_checker/code/cwe_checker.py and helperFunctions/docker.py, then reproduce the cwe_checker run using the stable image and the bind path shown in the stack trace. Trace why Docker receives a missing source path after the analysis completes. Done means the container is created successfully and cwe_checker finishes without the invalid mount error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- backend, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100