[Bug] Failed to retrieve UFW status.
Contact Information
No response
1Panel Version
v1.10.22-lts
Problem Description
My UFW is already enabled, but it is displayed as disabled in 1Panel.
ๆ็ ufw ๆฏๅทฒ็ปๅผๅฏ็็ถๆ๏ผไฝๆฏๅจ 1panel ไธญๅดๆพ็คบๆๆชๅฏ็จ
Steps to Reproduce
When the system language is neither English nor Simplified Chinese, open the /hosts/firewall/port screen.
ๅฝ็ณป็ปไธๆฏ่ฑๆๆ็ฎไฝไธญๆๆถ๏ผๅผๅฏ /hosts/firewall/port ็ป้ข
The expected correct result
No response
Related log output
No response
Additional Information
It is recommended to set the environment before executing the status query command in backend/utils/firewall/client/ufw.go.
For example:
LANGUAGE=en_US:en ufw status
ๅปบ่ฎฎๅจ backend/utils/firewall/client/ufw.go ๆง่ก็ถๆๆฅ่ฏขๅฝไปคๅ ่ฎพ็ฝฎ็ฏๅข
ๅฆ: LANGUAGE=en_US:en ufw status
ๆ่ฐขๅ้ฆ๏ผ้บป็ฆๆง่ก which ufw ็ไธไธ
Bot detected the issue body's language is not English, translate it automatically. ๐ฏ๐ญ๐ป๐งโ๐คโ๐ง๐ซ๐ง๐ฟโ๐คโ๐ง๐ป๐ฉ๐พโ๐คโ๐จ๐ฟ๐ฌ๐ฟ
Thanks for the feedback, please run which ufw to take a look
ๆ่ฌๅ้ฅ๏ผ้บป็ ฉ่ซ็
which ufwไธไธ
ๆ่ฐขๅ้ฆ๏ผ้บป็ฆๆง่ก
which ufw็ไธไธ
$ which ufw /usr/sbin/ufw
Bot detected the issue body's language is not English, translate it automatically. ๐ฏ๐ญ๐ป๐งโ๐คโ๐ง๐ซ๐ง๐ฟโ๐คโ๐ง๐ป๐ฉ๐พโ๐คโ๐จ๐ฟ๐ฌ๐ฟ
Thanks for the feedback, please take a look at
which ufw
Thanks for the feedback, please run
which ufwto take a look
$ which ufw /usr/sbin/ufw
่ฟๆ ทๅบ่ฏฅๆฏ่ฝๆญฃๅธธ่ทๅๅฐ็๏ผ่ฟไธค้จๅๅช้ๆ้ฎ้ขๆนไพฟๆชๅพ็็ๅ
Bot detected the issue body's language is not English, translate it automatically. ๐ฏ๐ญ๐ป๐งโ๐คโ๐ง๐ซ๐ง๐ฟโ๐คโ๐ง๐ป๐ฉ๐พโ๐คโ๐จ๐ฟ๐ฌ๐ฟ
This should be able to be obtained normally. Can you take a screenshot to see if there are any problems with these two parts?
่ฟๆ ทๅบ่ฏฅๆฏ่ฝๆญฃๅธธ่ทๅๅฐ็๏ผ่ฟไธค้จๅๅช้ๆ้ฎ้ขๆนไพฟๆชๅพ็็ๅ
ไธๅฅฝๆๆ๏ผๆ็ผ็พๆๅจ Steps to Reproduce ็ถฒ้ ่ทฏๅพๆ้ฏไบ๏ผๆญฃ็ขบๆ่ฉฒๆฏ /hosts/firewall/port
้ๆฏๆชๅ
ๆ่ฌๆ่ฌ๏ผไธๅ็ๆฌๆๅๅชๅ่ฉฒ้จๅๅคๆท
Bot detected the issue body's language is not English, translate it automatically. ๐ฏ๐ญ๐ป๐งโ๐คโ๐ง๐ซ๐ง๐ฟโ๐คโ๐ง๐ป๐ฉ๐พโ๐คโ๐จ๐ฟ๐ฌ๐ฟ
Thank you. We will optimize this part in the next version.
้บป็ ฉๅๆชๅ็ไธไธไธ้ขๅฝไปค่ฟๅ
ufw status | grep Status้ฒ็ซๅขป้ ้ขๆ้ๅๆ้๏ผ้ปๆ่ฝๆญฃๅธธๆ้ๅ๏ผ
ๆ็ ufw ๆฌไพๅฐฑๆฏ้ๅ็็ๆ
๏ผ้ปไธๅพๅฅฝๅๅชๆฏๅฎ็ด็้ๅไบ 1Panelใ
Bot detected the issue body's language is not English, translate it automatically. ๐ฏ๐ญ๐ป๐งโ๐คโ๐ง๐ซ๐ง๐ฟโ๐คโ๐ง๐ป๐ฉ๐พโ๐คโ๐จ๐ฟ๐ฌ๐ฟ
Please take another screenshot and check the following command to return
ufw status | grep StatusThere is an enable button on the firewall page. Can it be opened normally by clicking on it?
My ufw is originally turned on, but after clicking it, it seems to simply restart 1Panel.
v1.10.23-lts ็ๆฌๅทฒๅๅธใ
