[GH-ISSUE #4719] “Invalid key format” when adding a pre-shared key on Android #9740

Open
opened 2026-08-05 01:23:19 -04:00 by saavagebueno · 5 comments
Owner

Originally created by @alanpereiracoelho on GitHub (Oct 29, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4719

Describe the bug
When trying to add a pre-shared key in the Android client (Advanced → “Add a pre-shared key”), the app shows the following error:

Invalid key format

even though the key appears valid (UUID-style).
Steps to reproduce

  1. Open the NetBird Android client
  2. Go to Advanced → Add a pre-shared key
  3. Enter the following example key:
    DF3FB11C-BE17-4679-9096-C0F5BB66ECF4

Image

  1. Tap Save
    Expected behavior
    The key should be accepted if it’s in the correct pre-shared key format (UUID, Base64, or other as specified by the app’s encryption policy).
    Actual behavior
    The Android app rejects the key with the message “Invalid key format”.
    (Attach image here if posting on GitHub)
    Environment
  • App version: (please specify)
  • Android version: (please specify)
  • Server: self-hosted (epace.netbird.selfhosted)
  • Daemon version: 0.59.9
  • CLI version: 0.59.9
  • Peer count: 1/2 connected
  • Management: Connected
  • Signal: Connected
    Additional context
    This happens on a self-hosted NetBird instance where peers are manually configured.
    I’m trying to test peer-to-peer communication using a manually set pre-shared key, but it’s unclear what key format is expected by the Android app.

Please clarify:

  • What is the expected format of a valid PSK for Android?
  • Is manual entry of PSK currently supported?
  • Or should the PSK only be set via the management service?
Originally created by @alanpereiracoelho on GitHub (Oct 29, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4719 Describe the bug When trying to add a pre-shared key in the Android client (Advanced → “Add a pre-shared key”), the app shows the following error: > Invalid key format even though the key appears valid (UUID-style). Steps to reproduce 1. Open the NetBird Android client 2. Go to Advanced → Add a pre-shared key 3. Enter the following example key: DF3FB11C-BE17-4679-9096-C0F5BB66ECF4 ![Image](https://github.com/user-attachments/assets/2c2ce716-12f0-44d0-9438-d2e0f8c3f985) 4. Tap Save Expected behavior The key should be accepted if it’s in the correct pre-shared key format (UUID, Base64, or other as specified by the app’s encryption policy). Actual behavior The Android app rejects the key with the message “Invalid key format”. (Attach image here if posting on GitHub) Environment - App version: (please specify) - Android version: (please specify) - Server: self-hosted (epace.netbird.selfhosted) - Daemon version: 0.59.9 - CLI version: 0.59.9 - Peer count: 1/2 connected - Management: Connected - Signal: Connected Additional context This happens on a self-hosted NetBird instance where peers are manually configured. I’m trying to test peer-to-peer communication using a manually set pre-shared key, but it’s unclear what key format is expected by the Android app. Please clarify: - What is the expected format of a valid PSK for Android? - Is manual entry of PSK currently supported? - Or should the PSK only be set via the management service?
saavagebueno added the triage-needed label 2026-08-05 01:23:19 -04:00
Author
Owner

@Cheeff-Mint commented on GitHub (Nov 18, 2025):

I'm having this issue as well, on Android 15.
The setup key works for my other devices (linux PCs), just not the Android phone.

<!-- gh-comment-id:3547357516 --> @Cheeff-Mint commented on GitHub (Nov 18, 2025): I'm having this issue as well, on Android 15. The setup key works for my other devices (linux PCs), just not the Android phone.
Author
Owner

@markcst commented on GitHub (Nov 18, 2025):

This happens to me as well, any solution?

<!-- gh-comment-id:3549931714 --> @markcst commented on GitHub (Nov 18, 2025): This happens to me as well, any solution?
Author
Owner

@rozicdejan commented on GitHub (Nov 20, 2025):

Same. Selfhosting, won't accept my key, from selfhosting server.

<!-- gh-comment-id:3558795756 --> @rozicdejan commented on GitHub (Nov 20, 2025): Same. Selfhosting, won't accept my key, from selfhosting server.
Author
Owner

@wcwong22000 commented on GitHub (Nov 24, 2025):

after pasting the setup into the designated field, delete all hyphens from the stepup key

<!-- gh-comment-id:3571878914 --> @wcwong22000 commented on GitHub (Nov 24, 2025): after pasting the setup into the designated field, delete all hyphens from the stepup key
Author
Owner

@lixmal commented on GitHub (Nov 24, 2025):

Setup keys are not yet implemented on mobile.

The pre-shared key is something completely different. Don't put setup keys in the pre-shared key field! If you put a value there, ALL clients will need the same value; otherwise, they won't be able to establish a connection to each other

<!-- gh-comment-id:3571930033 --> @lixmal commented on GitHub (Nov 24, 2025): Setup keys are not yet implemented on mobile. The pre-shared key is something completely different. Don't put setup keys in the pre-shared key field! If you put a value there, ALL clients will need the same value; otherwise, they won't be able to establish a connection to each other
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9740