View Issue Details

IDProjectCategoryView StatusLast Update
0001771RackTablesdefaultpublic2017-08-03 13:24
ReporterstianfpAssigned To 
PriorityhighSeveritymajorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version0.20.13 
Target Version0.21.0Fixed in Version 
Summary0001771: PHP Warning: A non-numeric value encountered in functions.php on line 5357
DescriptionPHP version: PHP 7.1.6 (cli) (built: Jun 7 2017 12:15:54) ( NTS )
OS version: Red Hat Enterprise Linux Server release 7.3 (Maipo)

Racktables outputs this error with every step you take on the website.

See this for info: http://php.net/manual/en/migration71.other-changes.php
Steps To ReproduceInstall racktables with the versions provided.
TagsNo tags attached.

Activities

infrastation

infrastation

2017-06-16 11:14

administrator   ~0003625

Regarding the warning, the code in question is:
function loadConfigDefaults()
{
    $ret = loadConfigCache();
    if (!count ($ret))
        throw new RackTablesError ('Failed to load configuration from the database.', RackTablesError::INTERNAL);
    foreach ($ret as $varname => &$row)
    {
        $row['is_altered'] = 'no';
        if ($row['vartype'] == 'uint')
            $row['varvalue'] = 0 + $row['varvalue'];


This used to cast the value to an integer.

Regarding PHP 7.1, on Ubuntu 17.04 it is available as an option (7.0 is the default).
infrastation

infrastation

2017-06-16 11:44

administrator   ~0003629

I have tried Ubuntu 17.04 in a virtual machine and it does not have a PHP 7.1 option despite what Ubuntu web-site implies. To fix this bug there should be a way to reproduce it first.
stianfp

stianfp

2017-06-16 12:04

reporter   ~0003631

https://launchpad.net/~ondrej/+archive/ubuntu/php/+index?batch=75&memo=225&start=225

sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update -y

apt-cache pkgnames | grep php7.1
infrastation

infrastation

2017-06-16 13:53

administrator   ~0003633

Thank you, let me try once again later.
infrastation

infrastation

2017-07-24 16:43

administrator   ~0003649

I could reproduce this issue using Fedora 26, which comes with PHP 7.1 by default. There is no quick and simple solution to this particular problem, it requires some careful re-engineering.
infrastation

infrastation

2017-08-03 13:24

administrator   ~0003661

From now on this issue is also visible in the Travis CI build of RackTables, which now includes a job with PHP 7.1 (which currently fails).

Issue History

Date Modified Username Field Change
2017-06-13 09:08 stianfp New Issue
2017-06-13 09:08 stianfp Tag Attached: PHP Warning: A non-numeric value encountered in functions.php
2017-06-16 11:05 infrastation Tag Detached: PHP Warning: A non-numeric value encountered in functions.php
2017-06-16 11:14 infrastation Note Added: 0003625
2017-06-16 11:44 infrastation Note Added: 0003629
2017-06-16 12:04 stianfp Note Added: 0003631
2017-06-16 13:53 infrastation Note Added: 0003633
2017-07-24 16:43 infrastation Status new => acknowledged
2017-07-24 16:43 infrastation Target Version => 0.21.0
2017-07-24 16:43 infrastation Note Added: 0003649
2017-08-03 13:24 infrastation Note Added: 0003661