Project

General

Profile

Actions

Bug #15911

closed

PHP error on save with very long configuration change descriptions

Added by Pawel Piaskowy about 1 month ago. Updated 12 days ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Configuration Backend
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
25.03
Release Notes:
Default
Affected Version:
2.8.0
Affected Architecture:

Description

In the https shared haproxy frontend I have currently 58 lines of text / 2503 bytes in total in "Advanced pass thru" field.
Starting from pfsense+ 24.11 (?), whenever I attempt to edit that conent and save in webGUI I see following crash:

PHP {$errortype}s

PHP ERROR: Type: 1, File: /etc/inc/config.lib.inc, Line: 696, Message: Uncaught ValueError: gettext(): Argument #1 ($message) is too long in /etc/inc/config.lib.inc:696
Stack trace:
#0 /etc/inc/config.lib.inc(696): gettext()
#1 /usr/local/www/haproxy/haproxy_listeners_edit.php(470): write_config()
#2 {main}
thrown 2024-12-07 23:12:52
PHP ERROR: Type: 1, File: /etc/inc/config.lib.inc, Line: 696, Message: Uncaught ValueError: gettext(): Argument #1 ($message) is too long in /etc/inc/config.lib.inc:696
Stack trace:
#0 /etc/inc/config.lib.inc(696): gettext()
#1 /usr/local/www/haproxy/haproxy_listeners_edit.php(470): write_config()
#2 {main}
thrown
2024-12-07 23:15:32

I am not sure what is text length limitation, but I think could be bit longer. Hope this helps.

Actions #1

Updated by Christopher Cope about 1 month ago

  • Status changed from New to Confirmed

Issue confirmed on

25.01-DEVELOPMENT (amd64)
built on Fri Dec 6 21:32:00 UTC 2024
FreeBSD 15.0-CURRENT

The limit for gettext is 4096 characters. This is called when logging the config changes to the log. This can be worked around currently by disabling Status > System Logs > Settings > Log Configuration Changes

Unless I'm missing something, I think gettext shouldn't need to be used on revision/description. Since the config changes are unique and would never be exactly in a translation file.

Perhaps the descriptions are generic enough elsewhere for this to make sense as-is. At the very least, I think a check for a string length of above 4096 with a fallback to not use gettext is needed.

Actions #2

Updated by Jim Pingle about 1 month ago

  • Project changed from pfSense Plus to pfSense Packages
  • Subject changed from pfsense+ 24.11 - haproxy GUI crash to PHP error in haproxy configuration change description
  • Category changed from Web Interface to haproxy
  • Release Notes deleted (Default)
Actions #3

Updated by Marcos M 17 days ago

  • Status changed from Confirmed to Feedback
  • Assignee set to Marcos M
  • Target version set to 2.8.0
  • Plus Target Version set to 25.03
  • Affected Version set to 2.8.0

The revision description was not meant to be included in the translation.

Actions #4

Updated by Marcos M 17 days ago

  • % Done changed from 0 to 100
Actions #5

Updated by Jim Pingle 13 days ago

  • Project changed from pfSense Packages to pfSense
  • Subject changed from PHP error in haproxy configuration change description to PHP error on save with very long configuration change descriptions
  • Category changed from haproxy to Configuration Backend
  • Affected Plus Version deleted (24.11)
  • Release Notes set to Default
Actions #6

Updated by Danilo Zrenjanin 12 days ago

  • Status changed from Feedback to Resolved

I was able to reproduce the issue on 24.11

Tested against the latest dev build.

The issue is fixed.

Actions

Also available in: Atom PDF