Error with SVN 6017 and HTTP 500



  • 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
    

  • Moderator

    I agree with Quazz about updating to the latest RC. Every new RC has fixes.


  • Moderator

    @svalding Double slash shouldn’t cause issues though (try adding a double slash in an url, it will resolve just fine)

    Could you update to the latest version? Might help.



  • 0_1480429547013_upload-68de493c-d98f-4960-9f83-f985b8633b46

    Is that double slash normal on the FTP path? I’m quite sure that I have had to remove it before. That could possibly be the cause of my issue!



  • 0_1480428071049_upload-eb1d2aae-ef46-45c6-ae2c-54990296a6e8

    0_1480428113206_upload-05d541df-5d7e-4aa6-8bd2-a7a7ca177d71

    Here are some screen shots from those two commands listed above. I’m testing FTP right now.


  • Senior Developer

    @Wayne-Workman Sorry, we don’t know that. There isn’t a way to know that.


  • Moderator

    @Tom-Elliott He did post them in the OP, but nodeBB has forever not placed the tripple back-ticks on a new line when it is closing a code block. I fixed his post so the logs are now visible above.

    @svalding Could you please check the below things:

    • Everything inside of /opt/fog/log is owned by root:root. check with ls -la /opt/fog/log There should be 12 individual logs in there.
    • See if there are any fog related logs appearing in the root directory.
      ** There should only be one directory that returns with this command and not any logs: ls -la / | grep fog
    • Manually verify that your FTP credentials for your fog server (which I assume is a stand-alone server) are indeed correct. There’s a testing FTP section in this wiki article: https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_FTP

  • Senior Developer

    @svalding What’s the error from the error logs?



  • 0_1480356335636_upload-69117193-80ed-4ece-b1c8-4861ab4b83b6

    0_1480356285788_upload-05909c63-e03c-4a66-8636-e9b84feb9cb3

    then go to images and get this
    The fog.tusc.kent.edu page isn’t working
    fog.tusc.kent.edu is currently unable to handle this request.
    HTTP ERROR 500


  • Senior Developer

    What’s the exact error you’re seeing?


Log in to reply
 

371
Online

39.3k
Users

11.0k
Topics

104.4k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.