-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Default generated logger config causes "Permission denied: '/homeserver.log'" for non-root containers #9970
Comments
Same problem. I've edited the logging strategy as-is to make it work :
|
Logging to |
@erikjohnston Why don't you put it under |
@erikjohnston I think standard practice would be to only log to Correct me if I'm wrong, but backward compatibility shouldn't be affected since running in "on-the-fly I ran Synapse for the first time a couple of days ago and from reading the docs, I was under the impression that running Synapse as container would be done by running in "generate mode" only. So I tripped over the following: Lines 235 to 239 in e550ab1
So it's more about the first-time experience when initially generating the logger config. Typically when running Synapse as a container, the Line 145 in e550ab1
So I think we have two options:
I like 1) more. |
I would also expect logging to be directed to stdout by default, as people generally rely on Docker's logging system rather than inspecting files in mounts. |
I'm going to peer out from behind my dunce's cap here and admit this one has me stumped. I'm new to docker and even newer to Matrix Synapse but I wanted to set up a small homeserver. At this stage of my knowledge, if the instructions don't explicitly work then I'm in a fix. I usually drop into the containers (?) via an interactive shelll and tinker but I can't do that from here. Sorry to be so ignorant, but how do I get into a docker container thing to make these changes? Or is there some other way I can fire Synapse up without going through all that rigmarole? |
This currently breaks the installation of anyone trying to install Synapse the first time using Docker, could you please change the default to This issue really requires a quick fix as the Synapse Docker guide currently does not work due to this problem. |
Yep, I just went through the installation today and ran into this problem. I just disabled file logging completely since Docker catches the console output. |
Haven't tested again but this also crashed my container because despite file logging disabled, an empty log file was created. |
@schnerring i also didn't have luck disabling logs, but my work around was just to change the log file to /dev/null, and reduce the number of backups to 0. Works so far! |
If it helps, this is my log config: version: 1
formatters:
precise:
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
handlers:
console:
class: logging.StreamHandler
formatter: precise
loggers:
synapse.storage.SQL:
# beware: increasing this to DEBUG will make synapse log sensitive
# information such as access tokens.
level: INFO
root:
level: INFO
handlers: [console]
disable_existing_loggers: false |
Hi all I have the same problem. |
The log settings should be in |
Ok its working thank you. |
That I don't know, I also don't think it's appropriate to discuss this here. |
I'm very confused. I thought this was the default, per synapse/docker/conf/log.config Lines 46 to 50 in 1171b98
|
ok I see. The problem is that the This seems to have been introduced by #9162, which landed in Synapse 1.33.0. |
@schnerring wrote:
This appears to be incorrect - or if it's correct, it's a different problem to what everybody else is talking about. When running with |
Fixes #9970 Signed-off-by: Sergio Miguéns Iglesias lonyelon@lony.xyz
i have also have this problem `
element: synapse: networks: |
Same issue here with current Synapse version. |
@appdroidbuilder @pReya Can you please post the error message you are seeing and the Synapse version number? |
I don't see how this issue is still happening as-is and no recent reporters have stepped up to say what error message is appearing or what version of Synapse is in use, so I'll close this for now. If you have details, please ask to reopen or file a new issue linking to this one. |
People may have copied the old homeserver.yaml after changing their server_name instead of generating a new homeserver.yaml? At least that's what I did and only changed server_name considering the rest irrelevant or more related to what domain synapse will actually be hosted at as I want usernames with top domain but the actual software must not run on the top domain. Then log_config line must correspond to this new server_name, otherwise it will create a default log_config file and that'll have the offending configuration That was my problem anyway, entirely user error I'd say. Or generally the synapse configuration is not "forgiving" or fool-proof :D |
Іан дика хуьлда хьан, хьан цIе хIун ганза хIаъ |
Check your log config location thoroughly if you get the permission denied error! Well, I fell into a very similar trap while following a tutorial on "Install Matrix Home Server On Kubernetes" by Vincze Janos. I didn't correct the path of the log config in |
Description
Using
generate
to create config files with the Docker image sets the value ofhandlers.file.filename
inside the*.log.config
file to/homeserver.log
, causing the following error when running the container as non-root:Changing it to
/data/homeserver.log
fixes the issue since thesynapse
user has write access to that folder.Unfortunately it's not enough to disable the
file
loghandler
. Even when disabled an empty log file is initially created.Steps to reproduce
generate
Version information
If not matrix.org:
Version: v1.33.1
Install method: Docker Image
Platform: Kubernetes
Cause
The issue lies within how the log config is generated (https://github.com/matrix-org/synapse/blob/develop/synapse/config/logger.py#L171-L180):
which calls:
Since the container runs
start.py
in/
, the above resolves to/homeserver.log
The text was updated successfully, but these errors were encountered: