[GH-ISSUE #4935] Error when setting int value by environment #3892

Closed
opened 2026-05-05 14:29:05 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @immomo808 on GitHub (Aug 14, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4935

Bug Description

By the provided example

# frpc.toml
serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}"
serverPort = 7000

[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = "{{ .Envs.FRP_SSH_REMOTE_PORT }}"
export FRP_SERVER_ADDR=x.x.x.x
export FRP_SSH_REMOTE_PORT=6000
./frpc -c ./frpc.toml
unmarshal ProxyConfig error: json: cannot unmarshal string into Go struct field TCPProxyConfig.remotePort of type int

frpc Version

0.64.0

frps Version

0.64.0

System Architecture

linux/arm64

Configurations

serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}"
serverPort = 7000

[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = "{{ .Envs.FRP_SSH_REMOTE_PORT }}"

Logs

unmarshal ProxyConfig error: json: cannot unmarshal string into Go struct field TCPProxyConfig.remotePort of type int

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @immomo808 on GitHub (Aug 14, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/4935 ### Bug Description By the provided example ``` # frpc.toml serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}" serverPort = 7000 [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = "{{ .Envs.FRP_SSH_REMOTE_PORT }}" ``` ``` export FRP_SERVER_ADDR=x.x.x.x export FRP_SSH_REMOTE_PORT=6000 ./frpc -c ./frpc.toml ``` ``` unmarshal ProxyConfig error: json: cannot unmarshal string into Go struct field TCPProxyConfig.remotePort of type int ``` ### frpc Version 0.64.0 ### frps Version 0.64.0 ### System Architecture linux/arm64 ### Configurations ``` serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}" serverPort = 7000 [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = "{{ .Envs.FRP_SSH_REMOTE_PORT }}" ``` ### Logs ``` unmarshal ProxyConfig error: json: cannot unmarshal string into Go struct field TCPProxyConfig.remotePort of type int ``` ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [x] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (Aug 15, 2025):

So why do you want to add double quotes?

<!-- gh-comment-id:3190455962 --> @fatedier commented on GitHub (Aug 15, 2025): So why do you want to add double quotes?
Author
Owner

@immomo808 commented on GitHub (Aug 15, 2025):

Ammm. I am not wanting to use double quotes. As I said this is an example config from README.md.
Here is the PR for correcting it.
https://github.com/fatedier/frp/pull/4938

<!-- gh-comment-id:3190899330 --> @immomo808 commented on GitHub (Aug 15, 2025): Ammm. I am not wanting to use double quotes. As I said this is an example config from README.md. Here is the PR for correcting it. https://github.com/fatedier/frp/pull/4938
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#3892
No description provided.