[GH-ISSUE #4860] unknown field "token" in frpc configuration #3835

Closed
opened 2026-05-05 14:27:10 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @DL909 on GitHub (Jul 1, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4860

Bug Description

frpc cannot recognize token field in frpc.toml

I've installed frpc via brew using brew install frpc and configured it.

when I run

path/to/my/frpc -c path/to/my/frpc.toml

I got

json: unknown field "token"

I've downloaded the latest version of frpc via github and got the same result.

frpc Version

0.62.1

frps Version

0.63.0

System Architecture

macOS/arm64

Configurations

serverAddr = "0.0.0.0"
serverPort = 7000
token = "********"

proxies
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 7001

Logs

json: unknown field "token"

Steps to reproduce

  1. install frpc via brew(brew install frpc)
  2. write the configure
  3. run frpc with configuration

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @DL909 on GitHub (Jul 1, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/4860 ### Bug Description frpc cannot recognize token field in `frpc.toml` I've installed frpc via brew using `brew install frpc` and configured it. when I run ``` path/to/my/frpc -c path/to/my/frpc.toml ``` I got ``` json: unknown field "token" ``` I've downloaded the latest version of frpc via github and got the same result. ### frpc Version 0.62.1 ### frps Version 0.63.0 ### System Architecture macOS/arm64 ### Configurations serverAddr = "0.0.0.0" serverPort = 7000 token = "********" [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 7001 ### Logs json: unknown field "token" ### Steps to reproduce 1. install frpc via brew(`brew install frpc`) 2. write the configure 3. run frpc with configuration ### Affected area - [ ] Docs - [x] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 14:27:10 -06:00
Author
Owner

@devin-ai-integration[bot] commented on GitHub (Jul 1, 2025):

Root Cause Analysis

Hi @DL909! I've analyzed your issue and found the root cause of the json: unknown field "token" error.

The problem is a configuration format mismatch combined with strict parsing mode.

What's happening:

  1. Configuration format change: In newer versions of frp, the token field has been moved from the top-level configuration to be nested under the auth section.

  2. Your current configuration (causing the error):

    serverAddr = "0.0.0.0"
    serverPort = 7000
    token = "********"  # ❌ This is the old format
    
    [[proxies]]
    name = "ssh"
    type = "tcp"
    localIP = "127.0.0.1"
    localPort = 22
    remotePort = 7001
    
  3. Required new format:

    serverAddr = "0.0.0.0"
    serverPort = 7000
    auth.method = "token"
    auth.token = "********"  # ✅ Correct new format
    
    [[proxies]]
    name = "ssh"
    type = "tcp"
    localIP = "127.0.0.1"
    localPort = 22
    remotePort = 7001
    
  4. Strict parsing mode: frpc runs with --strict_config=true by default, which causes unknown fields to trigger errors.

Why this happens:

  • Your TOML file isn't detected as legacy INI format, so it doesn't trigger automatic conversion
  • The top-level token field doesn't exist in the new ClientCommonConfig structure
  • Strict mode JSON decoder calls DisallowUnknownFields(), causing the error

Solutions

Change your frpc.toml to use the correct new format:

serverAddr = "0.0.0.0"
serverPort = 7000

# Authentication configuration
auth.method = "token"
auth.token = "********"

[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 7001

Solution 2: Disable strict mode (Temporary workaround)

Run frpc with strict mode disabled:

frpc -c frpc.toml --strict_config=false

You could use the old .ini format, but this is deprecated and will be removed in future versions.

Additional Notes

  • This issue is not related to version compatibility between frpc 0.62.1 and frps 0.63.0
  • It's a configuration format migration issue where the structure has changed
  • The same frpc version can work with both old and new configuration formats, but you need to use the correct syntax

Verification

After updating your configuration, you should be able to run:

frpc -c frpc.toml

And it should connect successfully without the "unknown field" error.

You can find the complete configuration reference in the example configuration file.

<!-- gh-comment-id:3022636988 --> @devin-ai-integration[bot] commented on GitHub (Jul 1, 2025): ## Root Cause Analysis Hi @DL909! I've analyzed your issue and found the root cause of the `json: unknown field "token"` error. **The problem is a configuration format mismatch combined with strict parsing mode.** ### What's happening: 1. **Configuration format change**: In newer versions of frp, the `token` field has been moved from the top-level configuration to be nested under the `auth` section. 2. **Your current configuration** (causing the error): ```toml serverAddr = "0.0.0.0" serverPort = 7000 token = "********" # ❌ This is the old format [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 7001 ``` 3. **Required new format**: ```toml serverAddr = "0.0.0.0" serverPort = 7000 auth.method = "token" auth.token = "********" # ✅ Correct new format [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 7001 ``` 4. **Strict parsing mode**: frpc runs with `--strict_config=true` by default, which causes unknown fields to trigger errors. ### Why this happens: - Your TOML file isn't detected as legacy INI format, so it doesn't trigger automatic conversion - The top-level `token` field doesn't exist in the new `ClientCommonConfig` structure - Strict mode JSON decoder calls `DisallowUnknownFields()`, causing the error ## Solutions ### Solution 1: Update your configuration format (Recommended) Change your `frpc.toml` to use the correct new format: ```toml serverAddr = "0.0.0.0" serverPort = 7000 # Authentication configuration auth.method = "token" auth.token = "********" [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 7001 ``` ### Solution 2: Disable strict mode (Temporary workaround) Run frpc with strict mode disabled: ```bash frpc -c frpc.toml --strict_config=false ``` ### Solution 3: Use legacy INI format (Not recommended) You could use the old `.ini` format, but this is deprecated and will be removed in future versions. ## Additional Notes - This issue is **not related to version compatibility** between frpc 0.62.1 and frps 0.63.0 - It's a **configuration format migration issue** where the structure has changed - The same frpc version can work with both old and new configuration formats, but you need to use the correct syntax ## Verification After updating your configuration, you should be able to run: ```bash frpc -c frpc.toml ``` And it should connect successfully without the "unknown field" error. You can find the complete configuration reference in the [example configuration file](https://github.com/fatedier/frp/blob/dev/conf/frpc_full_example.toml).
Author
Owner

@github-actions[bot] commented on GitHub (Jul 16, 2025):

Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.

<!-- gh-comment-id:3076365010 --> @github-actions[bot] commented on GitHub (Jul 16, 2025): Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.
Author
Owner

@BustedSec commented on GitHub (Jul 16, 2025):

Field is for api key

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: github-actions[bot] @.>
Sent: Tuesday, July 15, 2025 5:42:37 PM
To: fatedier/frp @.
>
Cc: Subscribed @.***>
Subject: Re: [fatedier/frp] unknown field "token" in frpc configuration (Issue #4860)

[https://avatars.githubusercontent.com/in/15368?s=20&v=4]github-actions[bot] left a comment (fatedier/frp#4860)https://github.com/fatedier/frp/issues/4860#issuecomment-3076365010

Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.


Reply to this email directly, view it on GitHubhttps://github.com/fatedier/frp/issues/4860#issuecomment-3076365010, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABYWWB6MW2WSK3H36TTLQTD3IWNX3AVCNFSM6AAAAACAQKYAISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANZWGM3DKMBRGA.
You are receiving this because you are subscribed to this thread.Message ID: @.***>

<!-- gh-comment-id:3076377107 --> @BustedSec commented on GitHub (Jul 16, 2025): Field is for api key Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: github-actions[bot] ***@***.***> Sent: Tuesday, July 15, 2025 5:42:37 PM To: fatedier/frp ***@***.***> Cc: Subscribed ***@***.***> Subject: Re: [fatedier/frp] unknown field "token" in frpc configuration (Issue #4860) [https://avatars.githubusercontent.com/in/15368?s=20&v=4]github-actions[bot] left a comment (fatedier/frp#4860)<https://github.com/fatedier/frp/issues/4860#issuecomment-3076365010> Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close. — Reply to this email directly, view it on GitHub<https://github.com/fatedier/frp/issues/4860#issuecomment-3076365010>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABYWWB6MW2WSK3H36TTLQTD3IWNX3AVCNFSM6AAAAACAQKYAISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANZWGM3DKMBRGA>. You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
Author
Owner

@github-actions[bot] commented on GitHub (Jul 31, 2025):

Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.

<!-- gh-comment-id:3138231750 --> @github-actions[bot] commented on GitHub (Jul 31, 2025): Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3835
No description provided.