cloudpanel-io / cloudpanel-ce

1.21k stars 99 forks source link

500 Error on Firewall Port Edit #462

Closed BakirGracic closed 3 months ago

BakirGracic commented 4 months ago

CloudPanel version(s) affected

2.4.2 (latest in time of posting)

Description

When editing custom firewall port rule 3 unexpected things happen:

  1. Type changes to "SSH/SFTP" even if it was previously set (in creation) to "Custom"
  2. On submitting the edit (i.e. changing the port number) 500 Error page occurs (see image below)
  3. session terminates (i.e. I must log in to panel again)

image

How to reproduce

Add custom port rule Edit that same rule

Possible Solution

No response

Additional Context

Additional info about my configuration:

Ubuntu server 1 admin user (only user) panel bound to domain many sites present on panel 4-6 other firewall port rules present (both ipv4 and ipv6) latest version of cloudpanle (2.4.2) in time of posting this bug system was rebooted regularly (stale data/state errors may not be expected cause of bug)

P.S. thanks for adding Bosnian translation :D

cloudpanel-io commented 4 months ago

I have created a patch, please test and confirm:

Login via ssh and execute the following command as root:

curl https://gist.githubusercontent.com/swieczorek/95df2d058bb5c048e1c608b88dbcd9e5/raw/3b2d666a3f4af855fbbcce6c492da9e6e82bbc31/gistfile1.txt > /home/clp/htdocs/app/files/src/Controller/Admin/FirewallController.php

Thanks :-)

BakirGracic commented 4 months ago

Executing the command with root user, rebooting the server and replicating the bug was not successful! Patch was of no help

Maybe the problem was with my configuration? Have you been able to replicate the error yourself?

Keep in mind this is not a major problem, just a mild inconvenience, since editing a firewall port has an extra step of deleting the old one and creating a new one xD

I'm available to provide any additional help/info to solve this! Thank you for creating this software!

smartlocaliza commented 3 months ago

It also appeared for me in Ubuntu 24.04, I resolved it by removing the ssh port within the Cloud panel and registering it again.

it worked out

cloudpanel-io commented 3 months ago

@BakirGracic, can you please get in touch with me on Discord (stefan.wieczorek)?

I want to check the patch with you.

cloudpanel-io commented 3 months ago

It also appeared for me in Ubuntu 24.04, I resolved it by removing the ssh port within the Cloud panel and registering it again.

it worked out

I have updated the patch. Can you please apply again and confirm that it's working for you?

smartlocaliza commented 3 months ago

Captura de tela 2024-05-22 110433

The error appeared again when I went to edit the SSH port. To work I delete the SSH port within the Panel and register again.

Only this way will it work.

smartlocaliza commented 3 months ago

v2.4.2 - [2024-05-21]

I have this version

cloudpanel-io commented 3 months ago

@smartlocaliza Please see this message:

https://github.com/cloudpanel-io/cloudpanel-ce/issues/462#issuecomment-2123193521

BakirGracic commented 3 months ago

@cloudpanel-io

The new patch has solved the issue!

I've ran the patch command again as root user from the previous comment, rebooted the server, edited the port number and in response got the green success notification!

But still there is the issue with the custom port label I mentioned before. When editing the Custom port, on the edit page it automatically changes the port label to "SSH/SFTP"

The third issue of session terminating has also been resolved with the patch, i.e. when I successfuly edit the port number, my session perists.

And I've messaged you on Discord via DM