/api/v1/accounts/:id/mute: (KeyError) key :notifications not found in: %{}
Environment
- Installation type: From source
- Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): 6efd3730
- Elixir version (
elixir -v
for from source installations, N/A for OTP): Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1], Elixir 1.10.3 (compiled with Erlang/OTP 21) - Operating system: Ubuntu 20.04
- PostgreSQL version (
postgres -V
): psql (PostgreSQL) 12.3 (Ubuntu 12.3-1.pgdg20.04+1)
Bug description
Request to /api/v1/accounts/:id/mute fails with HTTP error 500, Internal Server Error. It was working on stable but stopped after I moved on develop. Same happens on shitposter.club: https://github.com/tuskyapp/Tusky/issues/1847
Pleroma log(reversed):
(phoenix 1.4.13) lib/phoenix/endpoint/cowboy2_handler.ex:42: Phoenix.Endpoint.Cowboy2Handler.init/4
(pleroma 2.0.50-1624-g807413d6-emr-develop) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2
(pleroma 2.0.50-1624-g807413d6-emr-develop) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2
(phoenix 1.4.13) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2
(pleroma 2.0.50-1624-g807413d6-emr-develop) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.instrument/4
(pleroma 2.0.50-1624-g807413d6-emr-develop) lib/pleroma/web/mastodon_api/controllers/account_controller.ex:5: Pleroma.Web.MastodonAPI.AccountController.phoenix>
(pleroma 2.0.50-1624-g807413d6-emr-develop) lib/pleroma/web/mastodon_api/controllers/account_controller.ex:5: Pleroma.Web.MastodonAPI.AccountController.action/2
(pleroma 2.0.50-1624-g807413d6-emr-develop) lib/pleroma/web/mastodon_api/controllers/account_controller.ex:353: Pleroma.Web.MastodonAPI.AccountController.mute/2
** (KeyError) key :notifications not found in: %{}
** (exit) an exception was raised:
Request: POST /api/v1/accounts/9qVeg35gC12Jl5s7l2/mute
Server: expired.mentality.rip:80 (http)
11:56:01.150 [error] #PID<0.11761.58> running Pleroma.Web.Endpoint (connection #PID<0.11757.58>, stream id 1) terminated
11:56:01.148 request_id=FhsjtsedTH12xigAgg_B [info] Converted error {:badkey, :notifications, %{}} to 500 response
11:56:01.148 request_id=FhsjtsedTH12xigAgg_B [error] Internal server error: %KeyError{key: :notifications, message: nil, term: %{}}
HTTP log from client side:
--> POST https://expired.mentality.rip/api/v1/accounts/9qVeg35gC12Jl5s7l2/mute
Content-Length: 0
User-Agent: Husky/1.0-a38acd34 Android/9
Accept-Encoding: br,gzip
Authorization: Bearer не отдам
--> END POST (0-byte body)
<-- 500 https://expired.mentality.rip/api/v1/accounts/9qVeg35gC12Jl5s7l2/mute (129ms)
server: nginx/1.17.10 (Ubuntu)
date: Tue, 23 Jun 2020 09:56:01 GMT
content-type: application/json; charset=utf-8
content-length: 45
access-control-allow-credentials: true
access-control-allow-origin: *
access-control-expose-headers: Link,X-RateLimit-Reset,X-RateLimit-Limit,X-RateLimit-Remaining,X-Request-Id,Idempotency-Key
cache-control: max-age=0, private, must-revalidate
content-security-policy: upgrade-insecure-requests;script-src 'self';connect-src 'self' blob: https://expired.mentality.rip wss://expired.mentality.rip;media-src 'self' ;img-src 'self' data: blob: ;default-src 'none';base-uri 'self';frame-ancestors 'none';style-src 'self' 'unsafe-inline';font-src 'self';manifest-src 'self';
expect-ct: enforce, max-age=2592000
referrer-policy: same-origin
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: DENY
x-permitted-cross-domain-policies: none
x-request-id: FhsjtsedTH12xigAgg_B
x-xss-protection: 1; mode=block
set-cookie: __Host-pleroma_key=SFMyNTY.g3QAAAABbQAAAAd1c2VyX2lkbQAAABI5cVQ4bmI3a1hsU1E2cjBvYm8.XaBzWBJXKKPYucuyp-IMw5U1oKPhjCxaIDdQuLOQgfE; path=/; secure; HttpOnly; SameSite=Lax
{"errors":{"detail":"Internal server error"}}
<-- END HTTP (45-byte body)
Edited by a1batross