eventdb uses local SQLite even when PostgreSQL is configured #1847

Closed
opened 2025-11-20 06:07:53 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @yubin-lin1996 on GitHub (Apr 29, 2025).

Describe the problem

When deploying the self-hosted NetBird management service in a Kubernetes environment, and configuring PostgreSQL as the storage backend (via NETBIRD_STORE_TYPE=postgres and NETBIRD_STORE_ENGINE_POSTGRES_DSN=...), the main database works correctly with PostgreSQL.

However, even in this setup, a local event.db SQLite file is still created inside the management container's filesystem. This suggests that the event database (eventDB) does not follow the same configuration and silently defaults to SQLite.

This behavior becomes problematic in production Kubernetes deployments, where container filesystems are ephemeral. As a result, whenever the manager Pod is restarted, the event.db file is lost, and with it, any events or logs stored in it. This leads to a loss of observability and historical data, which is critical for auditing and debugging purposes in production environments.

To Reproduce
Deploy netbird/management with NETBIRD_STORE_TYPE=postgres and NETBIRD_STORE_DATA_SOURCE set correctly.

Start the pod and verify PostgreSQL is used.

Observe that a local event.db file is still created in the container.

Logs do not indicate a switch to PostgreSQL for event storage.

Steps to reproduce the behavior:

Image

Expected behavior

A clear and concise description of what you expected to happen.

Are you using NetBird Cloud?

self-host NetBird's control plane.

NetBird version

0.43

Is any other VPN software installed?

no

Debug output

netbird status -dA

As well as the file created by

netbird debug for 1m -AS

We advise reviewing the anonymized output for any remaining personal information.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Have you tried these troubleshooting steps?

  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @yubin-lin1996 on GitHub (Apr 29, 2025). **Describe the problem** When deploying the self-hosted NetBird management service in a Kubernetes environment, and configuring PostgreSQL as the storage backend (via NETBIRD_STORE_TYPE=postgres and NETBIRD_STORE_ENGINE_POSTGRES_DSN=...), the main database works correctly with PostgreSQL. However, even in this setup, a local event.db SQLite file is still created inside the management container's filesystem. This suggests that the event database (eventDB) does not follow the same configuration and silently defaults to SQLite. This behavior becomes problematic in production Kubernetes deployments, where container filesystems are ephemeral. As a result, whenever the manager Pod is restarted, the event.db file is lost, and with it, any events or logs stored in it. This leads to a loss of observability and historical data, which is critical for auditing and debugging purposes in production environments. **To Reproduce** Deploy netbird/management with NETBIRD_STORE_TYPE=postgres and NETBIRD_STORE_DATA_SOURCE set correctly. Start the pod and verify PostgreSQL is used. Observe that a local event.db file is still created in the container. Logs do not indicate a switch to PostgreSQL for event storage. Steps to reproduce the behavior: <img width="526" alt="Image" src="https://github.com/user-attachments/assets/733469d3-393e-4c83-b5cd-2d4094407348" /> **Expected behavior** A clear and concise description of what you expected to happen. **Are you using NetBird Cloud?** self-host NetBird's control plane. **NetBird version** `0.43` **Is any other VPN software installed?** no **Debug output** netbird status -dA As well as the file created by netbird debug for 1m -AS We advise reviewing the anonymized output for any remaining personal information. **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. **Have you tried these troubleshooting steps?** - [ ] Checked for newer NetBird versions - [ ] Searched for similar issues on GitHub (including closed ones) - [ ] Restarted the NetBird client - [ ] Disabled other VPN software - [ ] Checked firewall settings
saavagebueno added the triage-needed label 2025-11-20 06:07:53 -05:00
Author
Owner

@drtinkerer commented on GitHub (Jul 2, 2025):

Did you manage to solve this ?

@drtinkerer commented on GitHub (Jul 2, 2025): Did you manage to solve this ?
Author
Owner

@mlsmaycon commented on GitHub (Jul 3, 2025):

There is support for postgres now.

You can migrate to it using the following documentation:

https://docs.netbird.io/selfhosted/activity-postgres-store

I am closing this now, feel free to open a new one if you find any issues.

@mlsmaycon commented on GitHub (Jul 3, 2025): There is support for postgres now. You can migrate to it using the following documentation: https://docs.netbird.io/selfhosted/activity-postgres-store I am closing this now, feel free to open a new one if you find any issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1847