Can't add peers to groups when upgrade to 0.30.1 #1345

Closed
opened 2025-11-20 05:28:45 -05:00 by saavagebueno · 6 comments
Owner

Originally created by @Marcus1Pierce on GitHub (Oct 16, 2024).

Describe the problem

I cannot add peers to the group. There is an error when adding peers to the group.

Error from the management container:

2024-10-16T09:02:06Z ERRO [requestID: 7e057e29-69c0-4317-bb93-2f070bc62021, accountID: , userID: 29, context: HTTP] management/server/http/util/util.go:81: got a handler error: failed to get group from store: ERROR: function json_array_length(text) does not exist (SQLSTATE 42883)

2024-10-16T09:02:06Z ERRO [context: HTTP, requestID: 7e057e29-69c0-4317-bb93-2f070bc62021] management/server/telemetry/http_api_metrics.go:168: HTTP response 7e057e29-69c0-4317-bb93-2f070bc62021: PUT /api/groups/cqm5va7dc18s73ee9tkg status 500

Error from Postgres:

2024-10-16 09:25:13.795 UTC [35] ERROR:  function json_array_length(text) does not exist at character 69

2024-10-16 09:25:13.795 UTC [35] HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

2024-10-16 09:25:13.795 UTC [35] STATEMENT:  SELECT * FROM "groups" WHERE name = $1 and account_id = $2 ORDER BY json_array_length(peers) DESC,"groups"."id" LIMIT 1 FOR SHARE

To Reproduce

Steps to reproduce the behavior:

  1. Update Netbird to Version 0.30.1
  2. Go to Dashboard and select any peers
  3. Assign groups to selected peer.
  4. See error

Expected behavior

There is a notification that peers were successfully added.

Are you using NetBird Cloud?

No. I'm using self hosted NetBird

NetBird version

netbird version 0.30.1

NetBird status -dA output:

Peers detail:
 it-pc.anon-ygMmS.domain:
  NetBird IP: 100.111.52.41
  Public key: hSFhlgAYUf/U3c8pJkb6pA1Iuqww/niannR07e1H5Fs=
  Status: Disconnected
  -- detail --
  Connection type: 
  ICE candidate (Local/Remote): -/-
  ICE candidate endpoints (Local/Remote): -/-
  Relay server address: 
  Last connection update: 17 minutes, 31 seconds ago
  Last WireGuard handshake: -
  Transfer status (received/sent) 0 B/0 B
  Quantum resistance: false
  Routes: -
  Latency: 775.129µs

 tm-1.anon-ygMmS.domain:
  NetBird IP: 100.111.56.189
  Public key: 6div7rjJkye7EYiqOZGqISzDqheaSxuyQb04UYqa0mc=
  Status: Disconnected
  -- detail --
  Connection type: 
  ICE candidate (Local/Remote): -/-
  ICE candidate endpoints (Local/Remote): -/-
  Relay server address: 
  Last connection update: -
  Last WireGuard handshake: -
  Transfer status (received/sent) 0 B/0 B
  Quantum resistance: false
  Routes: -
  Latency: 0s

 test-laptop.anon-ygMmS.domain:
  NetBird IP: 100.111.65.128
  Public key: VRH5TEo9QOxBHwt1lgMfUQT32hx7pVJ24qdawTkau3s=
  Status: Disconnected
  -- detail --
  Connection type: 
  ICE candidate (Local/Remote): -/-
  ICE candidate endpoints (Local/Remote): -/-
  Relay server address: 
  Last connection update: -
  Last WireGuard handshake: -
  Transfer status (received/sent) 0 B/0 B
  Quantum resistance: false
  Routes: -
  Latency: 0s

 server-mix.anon-ygMmS.domain:
  NetBird IP: 100.111.134.235
  Public key: uM4b+UxO0me/p4SLGONh/vXZEwy4y3mB14U1+nPGVBo=
  Status: Connected
  -- detail --
  Connection type: P2P
  ICE candidate (Local/Remote): host/host
  ICE candidate endpoints (Local/Remote): 172.16.1.102:51820/172.16.1.17:51820
  Relay server address: rels://overlay-network.anon-MzLdE.domain:443
  Last connection update: 1 hour, 11 minutes ago
  Last WireGuard handshake: 1 minute, 34 seconds ago
  Transfer status (received/sent) 20.5 KiB/22.8 KiB
  Quantum resistance: false
  Routes: -
  Latency: 254.39µs

 m1p.anon-ygMmS.domain:
  NetBird IP: 100.111.173.203
  Public key: PgDYOwhcZAbpM6h2BYEEaCv0tOOwxdjU0ZAwY3vqtXM=
  Status: Disconnected
  -- detail --
  Connection type: 
  ICE candidate (Local/Remote): -/-
  ICE candidate endpoints (Local/Remote): -/-
  Relay server address: 
  Last connection update: -
  Last WireGuard handshake: -
  Transfer status (received/sent) 0 B/0 B
  Quantum resistance: false
  Routes: -
  Latency: 0s

OS: linux/amd64
Daemon version: 0.30.1
CLI version: 0.30.1
Management: Connected to https://overlay-network.anon-MzLdE.domain:443
Signal: Connected to https://overlay-network.anon-MzLdE.domain:443
Relays: 
  [stun:overlay-network.anon-MzLdE.domain:3478] is Available
  [turn:overlay-network.anon-MzLdE.domain:3478?transport=udp] is Available
  [rels://overlay-network.anon-MzLdE.domain:443] is Available
Nameservers: 
  [100.111.134.235:53] for [anon-MzLdE.domain] is Available
FQDN: test-outline.anon-ygMmS.domain
NetBird IP: 100.111.170.31/16
Interface type: Kernel
Quantum resistance: false
Routes: -
Peers count: 1/5 

Screenshots

Untitled

Additional context

I am using Netbird version 0.30.1, with SSO using Authentik, a Postgres database and Caddy as the reverse proxy.

When I downgrade to version 0.29.4, there are no errors at all and everything works normally.

Originally created by @Marcus1Pierce on GitHub (Oct 16, 2024). **Describe the problem** I cannot add peers to the group. There is an error when adding peers to the group. Error from the management container: ``` 2024-10-16T09:02:06Z ERRO [requestID: 7e057e29-69c0-4317-bb93-2f070bc62021, accountID: , userID: 29, context: HTTP] management/server/http/util/util.go:81: got a handler error: failed to get group from store: ERROR: function json_array_length(text) does not exist (SQLSTATE 42883) 2024-10-16T09:02:06Z ERRO [context: HTTP, requestID: 7e057e29-69c0-4317-bb93-2f070bc62021] management/server/telemetry/http_api_metrics.go:168: HTTP response 7e057e29-69c0-4317-bb93-2f070bc62021: PUT /api/groups/cqm5va7dc18s73ee9tkg status 500 ``` Error from Postgres: ``` 2024-10-16 09:25:13.795 UTC [35] ERROR: function json_array_length(text) does not exist at character 69 2024-10-16 09:25:13.795 UTC [35] HINT: No function matches the given name and argument types. You might need to add explicit type casts. 2024-10-16 09:25:13.795 UTC [35] STATEMENT: SELECT * FROM "groups" WHERE name = $1 and account_id = $2 ORDER BY json_array_length(peers) DESC,"groups"."id" LIMIT 1 FOR SHARE ``` **To Reproduce** Steps to reproduce the behavior: 1. Update Netbird to Version 0.30.1 2. Go to Dashboard and select any peers 3. Assign groups to selected peer. 4. See error **Expected behavior** There is a notification that peers were successfully added. **Are you using NetBird Cloud?** No. I'm using self hosted NetBird **NetBird version** `netbird version` 0.30.1 **NetBird status -dA output:** ``` Peers detail: it-pc.anon-ygMmS.domain: NetBird IP: 100.111.52.41 Public key: hSFhlgAYUf/U3c8pJkb6pA1Iuqww/niannR07e1H5Fs= Status: Disconnected -- detail -- Connection type: ICE candidate (Local/Remote): -/- ICE candidate endpoints (Local/Remote): -/- Relay server address: Last connection update: 17 minutes, 31 seconds ago Last WireGuard handshake: - Transfer status (received/sent) 0 B/0 B Quantum resistance: false Routes: - Latency: 775.129µs tm-1.anon-ygMmS.domain: NetBird IP: 100.111.56.189 Public key: 6div7rjJkye7EYiqOZGqISzDqheaSxuyQb04UYqa0mc= Status: Disconnected -- detail -- Connection type: ICE candidate (Local/Remote): -/- ICE candidate endpoints (Local/Remote): -/- Relay server address: Last connection update: - Last WireGuard handshake: - Transfer status (received/sent) 0 B/0 B Quantum resistance: false Routes: - Latency: 0s test-laptop.anon-ygMmS.domain: NetBird IP: 100.111.65.128 Public key: VRH5TEo9QOxBHwt1lgMfUQT32hx7pVJ24qdawTkau3s= Status: Disconnected -- detail -- Connection type: ICE candidate (Local/Remote): -/- ICE candidate endpoints (Local/Remote): -/- Relay server address: Last connection update: - Last WireGuard handshake: - Transfer status (received/sent) 0 B/0 B Quantum resistance: false Routes: - Latency: 0s server-mix.anon-ygMmS.domain: NetBird IP: 100.111.134.235 Public key: uM4b+UxO0me/p4SLGONh/vXZEwy4y3mB14U1+nPGVBo= Status: Connected -- detail -- Connection type: P2P ICE candidate (Local/Remote): host/host ICE candidate endpoints (Local/Remote): 172.16.1.102:51820/172.16.1.17:51820 Relay server address: rels://overlay-network.anon-MzLdE.domain:443 Last connection update: 1 hour, 11 minutes ago Last WireGuard handshake: 1 minute, 34 seconds ago Transfer status (received/sent) 20.5 KiB/22.8 KiB Quantum resistance: false Routes: - Latency: 254.39µs m1p.anon-ygMmS.domain: NetBird IP: 100.111.173.203 Public key: PgDYOwhcZAbpM6h2BYEEaCv0tOOwxdjU0ZAwY3vqtXM= Status: Disconnected -- detail -- Connection type: ICE candidate (Local/Remote): -/- ICE candidate endpoints (Local/Remote): -/- Relay server address: Last connection update: - Last WireGuard handshake: - Transfer status (received/sent) 0 B/0 B Quantum resistance: false Routes: - Latency: 0s OS: linux/amd64 Daemon version: 0.30.1 CLI version: 0.30.1 Management: Connected to https://overlay-network.anon-MzLdE.domain:443 Signal: Connected to https://overlay-network.anon-MzLdE.domain:443 Relays: [stun:overlay-network.anon-MzLdE.domain:3478] is Available [turn:overlay-network.anon-MzLdE.domain:3478?transport=udp] is Available [rels://overlay-network.anon-MzLdE.domain:443] is Available Nameservers: [100.111.134.235:53] for [anon-MzLdE.domain] is Available FQDN: test-outline.anon-ygMmS.domain NetBird IP: 100.111.170.31/16 Interface type: Kernel Quantum resistance: false Routes: - Peers count: 1/5 ``` **Screenshots** ![Untitled](https://github.com/user-attachments/assets/45057009-ec5f-4496-8d7a-ba2be1ddb6db) **Additional context** I am using Netbird version 0.30.1, with SSO using Authentik, a Postgres database and Caddy as the reverse proxy. When I downgrade to version 0.29.4, there are no errors at all and everything works normally.
saavagebueno added the serverself-hosting labels 2025-11-20 05:28:45 -05:00
Author
Owner

@Marcus1Pierce commented on GitHub (Oct 16, 2024):

And when I add peers to the group in version 0.29.4, everything works normally.

Untitled2

@Marcus1Pierce commented on GitHub (Oct 16, 2024): And when I add peers to the group in version 0.29.4, everything works normally. ![Untitled2](https://github.com/user-attachments/assets/0e7ebc81-8f8b-4349-962a-e8cfe61ff982)
Author
Owner

@mgarces commented on GitHub (Oct 16, 2024):

hello,

And when I add peers to the group in version 0.29.4, everything works normally.

What version are you referring to? The test-outline peer? The screenshot shows that the version is still 0.30.1

@mgarces commented on GitHub (Oct 16, 2024): hello, > And when I add peers to the group in version 0.29.4, everything works normally. What version are you referring to? The `test-outline` peer? The screenshot shows that the version is still `0.30.1`
Author
Owner

@mgarces commented on GitHub (Oct 16, 2024):

Which version of PostgreSQL are you using?

@mgarces commented on GitHub (Oct 16, 2024): Which version of PostgreSQL are you using?
Author
Owner

@Marcus1Pierce commented on GitHub (Oct 16, 2024):

@mgarces I'm using Postgres 16 alpine on docker

@Marcus1Pierce commented on GitHub (Oct 16, 2024): @mgarces I'm using Postgres 16 alpine on docker
Author
Owner

@Marcus1Pierce commented on GitHub (Oct 16, 2024):

@mgarces Sorry i didn't notice your first comment. I'm referring to management server. On client, it doesn't matter if it's version 0.30.1 i can still add that peers to group if management server have version 0.29.4.

@Marcus1Pierce commented on GitHub (Oct 16, 2024): @mgarces Sorry i didn't notice your first comment. I'm referring to management server. On client, it doesn't matter if it's version 0.30.1 i can still add that peers to group if management server have version 0.29.4.
Author
Owner

@bcmmbaga commented on GitHub (Oct 16, 2024):

@Marcus1Pierce We were able to reproduce this, and we will fix this issue in the next release. Thanks for reporting!

@bcmmbaga commented on GitHub (Oct 16, 2024): @Marcus1Pierce We were able to reproduce this, and we will fix this issue in the next release. Thanks for reporting!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1345