Boot looping after attempted virus scan
-
@dolf Probably the generated iPXE script output is screwed up. Please open http://your.fog.ip.addr/fog/service/ipxe/boot.php?mac=xx:xx:xx:xx:xx:xx (put in the MAC of your client) in your browser and post the full (!) output here - mask IPs if you like but please post the full script so we know what you see!
-
Output of that link is attached:
I did not expect to see HTML… Parsing the HTML renders this beauty of an error message:
-
@dolf Anything in the apache error log (ubuntu/debian: /var/log/apache2/error.log, redhat/centos: /var/log/httpd/error_log) when you request this URL in your browser? Just asking because the “An error occurred while invoking the map callback in…” is not very much information they give us.
-
Same info there:
[Thu Apr 21 15:28:18.306005 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP Stack trace: [Thu Apr 21 15:28:18.306011 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 1. {main}() /var/www/html/fog/service/ipxe/boot.php:0 [Thu Apr 21 15:28:18.306016 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 2. FOGBase::getClass() /var/www/html/fog/service/ipxe/boot.php:13 [Thu Apr 21 15:28:18.306021 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 3. ReflectionClass->newInstanceArgs() /var/www/html/fog/lib/fog/fogbase.class.php:86 [Thu Apr 21 15:28:18.306027 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 4. BootMenu->__construct() /var/www/html/fog/lib/fog/fogbase.class.php:86 [Thu Apr 21 15:28:18.306032 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 5. HookManager->processEvent() /var/www/html/fog/lib/fog/bootmenu.class.php:89 [Thu Apr 21 15:28:18.306037 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 6. array_map() /var/www/html/fog/lib/fog/hookmanager.class.php:40 [Thu Apr 21 15:28:18.306042 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 7. HookManager->{closure:/var/www/html/fog/lib/fog/hookmanager.class.php:36-40}() /var/www/html/fog/lib/fog/hookmanager.class.php:40 [Thu Apr 21 15:28:18.306048 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 8. call_user_func:{/var/www/html/fog/lib/fog/hookmanager.class.php:38}() /var/www/html/fog/lib/fog/hookmanager.class.php:38 [Thu Apr 21 15:28:18.306053 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 9. ChangeItems->BootItemSettings() /var/www/html/fog/lib/fog/hookmanager.class.php:38 [Thu Apr 21 15:28:18.306059 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 10. LocationAssociation->getStorageNode() /var/www/html/fog/lib/plugins/location/hooks/changeitems.hook.php:34 [Thu Apr 21 15:28:18.306064 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 11. FOGBase::getClass() /var/www/html/fog/lib/plugins/location/class/locationassociation.class.php:27 [Thu Apr 21 15:28:18.306069 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 12. ReflectionClass->newInstanceArgs() /var/www/html/fog/lib/fog/fogbase.class.php:86 [Thu Apr 21 15:28:18.306074 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 13. FOGController->__construct() /var/www/html/fog/lib/fog/fogbase.class.php:86 [Thu Apr 21 15:28:18.306079 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 14. FOGController->load() /var/www/html/fog/lib/fog/fogcontroller.class.php:26 [Thu Apr 21 15:28:18.306084 2016] [:error] [pid 16715] [client 146.232.223.197:24145] PHP 15. array_map() /var/www/html/fog/lib/fog/fogcontroller.class.php:194
Looking at the code:
161 protected function load($field = 'id') { 162 $this->info(sprintf(_('Loading data to field %s'),$field)); 163 try { 164 if (!$this->get($field)) throw new Exception(sprintf(_('Operation Field not set: %s'),$field)); 165 list($join, $where) = $this->buildQuery(); 166 array_map(function(&$key) use ($join,$where) { 167 $key = $this->key($key); 168 if (!is_array($this->get($key))) { 169 $query = sprintf($this->loadQueryTemplateSingle, 170 $this->databaseTable, 171 $join, 172 $this->databaseFields[$key], 173 self::$DB->sanitize($this->get($key)), 174 count($where) ? ' AND '.implode(' AND ',$where) : '' 175 ); 176 } else { 177 $fields = $this->get($key); 178 $fieldData = array(); 179 array_map(function(&$fieldValue) use ($key,&$fieldData) { 180 $fieldData[] = sprintf("`%s`.`%s`='%s'",$this->databaseTable,$this->databaseFields[$key],self::$DB->sanitize($fieldValue)); 181 unset($fieldValue,$key); 182 },(array)$fields); 183 $query = sprintf($this->loadQueryTemplateMultiple, 184 $this->databaseTable, 185 $join, 186 implode(' OR ', $fieldData), 187 count($where) ? ' AND '.implode(' AND ',$where) : '' 188 ); 189 } 190 if (!($vals = self::$DB->query($query)->fetch('','fetch_all')->get())) throw new Exception(self::$DB->sqlerror()); 191 $vals = @array_shift($vals); 192 $this->setQuery($vals); 193 unset($vals,$key,$join,$where); 194 },(array)$field); 195 } catch (Exception $e) { 196 $this->debug(_('Load failed: %s'),array($e->getMessage())); 197 } 198 return $this; 199 }
This seems relevant: http://stackoverflow.com/a/5523561/836995 I don’t think you will get a more detailed error message using
array_map()
. I don’t have time to debug the code, but I can take a guess that this is happening:throw new Exception(self::$DB->sqlerror());
Don’t know why, though.
-
Any ideas for a quick fix, while you’re solving this problem? I wish I could contribute a solution, but I don’t have the time / energy to dive into the FOG code base at the moment.
-
Updated to trunk version 7645: No difference.
Changed LOCATION of PCs: Error message goes away and PC boot normally. -
@dolf said:
Changed LOCATION of PCs: Error message goes away and PC boot normally.
What exactly do you mean by that???
-
Oops, my post was very unclear due to the excitement of finally fixing this.
I use the location plugin. After updating the “location” field on all hosts (simultaneously using a group, not one by one), the error disappeared, and the PCs started booting normally.
-
@dolf Did you have the location plugin installed/activated before? I am pretty sure this error shouldn’t happen on a clean fresh install - do you think?
-
Yes, I installed the location plugin a few months ago. In March, I think. I never used the virusscan feature before installing the location plugin. Don’t have the resources to try that now, either.
-
Ok thanks for letting us know. So I guess we are save to solve this now.