[Sites plugin - Import] fog 1.5.7 site. Version 1.5.5_2
-
HI,
on host import from CSV we get error 500.
reproducable each time.==> error.log <==
[Wed Jul 31 14:24:11.142848 2019] [proxy_fcgi:error] [pid 15237] [client 10.100.255.67:54649] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to undefined method SiteHostAssociationManager::set() in /var/www/fog/lib/plugins/site/hooks/addsitehost.hook.php:351\nStack trace:\n#0 /var/www/fog/lib/fog/hookmanager.class.php(87): AddSiteHost->hostImport(Array)\n#1 /var/www/fog/lib/fog/fogpage.class.php(3949): HookManager->processEvent(‘HOST_IMPORT’, Array)\n#2 /var/www/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->importPost()\n#3 /var/www/fog/management/index.php(58): FOGPageManager->render()\n#4 {main}\n thrown in /var/www/fog/lib/plugins/site/hooks/addsitehost.hook.php on line 351\n’, referer: http://fog.acquirebpo.com/fog/management/index.php?node=host&sub=importThanks,
Ben. -
@bmatthews21 Very much sorry for the late response on this. Must have gone unnoticed somehow here in the forums.
I just replicated the issue and will see how we fix it. Definitely a bug. Moving this to bug reports and calling out to @Fernando-Gietz who created the plugin. The import actually seems to work but it’s not nice to blank out with a white page. Can you check this out?
-
I will try to replicate the error.
Do you have install any plugin moore? AccessControl? -
@Fernando-Gietz I’ve done a plain install FOG 1.5.7, enabled just the Site Plugin and tried to import host CSV -> error/white screen.
-
Can you send me the CSV file? Maybe when you have the site plugin enabled, the HOST_IMPORT event can not proccess well the file because this file doesn´t have all info
-
@Fernando-Gietz Well that’s actually possible. My CVS looked like this:
"Hostname1","aa:bb:cc:dd:ee:ff"
Maybe when you have the site plugin enabled, the HOST_IMPORT event can not proccess well the file because this file doesn´t have all info
But the plugin shouldn’t fail but either warn the user or just try to go ahead without the missing information.
-
@Fernando-Gietz Any news on this topic? Where you able to replicate this using the CSV template I provided?
-
Sorry, I am very busy in the work and I dont test anything. But I was thinking about this problem
I think that the problem is the template that we use to import an d export the data. Normally we use the default template and this one don´t have any information about the site. Then when the HOST_IMPORT event is launched, it tries to read some information that is not in the CSV file, and crashes.
As a quick solution, comment the hostImport and hostExport function (I think that is you try to export hosts, the code will crash too) and in the construct function:
// ->register( // 'HOST_IMPORT', // array( // $this, // 'hostImport' // ) // ) // ->register( // 'DESTROY_HOST', // array( // $this, // 'hostDestroy' // ) // )
-
@bmatthews21 Did you see Fernando’s message?
@Fernando-Gietz I am wondering what the long term solution to this would be?!
-
This is a work around, for a long term solution …ummm we must to think if this solution is for 1.5.X versions or get a final solution for 1.6.X and how can we do it XD
Maybe the solution is create on fly the CSV file to export and import the data (I am thinking loud)
-
This is fixed in the latest
dev-branch
code. Looking at it again I found this to be a simple typo (ref).