ERROR: Garbage collection log directory '/data/log' does not exist or is not accessible

Hi, I’m new to cratedb, testing it in a docker container. It crashes by start with the subject error

Do I miss some parameter or mapping?
the cratedb part of my docker-compose.yaml looks like this:

   cratedb:
     container_name: cratedb
     image: crate:5.2
     volumes:
       - ./data/cratedb:/data
     ports:
       - 4200:4200
       - 5433:5432 # postresql

This looks like a permission problem with the volume.
Can docker access/has the right permissions for ./data/cratedb

What host system are you running docker on?

debian linux, no wsl or alike. The folders after the try are created and empty.

❯ find data/cratedb/
data/cratedb/
data/cratedb/data
data/cratedb/log

I have the same problem. Directories are created by the container, but then exact the same message comes. chmod 777 also didn’t help… it started with version 5.2. With version 5.1.4 it works fine.

1 Like

Could you maybe provide a bit more context on your setups?

I just tried to replicate this with a fresh Ubuntu LTS 22 VM (Hetzner), and could not replicate this:

$ docker-compose up
Pulling cratedb (crate:5.2)...
5.2: Pulling from library/crate
Digest: sha256:d8b7b78061042082d39825355ceb52fafd211cfe487b79f3d706d5657801e760
Status: Downloaded newer image for crate:5.2
Creating cratedb ... done
Attaching to cratedb
cratedb    | mkdir: created directory '/data/log'
cratedb    | mkdir: created directory '/data/data'
cratedb    | Mar 13, 2023 4:25:09 PM org.apache.lucene.store.MemorySegmentIndexInputProvider <init>
cratedb    | INFO: Using MemorySegmentIndexInput with Java 19+
cratedb    | [2023-03-13T16:25:09,450][INFO ][o.e.e.NodeEnvironment    ] [Dosson di Genova] using [1] data paths, mounts [[/data (/dev/sda1)]], net usable_space [140.5gb], net total_space [149.9gb], types [ext4]
cratedb    | [2023-03-13T16:25:09,452][INFO ][o.e.e.NodeEnvironment    ] [Dosson di Genova] heap size [512mb], compressed ordinary object pointers [true]
cratedb    | [2023-03-13T16:25:09,488][INFO ][o.e.n.Node               ] [Dosson di Genova] node name [Dosson di Genova], node ID [zWqCdsoiQJS9uxSIowMvHg], cluster name [crate]
cratedb    | [2023-03-13T16:25:09,503][INFO ][o.e.n.Node               ] [Dosson di Genova] version[5.2.3], pid[1], build[22edf87/2023-02-23T18:10:29Z], OS[Linux/5.15.0-67-generic/amd64], JVM[Eclipse Adoptium/OpenJDK 64-Bit Server VM/19.0.2/19.0.2+7]
cratedb    | [2023-03-13T16:25:10,497][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] no modules loaded
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [cr8-copy-s3]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [crate-functions]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [crate-jmx-monitoring]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [crate-lang-js]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [es-analysis-common]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [es-analysis-phonetic]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [es-repository-azure]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [io.crate.plugin.SrvPlugin]
cratedb    | [2023-03-13T16:25:10,499][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [io.crate.udc.plugin.UDCPlugin]
cratedb    | [2023-03-13T16:25:10,500][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [org.elasticsearch.discovery.ec2.Ec2DiscoveryPlugin]
cratedb    | [2023-03-13T16:25:10,500][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [org.elasticsearch.plugin.repository.url.URLRepositoryPlugin]
cratedb    | [2023-03-13T16:25:10,500][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [org.elasticsearch.repositories.s3.S3RepositoryPlugin]
cratedb    | [2023-03-13T16:25:10,500][INFO ][o.e.p.PluginsService     ] [Dosson di Genova] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
cratedb    | SLF4J: No SLF4J providers were found.
cratedb    | SLF4J: Defaulting to no-operation (NOP) logger implementation
cratedb    | SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
cratedb    | [2023-03-13T16:25:11,544][INFO ][o.e.d.DiscoveryModule    ] [Dosson di Genova] using discovery type [zen] and seed hosts providers [settings]
cratedb    | [2023-03-13T16:25:12,847][INFO ][psql                     ] [Dosson di Genova] PSQL SSL support is disabled.
cratedb    | [2023-03-13T16:25:13,211][INFO ][i.c.n.c.PipelineRegistry ] [Dosson di Genova] HTTP SSL support is disabled.
cratedb    | [2023-03-13T16:25:13,247][WARN ][o.e.g.DanglingIndicesState] [Dosson di Genova] gateway.auto_import_dangling_indices is disabled, dangling indices will not be detected or imported
cratedb    | [2023-03-13T16:25:13,327][INFO ][o.e.n.Node               ] [Dosson di Genova] initialized
cratedb    | [2023-03-13T16:25:13,328][INFO ][o.e.n.Node               ] [Dosson di Genova] starting ...
cratedb    | [2023-03-13T16:25:13,444][INFO ][psql                     ] [Dosson di Genova] publish_address {172.17.0.2:5432}, bound_addresses {127.0.0.1:5432}, {172.17.0.2:5432}
cratedb    | [2023-03-13T16:25:13,463][INFO ][o.e.h.n.Netty4HttpServerTransport] [Dosson di Genova] publish_address {172.17.0.2:4200}, bound_addresses {127.0.0.1:4200}, {172.17.0.2:4200}
cratedb    | [2023-03-13T16:25:13,481][INFO ][o.e.t.TransportService   ] [Dosson di Genova] publish_address {172.17.0.2:4300}, bound_addresses {127.0.0.1:4300}, {172.17.0.2:4300}
cratedb    | [2023-03-13T16:25:13,664][INFO ][o.e.b.BootstrapChecks    ] [Dosson di Genova] bound or publishing to a non-loopback address, enforcing bootstrap checks
cratedb    | [2023-03-13T16:25:13,674][INFO ][o.e.c.c.ClusterBootstrapService] [Dosson di Genova] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
cratedb    | [2023-03-13T16:25:16,681][INFO ][o.e.c.c.Coordinator      ] [Dosson di Genova] setting initial configuration to VotingConfiguration{zWqCdsoiQJS9uxSIowMvHg}
cratedb    | [2023-03-13T16:25:16,788][INFO ][o.e.c.s.MasterService    ] [Dosson di Genova] elected-as-master ([1] nodes joined)[{Dosson di Genova}{zWqCdsoiQJS9uxSIowMvHg}{fgHmSKLOTq-S2effqyW-JA}{172.17.0.2}{172.17.0.2:4300}{dm}{http_address=172.17.0.2:4200} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 1, version: 1, reason: master node changed {previous [], current [{Dosson di Genova}{zWqCdsoiQJS9uxSIowMvHg}{fgHmSKLOTq-S2effqyW-JA}{172.17.0.2}{172.17.0.2:4300}{dm}{http_address=172.17.0.2:4200}]}
cratedb    | [2023-03-13T16:25:16,840][INFO ][o.e.c.c.CoordinationState] [Dosson di Genova] cluster UUID set to [i3OlD0_GSRGTM9O3_n3EZA]
cratedb    | [2023-03-13T16:25:16,870][INFO ][o.e.c.s.ClusterApplierService] [Dosson di Genova] master node changed {previous [], current [{Dosson di Genova}{zWqCdsoiQJS9uxSIowMvHg}{fgHmSKLOTq-S2effqyW-JA}{172.17.0.2}{172.17.0.2:4300}{dm}{http_address=172.17.0.2:4200}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
cratedb    | [2023-03-13T16:25:16,885][INFO ][o.e.n.Node               ] [Dosson di Genova] started
cratedb    | [2023-03-13T16:25:16,925][INFO ][o.e.g.GatewayService     ] [Dosson di Genova] recovered [0] indices into cluster_state
1 Like

Hi.

I am not sure if this detail can contribute anything to the investigation of this issue, but there may be a slight chance.

The difference between both versions, with respect to the OCI image published to Docker Hub, is, that we switched from CentOS Linux 7 to AlmaLinux 9.1.

$ docker run --rm crate:5.1 cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
$ docker run --rm crate:5.2 cat /etc/os-release
NAME="AlmaLinux"
VERSION="9.1 (Lime Lynx)"

Could this be related to the problem @vilinski and @Andreas_Vogler are observing? Can we humbly ask you both to share more details about your environments, like host OS and version, Docker and Docker Compose version, etc.?

With kind regards,
Andreas.

Also on a fresh Debian 11 install it works for me:

# docker-compose up
Starting cratedb ... done
Attaching to cratedb
cratedb    | mkdir: created directory '/data/log'
cratedb    | mkdir: created directory '/data/data'
cratedb    | Mar 13, 2023 4:44:13 PM org.apache.lucene.store.MemorySegmentIndexInputProvider <init>
cratedb    | INFO: Using MemorySegmentIndexInput with Java 19+
...

are you altering the users in the compose file?

1 Like

Hi, I am running Docker version 18.09.1, build 4c52b90 on Debian 10.13

When I start the container, the directories are created with my user as owner. I also have already tried to change the permissions to 777 on the directories and restart the container. But also this did not help.

Here is my docker-compose file - here still with 5.1.4

version: '3.8'
services:
  node01:
    image: crate:5.1.4
    ports:
      - "4201:4200"
      - "4301:4300"
      - "5434:5432"
    volumes:
      - ./data/01:/data
    command: ["crate",
              "-Ccluster.name=crate-docker-cluster",
              "-Cdiscovery.seed_hosts=node02",
              "-Cnode.name=node01",
              "-Cnode.data=true",
              "-Cnetwork.host=_site_",
              "-Cgateway.expected_data_nodes=2",
              "-Cgateway.recover_after_data_nodes=2",
              "-Ccluster.initial_master_nodes=node01,node02"]
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    environment:
      - CRATE_HEAP_SIZE=4g

  node02:
    image: crate:5.1.4
    ports:
      - "4202:4200"
      - "4302:4300"
    volumes:
      - ./data/02:/data
    command: ["crate",
              "-Ccluster.name=crate-docker-cluster",
              "-Cdiscovery.seed_hosts=node01",
              "-Cnode.name=node02",
              "-Cnode.data=true",
              "-Cnetwork.host=_site_",
              "-Cgateway.expected_data_nodes=2",
              "-Cgateway.recover_after_data_nodes=2",
              "-Ccluster.initial_master_nodes=node01,node02"]
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    environment:
      - CRATE_HEAP_SIZE=4g
1 Like

I tried now almalinux, just to see if this works without CrateDB.
docker run -it --name test -v $PWD/test:/test almalinux bash
With that I was able to create files in the volume.

1 Like

Hi Andreas,

thanks for your reply, and thanks for sharing your Docker Compose file.

That is quite old, right? We would have to exercise if that might be responsible, because @proddata already verified it works well on more recent environments.

With kind regards,
Andreas.

Hi Andreas,
it comes with Debian 10.13. Could be the issue. But I am a bit scared to upgrade my box to Debian 11… will have a lot of work if something will go wrong :slight_smile: Maybe I can get docker from docker repository and upgrade docker only… will think about it.
Thank you very much for your support! :+1:
regards,
Andreas

1 Like

I have upgraded to Docker version 23.0.1, build a5ee5b1 and it works now! :+1: Thanks for the hint!
regards,
Andreas

3 Likes