Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Adding/Editing IP will cause 500 internal server error #4312

Open
tenent007963 opened this issue Mar 1, 2024 · 3 comments
Open

[Bug] Adding/Editing IP will cause 500 internal server error #4312

tenent007963 opened this issue Mar 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tenent007963
Copy link

Describe the bug

Editing or adding new IP in Network section will cause a temporary 500 internal server error, no changes are saved during the error.
Investigating the log and network requests indicates a "v_owner" variable is missing from the POST request, and exceptions not handled properly.

Tell us how to replicate the bug

  1. Click "Server Settings"
  2. Click "Configure"
  3. Click "Network"
  4. Add IP Address/Edit IP Address
  5. make changes and click "Save"

Which components are affected by this bug?

Firewall (Iptables, Fail2ban)

Hestia Control Panel Version

1.8.11

Operating system

Ubuntu 20.04

Log capture

[error] 1109#0: *199 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined array key "v_owner" in /usr/local/hestia/web/add/ip/index.php on line 51; PHP message: PHP Fatal error:  Uncaught TypeError: Hestiacp\quoteshellarg\quoteshellarg(): Argument #1 ($arg) must be of type string, null given, called in /usr/local/hestia/web/add/ip/index.php on line 51 and defined in /usr/local/hestia/web/inc/vendor/hestiacp/phpquoteshellarg/src/Hestiacp/quoteshellarg/quoteshellarg.php:14
@tenent007963 tenent007963 added the bug Something isn't working label Mar 1, 2024
@tenent007963
Copy link
Author

tenent007963 commented Mar 1, 2024

Temporary fix:
Using inspect element, find v_owner select tag and add this line in it:
<option name="admin">admin</option>

@jaapmarcus
Copy link
Member

Known issue it has been fixed allready in the codebase

@tenent007963
Copy link
Author

tenent007963 commented Mar 9, 2024

Are you by any chance referring to this code block?

<div x-cloak x-show="!showUserTable" id="usrtable">
	<div class="u-mb10">
		<label for="v_owner" class="form-label"><?= _("Assigned User") ?></label>
		<select class="form-select" name="v_owner" id="v_owner">
			<?php
				foreach ($users as $key => $value) {
					echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
					if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
					echo ">".htmlentities($value)."</option>\n";
				}
			?>
		</select>
	</div>
</div>

If yes, then I'm afraid this is the exact code that is causing the control panel to not give any available options to select. I've check the last updated version of add_ip.php together with the latest release version, apparently it doesn't work as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants