Author Topic: Webadmin takes 10 mins to respond to clicking on AV Equipment  (Read 7484 times)

tunebob

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Webadmin takes 10 mins to respond to clicking on AV Equipment
« on: January 02, 2011, 06:44:59 pm »
I have had an issue for months now, whereby if i have any AV devices added to my system and click on the AV Equipment link on the lmce admin site, its takes 10 mins to return any data...the browser just sits waiting for data to return....

It always does respond but literally it can take 10 mins or more.  Given all the problems i have had with my Denon box ( now resolved ), this issue has been driving me mad recently...

The same issue occurs should i click directly on any of the AV devices via the device tree....clicking on non av devices is fine....

Very weird, but very very frustrating.

Wonder if anyone else is experiencing a similar issue or might know whats going on ?


Thanks



rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #1 on: January 03, 2011, 12:58:22 am »
Tunebob, i have seen this behaviour myself, my current setup doesn't do it though.

This might sound strange, but do you have any usb devices hooked up to the core? if you do, could you try unhooking those trying again (maybe a reboot).
This is just a test, not sure if it is related at all, just try it.

Richard


tunebob

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #2 on: January 03, 2011, 11:57:39 am »
Hi Richard, thanks for the reply.  I dont have any usb devices attached to my core...the only device connected is a CM11a via serial.

I removed that and rebooted the core but things still the same.

One thing i did notice is that the 'Get' request is not recorded in the apache access.log when i click the link, it only appears in the log at the same time the server responds with data i.e. after about 10 mins.  I was starting to suspect that it was something to do with MySql but this would leave to to suspect that its more to do with apache as if apache handled the request it should immediately populate its log.

Perhaps someone with more knowledge of apache could confirm this.

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #3 on: January 03, 2011, 06:27:46 pm »
Tunebob, have you updated to the latest updates?

I still use the same setup i had the issues with, but deleted all my AV devices and started again, now it's fine.

Richard

tunebob

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #4 on: January 03, 2011, 06:39:10 pm »
Hi Richard, i have tried deleting all AV devices and re-adding but same probs unfortunately.

On my setup all my av devices are connected to MDs, none to the core.

So I did a quick test and added some AV devices to my core and via the device tree the webadmin responds immediately when clicking on each device.  Clicking on any AV device on the MDs, results in the 10min delay before a response.

So perhaps i will delete the MDs and re-add these from scratch and see if that helps.

thanks.

tunebob

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #5 on: January 08, 2011, 11:13:10 pm »
So i deleted all my MDs and re-added and unfortunately the same problem occurs.

If i add any AV gear to the core all works grand. As soon as I change any of these devices 'controlled by' field to be an MD, the GUI takes 10 mins to respond.

So problem def relates to adding AV equipment to an MD.

I dont know where to go next with this, i had hoped deleting the MDs and readding would resolve it...I guess the only thing to do next is delete the core and start a clean install but i have so much config i really dont want to go there....


tunebob

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #6 on: January 11, 2011, 12:38:24 am »
So just a brief update...i rebuilt my core, added the MDs then the AV gear and same problem as before

WebGui still takes 10 mins to respond.


rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #7 on: January 11, 2011, 06:14:16 pm »
tunebob, do you see anything in the logs that might help troubleshoot?

Richard

seagullarity

  • Regular Poster
  • **
  • Posts: 18
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #8 on: February 03, 2011, 11:53:01 pm »
I did a little debugging and found out that in /var/www/lmce-admin/operations/myDevices/avWizard.php the code is hanging somewhere in the if statement pasted below. If I put print statements for logging purposes anywhere within the print statement, the page won't reload (not sure why) so I can't get any more specific than that it's in the following if statement. I am not familiar with PHP -- I will do my best to figure out what is wrong, but I've been having trouble so far, and if someone with PHP experience can look over this, I'd appreciate it:

Code: [Select]
if(@$childOf[$rowD['PK_Device']]==''){
                    $out.='<tr class="tablehead">
                        <td align="center" width="200"><B>'.$TEXT_DEVICE_ROOM_CONTROLLED_BY_CONST.'</B></td>
                        <td align="center" width="200"><B>'.$TEXT_PIPES_CONST.'</B></td>
                        <td align="center" width="200"><B>'.$TEXT_DEVICE_DATA_CONST.'</B></td>
                        <td align="center" width="125"><B>'.$TEXT_ACTION_CONST.'</B></td>
                    </tr>       

                    <tr>
                        <td rowspan="5" align="left" valign="top" class="alternate_back">
                            '.$TEXT_DEVICE_NUM_CONST.': '.$rowD['PK_Device'].'<br>
                            '.$TEXT_DEVICE_TEMPLATE_NUM_CONST.': '.$rowD['FK_DeviceTemplate'].'<br>
                            '.$TEXT_CONTROLLED_BY_CONST.': '.$controlledViaLink.'<br><br>
                            <a name="deviceLink_'.$rowD['PK_Device'].'"></a>'.$deviceName.'<br>'.$roomPulldown.'

                        </td>
                        <td align="center" height="10"><B>'.$TEXT_AUDIO_PIPE_CONST.'</B></td>
                        <td class="alternate_back" rowspan="5" valign="top" align="right">'.formatDeviceData($rowD['PK_Device'],$deviceDataArray[$rowD['PK_Device']],$dbADO,$rowD['IsIPBased'],0,1,'textarea').'</td>
                        <td align="center" rowspan="5" valign="top">'.$buttons.'</td>
                    </tr>
                    <tr>
                        <td height="20">
                        <u>'.$TEXT_OUTPUT_CONST.'</u>: '.@$devicePipes['1']['output'].'<br>
                        <u>'.$TEXT_TO_CONST.'</u>: '. @$devicePipes['1']['to'].'<br>
                        <u>'.$TEXT_INPUT_CONST.'</u>: '.@$devicePipes['1']['input'].'<br><br>
                        </td>
                    </tr>
                    <td align="center" height="10"><B>'.$TEXT_VIDEO_PIPE_CONST.'</B></td>
                    <tr>           

                        <td height="20">
                        <u>'.$TEXT_OUTPUT_CONST.'</u>: '.@$devicePipes['2']['output'].'<br>
                        <u>'.$TEXT_TO_CONST.'</u>: '. @$devicePipes['2']['to'].'<br>
                        <u>'.$TEXT_INPUT_CONST.'</u>: '.@$devicePipes['2']['input'].'<br><br>
                        </td>
                       
                    </tr>
                    <tr>
                        <td align="center" valign="top"><a href="javascript:windowOpen(\'index.php?section=editPipes&deviceID='.$rowD['PK_Device'].'&from=avWizard\',\'width=600,height=300,toolbar=1,scrollbars=1,resizable=1\');">'.$TEXT_EDIT_PIPES_CONST.'</a></td>
                    </tr>';

seagullarity

  • Regular Poster
  • **
  • Posts: 18
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #9 on: February 04, 2011, 03:51:28 am »
Well, I dug deeper and found that the problem lies in the calling of functionFormatDeviceData in this line:

<td class="alternate_back" rowspan="5" valign="top" align="right">'.formatDeviceData($rowD['PK_Device'],$deviceDataArray[$rowD['PK_Device']],$dbADO,$rowD['IsIPBased'],0,1,'textarea').'</td>

And within the function formatDeviceData, the function serialPortsPulldown causes problem in this line:

$deviceDataBox.=serialPortsPulldown('deviceData_'.$deviceID.'_'.$rowDDforDevice['FK_DeviceData'],$ddValue,$rowDDforDevice['AllowedToModify'],getTopLevelParent($deviceID,$dbADO),$dbADO,$deviceID,$cssStyle);

And within the function serialPortsPulldown, the following line is where the hangup occurs:

$serialPortAsoc[$value]=SerialPortInfo($topParent,$value,$dbADO);

The values that are called by that function are:
$topParent = 63 (One of my MDs)
$value = pci0000:00/0000:00:1d.7+5.1:1.0
$dbADO = (blank)
(five minute delay)
$topParent = 63
$value = pci0000:00/0000:00:1d.7+5.2:1.0
$dbADO = (blank)

Not really sure what to make of this, but I'll look at it more tomorrow.

seagullarity

  • Regular Poster
  • **
  • Posts: 18
    • View Profile
Re: Webadmin takes 10 mins to respond to clicking on AV Equipment
« Reply #10 on: February 05, 2011, 03:39:57 am »
Figured it out.

Change line 2680 in /var/www/lmce-admin/include/utils.inc.php.

Before:      $cmd = "ssh ".$IPaddress." ";
After:      $cmd = "ssh ".$ipAddress." ";

I'll submit a trac ticket patch.