11

I'm trying to install CKAN via docker-compose: http://docs.ckan.org/en/2.8/maintaining/installing/install-from-docker-compose.html

If I try to build with:

docker-compose up -d --build

I keep getting:

ERROR: for db  Cannot create container for service db: no such file or directory
ERROR: compose.cli.main.main: Encountered errors while bringing up the project.

With the verbose flag I get:

compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- (u'docker_db')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/images/docker_db/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'Open Knowledge',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'postgres'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.service.build_container_labels: Added config hash: dfb16feda9d1de6f3a84b0a6e1ecee1a8d041d06d5676351f8f723b05c4f6f03
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (device_read_iops=None, mem_swappiness=None, links=[], oom_score_adj=None, blkio_weight=None, cpu_count=None, cpuset_cpus=None, dns_search=None, pid_mode=None, init_path=None, log_config={'Type': u'', 'Config': {}}, cpu_quota=None, read_only=None, cpu_percent=None, device_read_bps=None, storage_opt=None, init=None, dns=None, volumes_from=[], ipc_mode=None, mem_reservation=None, security_opt=None, shm_size=None, device_write_iops=None, dns_opt=None, cgroup_parent=None, group_add=None, network_mode=u'docker_default', volume_driver=None, oom_kill_disable=None, userns_mode=None, tmpfs=[], nano_cpus=None, port_bindings={}, isolation=None, memswap_limit=None, restart_policy=None, blkio_weight_device=None, devices=None, extra_hosts=None, binds=[u'docker_pg_data:/var/lib/postgresql/data:rw'], sysctls=None, pids_limit=None, device_write_bps=None, cap_add=None, mounts=None, mem_limit=None, runtime=None, cap_drop=None, privileged=False, ulimits=None, cpu_shares=None)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config -> {'Binds': [u'docker_pg_data:/var/lib/postgresql/data:rw'],
 'Links': [],
 'LogConfig': {'Config': {}, 'Type': u''},
 'NetworkMode': u'docker_default',
 'PortBindings': {},
 'VolumesFrom': []}
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (name='db', image=u'docker_db', labels={u'com.docker.compose.service': u'db', u'com.docker.compose.project': u'docker', u'com.docker.compose.config-hash': 'dfb16feda9d1de6f3a84b0a6e1ecee1a8d041d06d5676351f8f723b05c4f6f03', u'com.docker.compose.version': u'1.19.0', u'com.docker.compose.oneoff': u'False', u'com.docker.compose.container-number': '1'}, host_config={'NetworkMode': u'docker_default', 'Links': [], 'PortBindings': {}, 'Binds': [u'docker_pg_data:/var/lib/postgresql/data:rw'], 'LogConfig': {'Type': u'', 'Config': {}}, 'VolumesFrom': []}, environment=[u'POSTGRES_PASSWORD=uuimwc', u'DS_RO_PASS=uuimwc'], volumes={u'/var/lib/postgresql/data': {}}, detach=True, networking_config={u'EndpointsConfig': {u'docker_default': {u'IPAMConfig': {}, u'Aliases': ['db']}}})
compose.parallel.feed_queue: Pending: set([<Service: ckan>])
compose.parallel.feed_queue: Pending: set([])
Creating db ... error
compose.parallel.feed_queue: Pending: set([])
compose.parallel.feed_queue: Pending: set([])
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.25/containers/create?name=db HTTP/1.1" 500 40
compose.parallel.parallel_execute_iter: Failed: ServiceName(project=u'docker', service='db', number=1)
compose.parallel.feed_queue: Pending: set([])

ERROR: for db  Cannot create container for service db: no such file or directory
compose.parallel.parallel_execute_iter: Failed: <Service: db>
compose.parallel.feed_queue: Pending: set([<Service: ckan>])
compose.parallel.feed_queue: <Service: ckan> has upstream errors - not processing
compose.parallel.parallel_execute_iter: Failed: <Service: ckan>

Can anyone tell me how to find out what causes this? The errors are not really meaningful it seems, how can I find out what file or directory it is missing?

chbla
  • 357
  • 1
  • 4
  • 11
  • 1
    Could you show your `docker-compose` file? – geostocker Aug 13 '18 at 08:22
  • Sure, this is the docker-compose file (of ckan): https://github.com/ckan/ckan/blob/ckan-2.8.1/contrib/docker/docker-compose.yml – chbla Aug 13 '18 at 08:36
  • I'm not at my desk atm, but will have a closer look in about 30 min. Could you make sure the path to the dockerfile that `db` uses actually exists? I can't find contrib in the root of the directory. Might be an issue when trying to create the container. – geostocker Aug 13 '18 at 08:41
  • Thanks for the help! The file is: `context: ../../ dockerfile: contrib/docker/postgresql/Dockerfile` which exists – chbla Aug 13 '18 at 08:45
  • Nevermind, no need to try. I removed everyhing as it was working for a colleague, completely reinstalled docker and it's fine again. Weird.. – chbla Aug 13 '18 at 09:48
  • Haha, strange. Glad it sorted itself out! :) – geostocker Aug 13 '18 at 09:51
  • check your volum in docker compose file – Saurabh Chandra Patel Jun 25 '20 at 08:53

8 Answers8

37

i had the same issue when i deleted the directory manually

rm -fr /var/lib/docker/volumes/[your_volume]

The solution for me was to delete the volume in docker First list the existing volume

docker volume ls

find the one you want to delete then

docker volume rm [your_volume]

Then i was able to do the docker-compose

triton oidc
  • 523
  • 5
  • 13
  • 1
    I had the same problem. I deleted the directory manually But the solution was execute *docker volume prune* instead *docker volume rm [volume_name]* . When I tried *docker volume rm [volume_name]* this command didnt remove any volume – remat_br May 18 '20 at 00:32
16

try :

docker volume prune

docker system prune

it works for me after deleting volume from : /var/lib/docker/volumes/[MY-VOLUME]

Khalil Meg
  • 731
  • 10
  • 14
0

enter image description here

Add Working project inside file sharing resource.

Achala Dissanayake
  • 810
  • 3
  • 16
  • 33
Rassoni
  • 19
  • 4
0

Adding required directory into file sharing resources solved my problem!!!

Docker Desktop -> Settings -> Resources -> File Sharing -> Add required directory in which yml file is located to up

Prakash
  • 19
  • 8
0

restarting my laptop helped in my special case, the docker commands mentioned here did not but freed some disk space

Sebastian Viereck
  • 5,455
  • 53
  • 53
-2

1.cd (your run project content) 2.then run : docker-compose down (close the server关闭服务) 3.now,you can delete it。

-2

I had this issue and i got around it by re-installing Docker Desktop and it some how worked....

Hayden Sweet
  • 170
  • 1
  • 16
-6

A reinstallation docker and docker-compose resolved everything.

chbla
  • 357
  • 1
  • 4
  • 11