Bug 482504

Summary: Plasma-firewall shows ufw is disabled while it is in fact enabled
Product: [Applications] systemsettings Reporter: gtpepi
Component: kcm_firewallAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: arojas, erfan.qeui, givver70, kdebugs, koshikas, lucas.biaggi, nate, robhedstrom, saileshpoudel0, tcanabrava
Priority: NOR Keywords: qt6
Version First Reported In: 6.0.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Firewall system settings and ufw status via cli

Description gtpepi 2024-03-06 01:29:37 UTC
Created attachment 166454 [details]
Firewall system settings and ufw status via cli

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Have ufw set up and running, confirm via ufw status
2. Install plasma-firewall 6.0.0-1
3. Navigate to System Settings > Wifi & Networking > Firewall
4. Try to enable it

OBSERVED RESULT
Firewall is shown as disable while it is in fact enabled:
$ ufw status
Status: active


Clicking in the checkbox to enable it generates the following log, and does nothing in the UI:
Mar 05 22:22:03 archlinux systemsettings[2311]: ufw.client: Starting the set Enabled job
Mar 05 22:22:03 archlinux systemsettings[2311]: ufw.client: Set Enabled job finished, triggering a status query.
Mar 05 22:22:03 archlinux systemsettings[2311]: ufw.client: Job error:  4

EXPECTED RESULT
Show actual firewall status and toggle it as it does in a KDE 5 install.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 6.7.8-zen1-1-zen
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Comment 1 kdebugs 2024-03-06 17:18:50 UTC
Can confirm. Additionally, I can't enable or disable the firewall (error in command «setStatus»)

Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.8-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3800XT 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6750 XT
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C94
System Version: 1.0
Comment 2 Nate Graham 2024-03-06 17:52:38 UTC
Works for me with firewalld, maybe there's an issue with the ufw backend.
Comment 3 Nicolas Fella 2024-03-07 16:37:19 UTC
*** Bug 482640 has been marked as a duplicate of this bug. ***
Comment 4 Nicolas Fella 2024-03-07 16:38:17 UTC
*** Bug 482739 has been marked as a duplicate of this bug. ***
Comment 5 Robert Hedstrom 2024-03-09 21:15:37 UTC
I'm also on Arch and found that line 1 of "/usr/lib/kde_ufw_plugin_helper.py" was "#!_Python3_EXECUTABLE-NOTFOUND". After changing to "#!/usr/bin/python3", plasma-firewall started working. I don't know if the problem is Arch specific or not, but this is a temporary work around if you want the UI instead of using the CLI.
Comment 6 Nate Graham 2024-03-09 23:05:50 UTC
That file comes from plasma-firewall, so it's possible it's our fault.
Comment 7 Antonio Rojas 2024-03-10 10:14:48 UTC
It's a packaging issue (missing python at build time). The cmake output could definity be improved though, and possibly disable the ufw backend completely if python is not found.
Comment 8 Nicolas Fella 2024-05-07 20:44:40 UTC
*** Bug 486745 has been marked as a duplicate of this bug. ***
Comment 9 Erfan 2024-05-07 22:05:44 UTC
Is there any plan to fix it i still have this problem on plasma 6.0.4 in Arch
Comment 10 Givver 2024-05-15 17:00:55 UTC
I am using Manjaro and the latest Plasma 6 update.  The first line in "/usr/lib/kde_ufw_plugin_helper.py" was "#!_Python3_python3.11" but this version of Manjaro has switched to Python 3.12 and removed 3.11.  After changing the first line of that file to "#!/usr/bin/python3" as suggested by Robert Hedstrom above, it fixed the problem.