Server
- FOG Version: SVN 6017
- OS: Debian 8 (Jessie)
Client
- Service Version:
- OS:
Description
Updated to SVN 6017, now getting 500 Server errors…according to apache logs it seems to be coming from fogmanagercontroller.class.php on line 506, but I am no php guy and can’t make heads or tails of it.
public function count(
$findWhere = array(),
$whereOperator = 'AND',
$compare = '='
) {
if (empty($findWhere)) {
$findWhere = array();
}
if (empty($whereOperator)) {
$whereOperator = 'AND';
}
if (empty($compare)) {
$compare = '=';
}
$whereArray = array();
$countVals = $countKeys = array();
if (count($findWhere)) {
foreach ((array) $findWhere as $field => &$value) {
$field = trim($field);
if (is_array($value)) {
foreach ((array) $value as $index => &$val) {
$key = sprintf(
'%s_%d',
$field,
$index
);
$countKeys[] = sprintf(':%s', $key);
$countVals[$key] = $val;
unset($val);
}
$whereArray[] = sprintf(
'`%s` IN (%s)',
$this->databaseFields[$field],
implode(',', $countKeys)
);
unset($countKeys);
} else {
$countVals[$field] = $value;
$whereArray[] = sprintf(
'`%s` %s :%s',
$this->databaseFields[$field],
(
preg_match(
'#%#',
$value
) ?
'LIKE' :
trim($compare)
),
$field
);
}
unset($value, $field);
}
}
$knownEnable = array(
'Image',
'Snapin',
'StorageNode',
);
$nonEnable = !(in_array($this->childClass, $knownEnable));
$isEnabled = array_key_exists(
'isEnabled',
$this->databaseFields
);
if ($nonEnable && $isEnabled) {
$isEnabled = sprintf(
'`%s`=1',
$this->databaseFields['isEnabled']
);
}
$query = sprintf(
$this->countQueryTemplate,
$this->databaseTable,
$this->databaseFields['id'],
$this->databaseTable,
(
count($whereArray) ?
sprintf(
' WHERE %s%s',
implode(
sprintf(
' %s ',
$whereOperator
),
(array) $whereArray
),
(
$isEnabled ?
sprintf(
' AND %s',
$isEnabled
) :
''
)
) :
(
$isEnabled ?
sprintf(
' WHERE %s',
$isEnabled
) :
''
)
)
);
return (int) self::$DB
->query($query, array(), $countVals)
->fetch()
->get('total');
}
Apache log:
PHP Warning: implode(): Invalid arguments passed in /var/www/fog/lib/fog/fogmanagercontroller.class.php on line 506, referer: http://fog.tusc.kent.edu/fog/management/index.php
[Mon Nov 28 11:08:39.063515 2016] [:error] [pid 17582] [client 10.20.100.4:60145] PHP Warning: implode(): Invalid arguments passed in /var/www/fog/lib/fog/fogmanagercontroller.class.php on line 506, referer: http://fog.tusc.kent.edu/fog/management/index.php
[Mon Nov 28 11:09:13.324410 2016] [:error] [pid 17817] [client 131.123.128.69:45113] PHP Warning: fopen(/var/log/apache2/error.log): failed to open stream: Permission denied in /var/www/fog/status/logtoview.php on line 60
[Mon Nov 28 11:09:20.723001 2016] [:error] [pid 17767] [client 131.123.128.69:45134] PHP Warning: fopen(/var/log/apache2/error.log): failed to open stream: Permission denied in /var/www/fog/status/logtoview.php on line 60
[Mon Nov 28 11:09:34.061501 2016] [:error] [pid 17819] [client 10.20.100.4:60189] PHP Warning: implode(): Invalid arguments passed in /var/www/fog/lib/fog/fogmanagercontroller.class.php on line 506, referer: http://fog.tusc.kent.edu/fog/management/index.php
[Mon Nov 28 11:09:38.978830 2016] [:error] [pid 17888] [client 10.20.100.8:62603] PHP Fatal error: Uncaught exception 'Exception' with message 'StorageNode must be a valid node' in /var/www/fog/lib/fog/fogbase.class.php:1218\nStack trace:\n#0 /var/www/fog/lib/pages/imagemanagementpage.class.php(279): FOGBase->getFTPByteSize(Object(StorageNode), '/SurfacePro3S16')\n#1 /var/www/fog/lib/pages/imagemanagementpage.class.php(372): ImageManagementPage->{closure}('SurfacePro3S16', Object(StorageNode))\n#2 [internal function]: ImageManagementPage->{closure}(Object(Image), 18)\n#3 /var/www/fog/lib/pages/imagemanagementpage.class.php(476): array_walk(Array, Object(Closure))\n#4 /var/www/fog/lib/fog/fogpagemanager.class.php(256): ImageManagementPage->index()\n#5 /var/www/fog/management/index.php(49): FOGPageManager->render()\n#6 {main}\n thrown in /var/www/fog/lib/fog/fogbase.class.php on line 1218, referer: http://fog.tusc.kent.edu/fog/management/index.php?node=image
[Mon Nov 28 11:09:44.072496 2016] [:error] [pid 17819] [client 10.20.100.4:60189] PHP Warning: implode(): Invalid arguments passed in /var/www/fog/lib/fog/fogmanagercontroller.class.php on line 506, referer: http://fog.tusc.kent.edu/fog/management/index.php
[Mon Nov 28 11:09:49.156332 2016] [:error] [pid 17819] [client 10.20.100.4:60189] PHP Warning: implode(): Invalid arguments passed in /var/www/fog/lib/fog/fogmanagercontroller.class.php on line 506, referer: http://fog.tusc.kent.edu/fog/management/index.php
[Mon Nov 28 11:09:54.072569 2016] [:error] [pid 17819] [client 10.20.100.4:60189] PHP Warning: implode(): Invalid arguments passed in /var/www/fog/lib/fog/fogmanagercontroller.class.php on line 506, referer: http://fog.tusc.kent.edu/fog/management/index.php
[Mon Nov 28 11:09:57.133602 2016] [:error] [pid 18017] [client 10.20.100.1:56409] PHP Fatal error: Uncaught exception 'Exception' with message 'StorageNode must be a valid node' in /var/www/fog/lib/fog/fogbase.class.php:1218\nStack trace:\n#0 /var/www/fog/lib/pages/imagemanagementpage.class.php(279): FOGBase->getFTPByteSize(Object(StorageNode), '/960F16')\n#1 /var/www/fog/lib/pages/imagemanagementpage.class.php(372): ImageManagementPage->{closure}('960F16', Object(StorageNode))\n#2 [internal function]: ImageManagementPage->{closure}(Object(Image), 1)\n#3 /var/www/fog/lib/pages/imagemanagementpage.class.php(476): array_walk(Array, Object(Closure))\n#4 /var/www/fog/lib/fog/fogpagemanager.class.php(256): ImageManagementPage->index()\n#5 /var/www/fog/management/index.php(49): FOGPageManager->render()\n#6 {main}\n thrown in /var/www/fog/lib/fog/fogbase.class.php on line 1218, referer: http://fog.tusc.kent.edu/fog/management/index.php?node=image
[Mon Nov 28 11:11:04.327490 2016] [:error] [pid 18056] [client 10.20.100.4:60227] PHP Warning: implode(): Invalid arguments passed in /var/www/fog/lib/fog/fogmanagercontroller.class.php on line 506, referer: http://fog.tusc.kent.edu/fog/management/index.php