Skip to content

Cannot start on docker for windows (prometheus crashed)

Created by: remcoros

  • Sourcegraph version: 3.9.2
  • Platform information: Windows 10 + Docker for win (latest)

Steps to reproduce:

  1. Try running the docker container, in my case:

    docker run -e LOGO=false -e SRC_SKIP_REQS="Rlimit" --dns 8.8.8.8 --publish 7080:7080 --publish 2633:2633 --rm --volume sourcegraph_config:/etc/sourcegraph --volume sourcegraph_data:/var/opt/sourcegraph -m 4GB sourcegraph/server:3.9.4

  2. It crashes

Expected behavior:

It starts succesfully

Actual behavior:

It crashes with the following message:

C:\tools>docker run -e LOGO=false -e SRC_SKIP_REQS="Rlimit" --dns 8.8.8.8 --publish 7080:7080 --publish 2633:2633 --rm --volume sourcegraph_config:/etc/sourcegraph --volume sourcegraph_data:/var/opt/sourcegraph -m 4GB sourcegraph/server:3.9.4
14:58:03    zoekt-webserver | 2019/11/13 14:58:03 listening on 127.0.0.1:3070
14:58:04         prometheus | Terminating prometheus
prometheus died. Shutting down...
14:58:04       repo-updater | Terminating repo-updater
14:58:04            symbols | Terminating symbols
14:58:04       query-runner | Terminating query-runner
14:58:04          gitserver | Terminating gitserver
...
...

Excerpt from prometheus.log

level=error ts=2019-11-13T14:58:03.986Z caller=query_logger.go:94 component=activeQueryTracker msg="Failed to mmap" file=/var/opt/sourcegraph/prometheus/queries.active Attemptedsize=20001 err="invalid argument"
panic: Unable to create mmap-ed active query log

Possible cause is the "active queries" feature from prometheus, this uses a memory-mapped file (mmap), but I think this is not supported on docker for windows using shared volumes (the data and config volumes).

I tried looking for a work-around, but am not too experienced with docker and could not find any real solution (yet) online.