No Logs are getting generated

Issue Description

Since the upgrade to 1.0 the server does not write logs anymore. It always says “No such file or directory (os error 2)”. I understand the issue that there is nothing but it worked earlier in the earlier version. I also tried it with a docker volume at this position like i had it in In my last setup but that didnt work also. So both with docker volume and without does not work.

Expected Behavior

Should generate logs

Reproduction Steps

setup stalwart with docker compose:

services:
app:
image: stalwartlabs/stalwart:v1.0.2
restart: unless-stopped
init: true
env_file:
- ./stalwart.env
ports:
- “25:25”
- “465:465”
- “993:993”
- “995:995”
- “4190:4190”
- “443:443”
- “8080:8080”
#dns:
# - 9.9.9.9
# - 149.112.112.112
volumes:
- etc:/etc/stalwart
- data:/var/lib/stalwart
- logs:/var/log/stalwart
networks:
- internal

volumes:
etc:
data:
logs:

networks:
internal:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: “1450”

Stalwart Version

v1.x

Installation Method

Docker

Database Backend

PostgreSQL

Blob Storage

S3-compatible

Search Engine

PostgreSQL

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

The error means the log directory is missing or not writable by the server’s user. Your volume mount at /var/log/stalwart probably doesn’t fix this because a fresh named volume is owned by root. The server also doesn’t create the directory itself.

In v1.0 the default tracer is a Log tracer with path set to /var/log/stalwart/. The server writes there only if the directory exists and is writable by the user it runs as. When it can’t write, it discards the events. The telemetry.log-error event for that failure is never written to a Log tracer. That’s why you see nothing except the OS error.

You have two ways to fix it:

  1. Use the console (recommended for Docker). The Docker docs say a container has no /var/log/stalwart/ directory and recommend the Console destination. In the WebUI, change the tracer to Stdout (or add one), then read the output with docker logs. You can also add a Stdout tracer at level warn next to the Log tracer to see these write errors.
  2. Keep file logging. Make sure the logs volume is writable by the container’s user. Check the ownership of the mounted directory, for example with docker compose exec app ls -ld /var/log/stalwart. Fix it with chown or by pre-creating the volume with the right ownership. The WebUI log viewer reads the directory of the first enabled Log tracer, so file logging is needed if you want to view logs there.

Docs:

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

The 1.0 image has a different layout from the old one: there is no /opt/stalwart any more and no /var/log/stalwart either, and the server never creates the log directory itself. A log file tracer whose directory is missing fails with exactly that No such file or directory. The error line also names the path it tried; if it still points at the old location (something like /opt/stalwart/logs), the tracer came over from your previous setup unchanged, and mounting a volume at /var/log/stalwart won’t help because nothing writes there.

In a container the usual choice is the console tracer, read with docker compose logs app. You can add it under Settings > Telemetry > Tracers (Console tracer) and remove or disable the file one.

If you want files, for example to read them in the WebUI log viewer, keep your logs:/var/log/stalwart volume and point the tracer’s path at /var/log/stalwart. Docker creates that volume owned by root while the server runs as the stalwart user (uid 2000), so give it the directory once and restart:

docker compose exec -u root app chown 2000:2000 /var/log/stalwart
docker compose restart app