Skip to content

FunctionClauseError in WriteBuffer.handle_info/2 on {:EXIT, port, :normal} #6382

@mosenturm

Description

@mosenturm

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for self-hosted support

Using official Plausible Cloud hosting or self-hosting?

Self-hosting

Describe the bug

We are seeing intermittent write buffer crashes on self-hosted Plausible v3.2.0.

Error

[notice] Flushing Elixir.Plausible.Session.WriteBuffer buffer before shutdown...
[error] GenServer Plausible.Session.WriteBuffer terminating
** (FunctionClauseError) no function clause matching in Plausible.Ingestion.WriteBuffer.handle_info/2
(plausible 0.0.1) lib/plausible/ingestion/write_buffer.ex:63:
Plausible.Ingestion.WriteBuffer.handle_info({:EXIT, #Port<...>, :normal}, %{name: Plausible.Session.WriteBuffer, ...})
Last message: {:EXIT, #Port<...>, :normal}

The Plausible pod stays up, but the write buffer process crashes and restarts.

This looks like an unhandled {:EXIT, port, :normal} message in handle_info/2.

I have also seen separate ClickHouse connection messages (Ch.Connection disconnected: socket closed), but this seems to be a distinct bug: even if a connection/client event is the trigger, the immediate failure is the FunctionClauseError.

Questions

  • Is this a known issue?
  • Can buffered writes be lost when this happens?

Expected behavior

FunctionClauseError should not be happen.

Screenshots

No response

Environment

- Plausible v3.2.0
- self-hosted on Kubernetes
- ClickHouse backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions