Start Db from docker-compose

Hi,

I try to launch an evenstore 20 from docker-compose :
My config file is

    version: '3.4'

services:
  eventstore.db:
    image: eventstore/eventstore:20.6.1-buster-slim
    environment:
      - EVENTSTORE_CLUSTER_SIZE=1
      - EVENTSTORE_RUN_PROJECTIONS=All
      - EVENTSTORE_START_STANDARD_PROJECTIONS=true
      - EVENTSTORE_INSECURE=true
      - EVENTSTORE_ENABLE_EXTERNAL_TCP=false
      - EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
      - EVENTSTORE_EXT_IP=195.xxx.xxx.xxx
      - EVENTSTORE_INT_TCP_PORT=1112
      - EVENTSTORE_EXT_TCP_PORT=1113
      - EVENTSTORE_INT_HTTP_PORT=2112
      - EVENTSTORE_EXT_HTTP_PORT=2113
      - EVENTSTORE_LOG=/data/logs
      - EVENTSTORE_DB=/data/db


    ports:
      - "1112:1112"
      - "1113:1113"
      - "2112:2112"
      - "2113:2113"

    volumes:
      - "/var/lib/evenstore/data:/data/db"
      - "/var/lib/evenstore/logs:/data/logs"
    ulimits:
      nofile:
        soft: 32000
        hard: 32000

when i start it i have this exception :

eventstore.db_1 | System.UnauthorizedAccessException: Access to the path ‘/data/db/writer.chk’ is denied.
eventstore.db_1 | —> System.IO.IOException: Permission denied
eventstore.db_1 | — End of inner exception stack trace —
eventstore.db_1 | at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func2 errorRewriter) eventstore.db_1 | at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) eventstore.db_1 | at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) eventstore.db_1 | at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) eventstore.db_1 | at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) eventstore.db_1 | at EventStore.Core.TransactionLog.Checkpoint.MemoryMappedFileCheckpoint..ctor(String filename, String name, Boolean cached, Boolean mustExist, Int64 initValue) in /build/src/EventStore.Core/TransactionLog/Checkpoint/MemoryMappedFileCheckpoint.cs:line 31 eventstore.db_1 | at EventStore.Core.VNodeBuilder.CreateDbConfig(Int32 chunkSize, Int32 cachedChunks, String dbPath, Int64 chunksCacheSize, Boolean inMemDb, Boolean unbuffered, Boolean writethrough, Int32 chunkInitialReaderCount, Int32 chunkMaxReaderCount, Boolean optimizeReadSideCache, Boolean reduceFileCachePressure, Int64 maxTruncation, ILogger log) in /build/src/EventStore.Core/VNodeBuilder.cs:line 1584 eventstore.db_1 | at EventStore.Core.VNodeBuilder.Build(IOptions options, IPersistentSubscriptionConsumerStrategyFactory[] consumerStrategies) in /build/src/EventStore.Core/VNodeBuilder.cs:line 1375 eventstore.db_1 | at EventStore.ClusterNode.ClusterVNodeHostedService.BuildNode(ClusterNodeOptions options, Func1 loadConfigFunc) in /build/src/EventStore.ClusterNode/ClusterVNodeHostedService.cs:line 163
eventstore.db_1 | at EventStore.ClusterNode.ClusterVNodeHostedService.Create(ClusterNodeOptions opts) in /build/src/EventStore.ClusterNode/ClusterVNodeHostedService.cs:line 144
eventstore.db_1 | at EventStore.Core.EventStoreHostedService`1…ctor(String[] args) in /build/src/EventStore.Core/EventStoreHostedService.cs:line 45
eventstore.db_1 | at EventStore.ClusterNode.ClusterVNodeHostedService…ctor(String[] args) in /build/src/EventStore.ClusterNode/ClusterVNodeHostedService.cs:line 35
eventstore.db_1 | at EventStore.ClusterNode.Program.Main(String[] args) in /build/src/EventStore.ClusterNode/Program.cs:line 22

What should i do to fix that ?
Thx for your answers.

The issue is when you run your docker-compose file, you don’t have the right permission on your machine for either of those files:

  • /var/lib/evenstore/data
  • /var/lib/evenstore/logs

yes thx i understand this when i read better the log :confused: