Project

General

Profile

Bug #10925

PHP: Invalid argument supplied for foreach() in /etc/inc/util.inc on line 2640

Added by Craig Weber 28 days ago. Updated 25 days ago.

Status:
Resolved
Priority:
Normal
Category:
Routing
Target version:
Start date:
09/22/2020
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.5.0
Affected Architecture:
All

Description

Invalid argument supplied for foreach() in /etc/inc/util.inc on line 2640 error at boot.

Has started happening about 1 week ago (I update nightly to the latest snapshots). This is on an SG-5100 but I do not see this option under "Affected Architecture" in the dropdown for creating an issue.

PHP_errors.log (125 Bytes) PHP_errors.log Craig Weber, 09/22/2020 01:39 AM

Associated revisions

Revision ffe95182 (diff)
Added by Renato Botelho 27 days ago

Fix #10925: Check if $rtable is empty

History

#1 Updated by Jim Pingle 27 days ago

  • Category set to Routing
  • Assignee set to Renato Botelho
  • Target version set to 2.5.0
  • Affected Version changed from 2.5.x to 2.5.0

That's line 2640 on factory and line 2624 on CE.

The foreach() here:

    $rtable = route_table();

    $result = array();
    foreach ($rtable[$family] as $item) {
        if ($item['destination'] == $target) {
            $result[] = $item;
        }
    }

$rtable is always an array coming out of route_table() but it could be empty, so needs a validity test before foreach().

#2 Updated by Renato Botelho 27 days ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#3 Updated by Craig Weber 25 days ago

Renato Botelho wrote:

Applied in changeset ffe95182999a344dd926c5079a3f74ccc62e0f46.

Great, thank you! If the status is Feedback I assume this has not yet been pushed to the regular snapshots? I've just done the most recent snapshot update and the error did not occur (yet) however it seems to be somewhat random.

#4 Updated by Renato Botelho 25 days ago

  • Status changed from Feedback to Resolved

Craig Weber wrote:

Renato Botelho wrote:

Applied in changeset ffe95182999a344dd926c5079a3f74ccc62e0f46.

Great, thank you! If the status is Feedback I assume this has not yet been pushed to the regular snapshots? I've just done the most recent snapshot update and the error did not occur (yet) however it seems to be somewhat random.

It's on recent snapshots. Ticket is in feedback state so we can hear from you if the fix worked. Based on what you said I understand it did so I'm closing the ticket.

If you see the problem yet please let us know and ticket can be re-opened. Thanks

Also available in: Atom PDF