odoo-15-docker-compose icon indicating copy to clipboard operation
odoo-15-docker-compose copied to clipboard

errors when using docker-compose up... python issues..?

Open Peppernrino opened this issue 2 years ago • 2 comments

after i set everything up, i used docker-compose up, and i received and error:

ERROR: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml

so i decided i needed a docker-compose.yml file. i created a copy of the one provided, and ran it from what i assume is the root directory. then when i used docker-compose up, i got:

Creating network "root_default" with the default driver Creating root_db_1 ... done Creating root_odoo15_1 ...

ERROR: for root_odoo15_1 a bytes-like object is required, not 'str'

ERROR: for odoo15 a bytes-like object is required, not 'str' Traceback (most recent call last): File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status response.raise_for_status() File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.22/containers/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container container.start() File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start return self.client.start(self.id, **options) File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped return f(self, resource_id, *args, **kwargs) File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start self._raise_for_status(res) File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status raise create_api_error_from_http_exception(e) File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception raise cls(e, response=response, explanation=explanation) docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint root_odoo15_1 (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx): Bind for 0.0.0.0:20015 failed: port is already allocated'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/docker-compose", line 11, in load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')() File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main command() File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command handler(command, command_options) File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1107, in up to_attach = up(False) File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1088, in up return self.project.up( File "/usr/lib/python3/dist-packages/compose/project.py", line 565, in up results, errors = parallel.parallel_execute( File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute raise error_to_reraise File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer result = func(obj) File "/usr/lib/python3/dist-packages/compose/project.py", line 548, in do return service.execute_convergence_plan( File "/usr/lib/python3/dist-packages/compose/service.py", line 545, in execute_convergence_plan return self._execute_convergence_create( File "/usr/lib/python3/dist-packages/compose/service.py", line 460, in _execute_convergence_create containers, errors = parallel_execute( File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute raise error_to_reraise File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer result = func(obj) File "/usr/lib/python3/dist-packages/compose/service.py", line 465, in lambda service_name: create_and_start(self, service_name.number), File "/usr/lib/python3/dist-packages/compose/service.py", line 457, in create_and_start self.start_container(container) File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container if "driver failed programming external connectivity" in ex.explanation: TypeError: a bytes-like object is required, not 'str'

what am i doing wrong?

Peppernrino avatar Apr 02 '22 20:04 Peppernrino

got the same error when I runned docker-compose up

luna9722 avatar Aug 18 '23 14:08 luna9722

Hi @Peppernrino , @luna9722

In the error message, I notice this line "Bind for 0.0.0.0:20015 failed: port is already allocated". Odoo will not be able to start if either the port 10015 or port 20015 is already allocated by another service.

You can change the exposing ports in docker-compose.yml at: https://github.com/minhng92/odoo-15-docker-compose/blob/3cf888ae511249e15a60cc9d6e86f211d1254889/docker-compose.yml#L20-L21

minhng92 avatar Aug 25 '23 16:08 minhng92