Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix typo in #13320 which could cause log spam #14347

Merged
merged 2 commits into from
Nov 1, 2022

Conversation

DMRobertson
Copy link
Contributor

The typo causes logger.info(...) to fail. Stdlib(?) logging describes the failure on stderr, which ends up getting reported as multiple events in Sentry.

This causes `logger.info()` to fail. Stdlib(?) logging describes the
failure on stderr, which ends up getting reported as an event in Sentry.
@DMRobertson DMRobertson requested a review from a team as a code owner November 1, 2022 18:34
@DMRobertson DMRobertson added A-Logging Synapse's logs (structured or otherwise). Not metrics. Z-Sentry Issue was discovered by looking at Sentry reports on Matrix.org labels Nov 1, 2022
@DMRobertson
Copy link
Contributor Author

(I'm trying to see if I can get pylint to look for other instances of this problem.)

@DMRobertson DMRobertson enabled auto-merge (squash) November 1, 2022 18:37
@DMRobertson
Copy link
Contributor Author

(I'm trying to see if I can get pylint to look for other instances of this problem.)

From https://pylint.pycqa.org/en/latest/user_guide/checkers/features.html#logging-checker I concocted:

$ pylint --disable=all --enable=E1201,E1206,E1205,E1200,W1202,W1203,W1201 -j0 synapse

which spotted the error (and thankfully no others).

************* Module synapse.federation.federation_client
synapse/federation/federation_client.py:467:20: E1205: Too many arguments for logging format string (logging-too-many-args)

There were a bunch of warnings though:

************* Module synapse.app.phone_stats_home
synapse/app/phone_stats_home.py:156:4: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.federation.federation_server
synapse/federation/federation_server.py:884:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
************* Module synapse.handlers.pagination
synapse/handlers/pagination.py:289:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.handlers.appservice
synapse/handlers/appservice.py:448:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
synapse/handlers/appservice.py:490:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.handlers.sso
synapse/handlers/sso.py:1080:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
************* Module synapse.handlers.room_member
synapse/handlers/room_member.py:1350:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.handlers.send_email
synapse/handlers/send_email.py:206:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.handlers.message
synapse/handlers/message.py:1953:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
synapse/handlers/message.py:1999:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.handlers.sync
synapse/handlers/sync.py:2439:20: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.handlers.saml
synapse/handlers/saml.py:119:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.metrics
synapse/metrics/__init__.py:117:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
synapse/metrics/__init__.py:243:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.http.matrixfederationclient
synapse/http/matrixfederationclient.py:488:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
************* Module synapse.http.client
synapse/http/client.py:194:20: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
synapse/http/client.py:298:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
synapse/http/client.py:744:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.push.mailer
synapse/push/mailer.py:124:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.handlers.oidc
synapse/handlers/oidc.py:523:20: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
synapse/handlers/oidc.py:755:20: W1202: Use lazy % formatting in logging functions (logging-format-interpolation)
synapse/handlers/oidc.py:1237:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
synapse/handlers/oidc.py:1628:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.rest.admin.media
synapse/rest/admin/media.py:321:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.rest.media.v1.media_repository
synapse/rest/media/v1/media_repository.py:899:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
synapse/rest/media/v1/media_repository.py:915:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
************* Module synapse.storage.databases.main.user_directory
synapse/storage/databases/main/user_directory.py:237:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
synapse/storage/databases/main/user_directory.py:372:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.rest.media.v1.preview_url_resource
synapse/rest/media/v1/preview_url_resource.py:351:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
************* Module synapse.storage.databases.main.monthly_active_users
synapse/storage/databases/main/monthly_active_users.py:328:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)

@DMRobertson DMRobertson merged commit d4fac8a into develop Nov 1, 2022
@DMRobertson DMRobertson deleted the dmr/fix-logging-typo branch November 1, 2022 19:20
bradtgmurray added a commit to beeper/synapse-legacy-fork that referenced this pull request Nov 22, 2022
Synapse 1.72.0 (2022-11-22)
===========================

Please note that Synapse now only supports PostgreSQL 11+, because PostgreSQL 10 has reached end-of-life, c.f. our [Deprecation Policy](https://github.com/matrix-org/synapse/blob/develop/docs/deprecation_policy.md).

Bugfixes
--------

- Update forgotten references to legacy metrics in the included Grafana dashboard. ([\matrix-org#14477](matrix-org#14477))

Synapse 1.72.0rc1 (2022-11-16)
==============================

Features
--------

- Add experimental support for [MSC3912](matrix-org/matrix-spec-proposals#3912): Relation-based redactions. ([\matrix-org#14260](matrix-org#14260))
- Build Debian packages for Ubuntu 22.10 (Kinetic Kudu). ([\matrix-org#14396](matrix-org#14396))
- Add an [Admin API](https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/index.html) endpoint for user lookup based on third-party ID (3PID). Contributed by @ashfame. ([\matrix-org#14405](matrix-org#14405))
- Faster joins: include heroes' membership events in the partial join response, for rooms without a name or canonical alias. ([\matrix-org#14442](matrix-org#14442))

Bugfixes
--------

- Faster joins: do not block creation of or queries for room aliases during the resync. ([\matrix-org#14292](matrix-org#14292))
- Fix a bug introduced in Synapse 1.64.0rc1 which could cause log spam when fetching events from other homeservers. ([\matrix-org#14347](matrix-org#14347))
- Fix a bug introduced in 1.66 which would not send certain pushrules to clients. Contributed by Nico. ([\matrix-org#14356](matrix-org#14356))
- Fix a bug introduced in v1.71.0rc1 where the power level event was incorrectly created during initial room creation. ([\matrix-org#14361](matrix-org#14361))
- Fix the refresh token endpoint to be under /r0 and /v3 instead of /v1. Contributed by Tulir @ Beeper. ([\matrix-org#14364](matrix-org#14364))
- Fix a long-standing bug where Synapse would raise an error when encountering an unrecognised field in a `/sync` filter, instead of ignoring it for forward compatibility. ([\matrix-org#14369](matrix-org#14369))
- Fix a background database update, introduced in Synapse 1.64.0, which could cause poor database performance. ([\matrix-org#14374](matrix-org#14374))
- Fix PostgreSQL sometimes using table scans for queries against the `event_search` table, taking a long time and a large amount of IO. ([\matrix-org#14409](matrix-org#14409))
- Fix rendering of some HTML templates (including emails). Introduced in v1.71.0. ([\matrix-org#14448](matrix-org#14448))
- Fix a bug introduced in Synapse 1.70.0 where the background updates to add non-thread unique indexes on receipts could fail when upgrading from 1.67.0 or earlier. ([\matrix-org#14453](matrix-org#14453))

Updates to the Docker image
---------------------------

- Add all Stream Writer worker types to `configure_workers_and_start.py`. ([\matrix-org#14197](matrix-org#14197))
- Remove references to legacy worker types in the multi-worker Dockerfile. ([\matrix-org#14294](matrix-org#14294))

Improved Documentation
----------------------

- Upload documentation PRs to Netlify. ([\matrix-org#12947](matrix-org#12947), [\matrix-org#14370](matrix-org#14370))
- Add addtional TURN server configuration example based on [eturnal](https://github.com/processone/eturnal) and adjust general TURN server doc structure. ([\matrix-org#14293](matrix-org#14293))
- Add example on how to load balance /sync requests. Contributed by [aceArt](https://aceart.de). ([\matrix-org#14297](matrix-org#14297))
- Edit sample Nginx reverse proxy configuration to use HTTP/1.1. Contributed by Brad Jones. ([\matrix-org#14414](matrix-org#14414))

Deprecations and Removals
-------------------------

- Remove support for PostgreSQL 10. ([\matrix-org#14392](matrix-org#14392), [\matrix-org#14397](matrix-org#14397))

Internal Changes
----------------

- Run unit tests against Python 3.11. ([\matrix-org#13812](matrix-org#13812))
- Add TLS support for generic worker endpoints. ([\matrix-org#14128](matrix-org#14128), [\matrix-org#14455](matrix-org#14455))
- Switch to a maintained action for installing Rust in CI. ([\matrix-org#14313](matrix-org#14313))
- Add override ability to `complement.sh` command line script to request certain types of workers. ([\matrix-org#14324](matrix-org#14324))
- Enabling testing of [MSC3874](matrix-org/matrix-spec-proposals#3874) (filtering of `/messages` by relation type) in complement. ([\matrix-org#14339](matrix-org#14339))
- Concisely log a failure to resolve state due to missing `prev_events`. ([\matrix-org#14346](matrix-org#14346))
- Use a maintained Github action to install Rust. ([\matrix-org#14351](matrix-org#14351))
- Cleanup old worker datastore classes. Contributed by Nick @ Beeper (@Fizzadar). ([\matrix-org#14375](matrix-org#14375))
- Test against PostgreSQL 15 in CI. ([\matrix-org#14394](matrix-org#14394))
- Remove unreachable code. ([\matrix-org#14410](matrix-org#14410))
- Clean-up event persistence code. ([\matrix-org#14411](matrix-org#14411))
- Update docstring to clarify that `get_partial_state_events_batch` does not just give you completely arbitrary partial-state events. ([\matrix-org#14417](matrix-org#14417))
- Fix mypy errors introduced by bumping the locked version of `attrs` and `gitpython`. ([\matrix-org#14433](matrix-org#14433))
- Make Dependabot only bump Rust deps in the lock file. ([\matrix-org#14434](matrix-org#14434))
- Fix an incorrect stub return type for `PushRuleEvaluator.run`. ([\matrix-org#14451](matrix-org#14451))
- Improve performance of `/context` in large rooms. ([\matrix-org#14461](matrix-org#14461))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Logging Synapse's logs (structured or otherwise). Not metrics. Z-Sentry Issue was discovered by looking at Sentry reports on Matrix.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants