1
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 4: parser error : error parsing attribute name  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): ts}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct():                                                                                ^  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 4: parser error : attributes construct error  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): ts}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct():                                                                                ^  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 4: parser error : Couldn't find end of Start Tag n.length line 4  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): ts}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct():                                                                                ^  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173

I got this error in my site i don't know what is the problem any one guide me what is the problem ?

2 Answers 2

3

If you take a look at the function getFeedData() in class Mage_AdminNotification_Model_Feed you can see that your error line 173 is Magento calling new SimpleXMLElement with a parameter $data.

/**
 * Retrieve feed data as XML element
 *
 * @return SimpleXMLElement
 */
public function getFeedData()
{
    $curl = new Varien_Http_Adapter_Curl();
    $curl->setConfig(array(
        'timeout'   => 2
    ));
    $curl->write(Zend_Http_Client::GET, $this->getFeedUrl(), '1.0');
    $data = $curl->read();
    if ($data === false) {
        return false;
    }
    $data = preg_split('/^\r?$/m', $data, 2);
    $data = trim($data[1]);
    $curl->close();

    try {
        $xml  = new SimpleXMLElement($data);
    }
    catch (Exception $e) {
        return false;
    }

    return $xml;
}

Here $data is the return of a cURL call on Magento feed, so the problem is probably that the return from Magento is not correctly formated.
If this error persist you may think about your file encoding but the first explanation seems to be the most probable to me.


Basically your error mean that $data value is ts}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length so that is why I telling you it is most probably a Magento side error, not yours.

15
  • Sorry i am not getting what i need to be done
    – Magento 2
    Commented Apr 18, 2016 at 9:58
  • In my opinion that is a Magento side issue. You can add a Mage::log($data, null, 'debug.log'); to see the return of Magento Feed. The log will be in /var/log/debug.log Commented Apr 18, 2016 at 10:51
  • Where i need to add this after this $curl->close(); or where
    – Magento 2
    Commented Apr 18, 2016 at 10:55
  • You can add this right after the try and just before the `$xml = ...." Commented Apr 18, 2016 at 10:57
  • ya i added but it's not created 'debug.log'
    – Magento 2
    Commented Apr 18, 2016 at 11:01
1

It looks like something is breaking the adminhtml feed module.

The cause could be a third-party module that is retrieving invalid XML.

Check whether your site code contains any class which extends Mage_AdminNotification_Model_Feed.

Once you find it:

->Try to disable that module from app/etc/modules/

->Clean the system.log.

->See if the error is gone.

Once you've determined which module is creating the issue, contacting the module's developer and notifying them about the issue.

3
  • I dismissed this possibility because when he put logs in the function which causes the error, the logs are generating and if you take a look at my answer this function have no dependency to others class functions. Commented Apr 25, 2016 at 7:45
  • it's probably coming from third party.If you disable extension you can find exact area of error.You have not given solution you have just clarify why the error is there Commented Apr 25, 2016 at 8:42
  • In this case I can not see how that the Mage::log() can works ? This is a standalone function I did not see how a third party extension can override it and still working when it debug in it ? Thank you. Commented Apr 25, 2016 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.