element-hq / element-hq/synapse

Critical error hidden in logging type INFO

Open
#14,367 0 comments 0 reactions 0 assignees View on GitHub
A-Logging O-Uncommon S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#14367](https://github.com/matrix-org/synapse/issues/14367).

---

### Description

I was trying to add an event_persister worker via docker-compose using `synapse_worker_event_persister1` as service name which also is the docker DNS record.
But apparently `_` is not allowed for event_persister host's (which IMO is a bug on its on).

The error was only visible when showing "INFO" logs

### Steps to reproduce

- add a generic worker in docker-compose.yaml with `synapse_worker_event_persister1` as name
- reference it
```yaml
instance_map:
event_persister1:
host: synapse_worker_event_persister1
port: 8034
```

- send requests and get `M_UNKNOWN: Failed to talk to event_persister1 process`
- show docker logs and see nothing

```yaml
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: WARN

handlers: [console]

disable_existing_loggers: false
```

- change root.level to INFO to finally see error

### Homeserver

self hosted

### Synapse Version

1.70.1

### Installation Method

Docker (matrixdotorg/synapse)

### Platform

linux

### Relevant log output

```shell
2022-11-04 14:19:14,311 - synapse.http.client - 455 - INFO - POST-5 - Error sending request to POST http://synapse_worker_event_persister1:8034/_synapse/replication/send_events/JfZHQlavDY: InvalidCodepoint Codepoint U+005F at position 8 of 'synapse_worker_event_persister1' not allowed
```

### Anything else that would be useful to know?

I would guess https://github.com/matrix-org/synapse/blob/7bc110a19e6de0572b0c9513726d13298b45ced2/synapse/replication/http/_base.py#L298-L300 is the code throwing the error

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.