[GH-ISSUE #134] Docker Image fails to run with MP_DATA_FILE set #92

Closed
opened 2026-03-15 12:30:32 +03:00 by kerem · 6 comments
Owner

Originally created by @tminich on GitHub (Jun 28, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/134

First let me prefix that I'm not well-versed in Docker, so this might be because I'm doing something wrong. But, to my understanding of the docs, this should be working.

Here is the service from my docker-compose.yml:

  mailpit:
    image: 'axllent/mailpit:latest'
    container_name: "mailpit"
    environment:
      - TZ="Europe/Berlin"
      - MP_DATA_FILE="/data/mailpit.db"
    restart: always
    ports:
      - '1025:1025'
      - '9000:8025'
    networks:
      - proxy
    volumes:
      - './data/mailpit:/data'
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

The service keeps restarting logging

2023-06-28 12:08:10 ERRO[2023/06/28 10:08:10] unable to open database file: out of memory (14)
Originally created by @tminich on GitHub (Jun 28, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/134 First let me prefix that I'm not well-versed in Docker, so this might be because I'm doing something wrong. But, to my understanding of the docs, this should be working. Here is the service from my `docker-compose.yml`: ```yaml mailpit: image: 'axllent/mailpit:latest' container_name: "mailpit" environment: - TZ="Europe/Berlin" - MP_DATA_FILE="/data/mailpit.db" restart: always ports: - '1025:1025' - '9000:8025' networks: - proxy volumes: - './data/mailpit:/data' labels: - "com.centurylinklabs.watchtower.enable=true" ``` The service keeps restarting logging ``` 2023-06-28 12:08:10 ERRO[2023/06/28 10:08:10] unable to open database file: out of memory (14) ```
kerem closed this issue 2026-03-15 12:30:38 +03:00
Author
Owner

@axllent commented on GitHub (Jun 28, 2023):

I got the same ~ though - MP_DATA_FILE=/data/mailpit.db (without quotes) works fine. It must be a docker-compose thing :)

<!-- gh-comment-id:1611166247 --> @axllent commented on GitHub (Jun 28, 2023): I got the same ~ though `- MP_DATA_FILE=/data/mailpit.db` (without quotes) works fine. It must be a docker-compose thing :)
Author
Owner

@axllent commented on GitHub (Jun 28, 2023):

I don't use docker-compose - but from what I read the syntax should actually be different: https://docs.docker.com/get-started/08_using_compose/

    environment:
      TZ: Europe/Berlin
      MP_DATA_FILE: /data/mailpit.db
<!-- gh-comment-id:1611169108 --> @axllent commented on GitHub (Jun 28, 2023): I don't use docker-compose - but from what I read the syntax should actually be different: https://docs.docker.com/get-started/08_using_compose/ ```yaml environment: TZ: Europe/Berlin MP_DATA_FILE: /data/mailpit.db ```
Author
Owner

@tminich commented on GitHub (Jun 28, 2023):

Ah thanks, I did not expect that to matter XD.

<!-- gh-comment-id:1611186219 --> @tminich commented on GitHub (Jun 28, 2023): Ah thanks, I did not expect that to matter XD.
Author
Owner

@mbuchner commented on GitHub (Apr 20, 2024):

Don't think this is only the configuration style - since v1.15.1it is also not working for me. I didn't test v1.16.

v1.17.0 also displays this error to me - same setting worked with v1.15.1!

I use it with compose:

  mailpit:
    image: axllent/mailpit:v1.17.0
    environment:
      MP_UI_AUTH: 'user:password'
      MP_WEBROOT: 'fakemail'
      MP_MAX_MESSAGES: 500
      MP_DATABASE: /data/mailpit.db
    ports:
      - 1025:1025/tcp
      - 8025:8025/tcp

and Kubernetes:

...
      containers:
        - image: axllent/mailpit:v1.17.0
          name: my-fakemail
          env:
            - name: MP_UI_AUTH
              value: "user:password"
            - name: MP_WEBROOT
              value: "fakemail"
            - name: MP_MAX_MESSAGES
              value: "1000"
            - name: MP_DATABASE
              value: "/data/mailpit.db"
          ports:
            - containerPort: 1025
            - containerPort: 8025
....
....

Both are not working anymore - showing:
time="2024/04/20 19:09:13" level=error msg="[db] unable to open database file: out of memory (14)"

When I disable the setting "MP_DATABASE" and just keep the rest -> everything works fine

<!-- gh-comment-id:2067758862 --> @mbuchner commented on GitHub (Apr 20, 2024): Don't think this is only the configuration style - since v1.15.1it is also not working for me. I didn't test v1.16. v1.17.0 also displays this error to me - same setting worked with v1.15.1! I use it with compose: ``` mailpit: image: axllent/mailpit:v1.17.0 environment: MP_UI_AUTH: 'user:password' MP_WEBROOT: 'fakemail' MP_MAX_MESSAGES: 500 MP_DATABASE: /data/mailpit.db ports: - 1025:1025/tcp - 8025:8025/tcp ``` and Kubernetes: ``` ... containers: - image: axllent/mailpit:v1.17.0 name: my-fakemail env: - name: MP_UI_AUTH value: "user:password" - name: MP_WEBROOT value: "fakemail" - name: MP_MAX_MESSAGES value: "1000" - name: MP_DATABASE value: "/data/mailpit.db" ports: - containerPort: 1025 - containerPort: 8025 .... .... ``` Both are not working anymore - showing: time="2024/04/20 19:09:13" level=error msg="[db] unable to open database file: out of memory (14)" When I disable the setting "MP_DATABASE" and just keep the rest -> everything works fine
Author
Owner

@axllent commented on GitHub (Apr 20, 2024):

@mbuchner Oh no, that's not good. Does the /data directory exist and is it local and writeable? Please open a new issue if you are unable to resolve it.

Edit: Confirmed - you do not have a volume in /data in your container, so that path does not exist and Mailpit fails to create the database. I will be updating the error messages to make these kinds of things clearer, however in the meantime please see the example on https://mailpit.axllent.org/docs/install/docker/ which includes the volume in the config.

<!-- gh-comment-id:2067766609 --> @axllent commented on GitHub (Apr 20, 2024): @mbuchner Oh no, that's not good. Does the `/data` directory exist and is it local and writeable? Please open a new issue if you are unable to resolve it. Edit: Confirmed - you do not have a volume in `/data` in your container, so that path does not exist and Mailpit fails to create the database. I will be updating the error messages to make these kinds of things clearer, however in the meantime please see the example on https://mailpit.axllent.org/docs/install/docker/ which includes the volume in the config.
Author
Owner

@mbuchner commented on GitHub (Apr 22, 2024):

The thing is that I don’t want a volume (don’t have a volume) available - I just wanted a "persistent" DB as long as it is the same container ... DB survives normal restarts - but gets cleaned when image / container is recreated ...

Probably /tmp/mailpit.db works - I will test ...

+1 for improving the error message ;-)

<!-- gh-comment-id:2068846464 --> @mbuchner commented on GitHub (Apr 22, 2024): The thing is that I don’t want a volume (don’t have a volume) available - I just wanted a "persistent" DB as long as it is the same container ... DB survives normal restarts - but gets cleaned when image / container is recreated ... Probably /tmp/mailpit.db works - I will test ... +1 for improving the error message ;-)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#92
No description provided.