matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.75k stars 676 forks source link

Log permission denied issue when trying to get started #1644

Closed MadLittleMods closed 3 years ago

MadLittleMods commented 3 years ago

Running through the "get started" section in the readme on a fresh macbook results in a permission error when it tries to write some logs.

$ ./bin/dendrite-monolith-server --tls-cert server.crt --tls-key server.key --config dendrite.yaml
FATA[2020-12-16T06:39:03.379411000Z] [github.com/matrix-org/dendrite/internal/log.go:155] setupFileHook
Couldn't create directory /var/log/dendrite: "mkdir /var/log/dendrite: permission denied"

It seems necessary to use sudo when launching Dendrite to get it to work out of the box.

Can the log directory be configured?

Yes, this can be configured in your dendrite.yaml config under logging

Potential solutions

  1. Update the readme instructions to note about changing the config for logging in addition to the server_name
  2. Update the log directory to default somewhere with permissions like in the project itself.
kegsay commented 3 years ago

We really shouldn't be using /var/log at all as a log location imo. ./logs would be better since we'll be more likely to be able to write to it.