https://redmine.pfsense.org/https://redmine.pfsense.org/favicon.ico?16780521162018-07-20T09:13:00ZpfSense bugtrackerpfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=371372018-07-20T09:13:00ZJim Pingle
<ul><li><strong>Subject</strong> changed from <i>HA Proxy</i> to <i>HAProxy PHP error</i></li><li><strong>Category</strong> set to <i>haproxy</i></li><li><strong>Affected Version</strong> set to <i>2.4.4</i></li><li><strong>Affected Architecture</strong> <i>All</i> added</li><li><strong>Affected Architecture</strong> deleted (<del><i></i></del>)</li></ul> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=371512018-07-20T17:21:24ZPi Ba
<ul></ul><p>I suspect your using 'haproxy' package? Can you verify that haproxy-devel is working properly?</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=371612018-07-21T09:58:50ZChris Macmahon
<ul></ul><p>Yup, using Haproxy-Dev works. This is for PHP migration.</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=371742018-07-23T00:03:37ZJim Thompsonjim@netgate.com
<ul><li><strong>Assignee</strong> set to <i>Anonymous</i></li><li><strong>Target version</strong> set to <i>2.4.4</i></li></ul> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=372162018-07-23T13:55:45ZKing Jkj@kingj.net
<ul></ul><p>I have also run in to this on 2.4.4.a.20180723.1255 and HAProxy 0.57_5. Upgrading to HAProxy-devel (0.59_1) as suggested above has also resolved the issue for me.</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=372172018-07-23T14:19:35ZAnonymous
<ul></ul><p>This particular error has been fixed. It may, however, reveal more :(</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=372392018-07-24T17:53:23ZPi Ba
<ul></ul><p>If haproxy-devel package is working properly, then i should probably copy its components/fixes/features over to haproxy package.<br />Most if not all cases of php7 issues have been fixed in the -devel version (afaik). And if no bugs have been added it should be safe to copy the gui components over the stable version. I just always wonder if stuff really works properly, and tend to just include more changes into -devel when i start looking, and then again feel uncomfortable if it is the right moment to copy it over the stable package.. Anyhow no point in fixing the 'stable' version at this moment imho..</p>
<p>Ill send a PR, i guess we will find out.. :)</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=373292018-07-28T08:19:21ZChris Macmahon
<ul></ul><p>Found another:<br />PHP ERROR: Type: 1, File: /usr/local/pkg/haproxy/haproxy.inc, Line: 2859, Message: Uncaught Error: Cannot use string offset as an array in /usr/local/pkg/haproxy/haproxy.inc:2859<br />Stack trace:<br />#0 /usr/local/www/haproxy/haproxy_listeners.php(329): get_frontend_acls('A')<br />#1 {main}</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=373432018-07-29T01:28:59Z→ luckman212luke.hamburg@gmail.com
<ul></ul><p>Is this bug possibly causing this error as well?<br /><a class="external" href="https://www.reddit.com/r/PFSENSE/comments/92it0e/haproxy_setup_issue/e361t9q/">https://www.reddit.com/r/PFSENSE/comments/92it0e/haproxy_setup_issue/e361t9q/</a></p>
<p>TL;DR - Under ACLs, "Server Name Indication TLS extension matches:" option does not appear for newly created FrontEnds</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=374482018-08-02T14:04:57ZAnonymous
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>13</i></li></ul> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=374562018-08-02T14:10:13ZAnonymous
<ul><li><strong>Status</strong> changed from <i>13</i> to <i>In Progress</i></li></ul> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=374592018-08-02T14:17:45ZAnonymous
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Feedback</i></li></ul> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=374602018-08-02T14:22:32ZAnonymous
<ul></ul><p>It is not clear what this Redmine issue now means. It seems to have morphed into other errors (which may , or may not still exist) and it has blurred the lines between haproxy and haproxy-devel</p>
<p>Can we clarify this ticket, or close it and make a new one please?</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=374652018-08-02T15:45:40ZPi Ba
<ul></ul><p>The ACL issue from <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: route-to forwards broadcast and multicast frames in some scenarios (Resolved)" href="https://redmine.pfsense.org/issues/9">#9</a> was actually a 'user mistake', that was cleared on the forum.</p>
<p>This redmine ticket is i.m.o. about arrays and php7 on 2.4.4 being more strict than php5 with their usage.</p>
<p>It 'should' mostly work now, but i have still got some pending commits regarding the way of handling this..</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=374932018-08-03T11:45:37ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>New</i></li></ul><p>Yes, this is still about PHP7 array issues, and there are a few outstanding. Here is one that happens with a clean install of haproxy on a firewall that has never had haproxy before:</p>
<pre>
8:58:35 PHP ERROR: Type: 1, File: /usr/local/pkg/haproxy/haproxy.inc, Line: 2189, Message: Uncaught Error: Cannot create references to/from string offsets in /usr/local/pkg/haproxy/haproxy.inc:2189
Stack trace:
#0 /usr/local/pkg/haproxy/haproxy.inc(2226): haproxy_get_transparent_backends()
#1 /etc/inc/filter.inc(4375): haproxy_generate_rules('filter')
#2 /etc/inc/filter.inc(410): discover_pkg_rules('filter')
#3 /etc/rc.filter_configure_sync(29): filter_configure_sync()
#4 {main}
thrown
</pre>
<p>Have a look at the new function I just added in <a class="external" href="https://github.com/pfsense/pfsense/commit/65b5efa73bb866f0642de640174fb7028a4fc604">https://github.com/pfsense/pfsense/commit/65b5efa73bb866f0642de640174fb7028a4fc604</a> -- it will create nested arrays for you only if they are not currently arrays. So it leaves existing settings alone but will make sure they exist before you use them.</p>
<p>For example that line in haproxy.inc is:<br /><pre>
$a_backends = &$config['installedpackages']['haproxy']['ha_pools']['item'];
</pre></p>
<p>With that function, you can do this:</p>
<pre>
init_config_arr(array('installedpackages', 'haproxy', 'ha_pools', 'item'));
$a_backends = &$config['installedpackages']['haproxy']['ha_pools']['item'];
</pre>
<p>It is only in 2.4.4 at the moment, so if you want to keep the same code on other branches you could either copy it with a function_exists() check or a version check before running it. That's a lot better than four levels of manual is_array() if/create array/blah sections.</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=374972018-08-03T14:05:33ZPi Ba
<ul></ul><p>I'm going to revisit all those items.. and get rid of this kind of array lookup completely replacing them with this single function call:<br />$a_backends = &getarraybyref($config,'installedpackages','haproxy','ha_pools','item');</p>
<p>My initial though of a central 'initialize' function preferably once on installation can not guarantee that stuff is and stays initialized. And to avoid cluttering the code with lots of !is_array(x) { x = array() } lines.. this is i guess the better option..</p>
<p>First i want be sure that 2.4.3 works properly though.. Next PR should probably not get backported immediately :)</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=376572018-08-14T13:21:10ZAnonymous
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Assigned</i></li></ul> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=381832018-08-30T16:49:44ZPi Ba
<ul></ul><p>This issues with haproxy should be fixed with current 0.59_11 version. If not please let me know the exact error you get and when that happens.</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=383152018-09-11T13:41:25ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Feedback</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>Normal-package</i></li></ul> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=383752018-09-15T07:02:09ZChris Macmahon
<ul></ul><p>I am no longer seeing these errors.</p> pfSense Packages - Bug #8670: HAProxy PHP errorhttps://redmine.pfsense.org/issues/8670?journal_id=383762018-09-15T07:02:20ZChris Macmahon
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li></ul>