RSS Feed:

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carsafety
    Senior Member
    • Jan 2003
    • 149

    RSS Feed:

    I am trying to add a feed and can't get it to work. In the preview tab, it generates this error:

    XML Error: Empty document at Line 1

    This is the feed:

    The Insurance Institute for Highway Safety (IIHS) is an independent, nonprofit scientific and educational organization dedicated to reducing deaths, injuries and property damage from motor vehicle crashes through research and evaluation and through education of consumers, policymakers and safety professionals.


    I've emailed them and they claim their feed is setup and tested correctly to W3C validation standards. I've seen it used on other forums, so I'm not sure why I can't get it to work. My other feed from NHTSA works fine.

    Any suggestions?

    I am running 3.7.5 PL1.
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    The feed works fine on my test site. Maybe try reuploading the rssposter.php cron and the other rss related files (class_rss_poster.php and class_dm_rssfeed.php at least).

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools <- awesome site for html/css help

    Comment

    • Carsafety
      Senior Member
      • Jan 2003
      • 149

      #3
      I replaced those three files from my 3.7.5 download. I also deleted the RSS entry and started a new one from scratch. Same error.

      Any other files or settings that might affect this from the Vbulletin side?

      Comment

      • Steve Machol
        Former Customer Support Manager
        • Jul 2000
        • 154488

        #4
        You probably have a modification that is causing this. Either that or it's a server issue.

        To troubleshoot this, first reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server. Also be sure to upload the admincp files to whichever directory you have set in your config.php file. Then run 'Suspect File Versions' in Diagnostics to make sure you have all the original files for your version and that none show 'File does not contain expected contents':

        Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions

        [Note: In some cases you may also need to remove any of the listed .xml files in the includes/xml directory.]

        Next, disable all plugins.

        Note: To temporarily disable the plugin system, edit config.php and add this line right under <?php

        define('DISABLE_HOOKS', true);


        Do you have the same problem?
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment

        • Carsafety
          Senior Member
          • Jan 2003
          • 149

          #5
          Can this be done with the forums active?

          Comment

          • Steve Machol
            Former Customer Support Manager
            • Jul 2000
            • 154488

            #6
            Yes.
            Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
            Change CKEditor Colors to Match Style (for 4.1.4 and above)

            Steve Machol Photography


            Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


            Comment

            • Carsafety
              Senior Member
              • Jan 2003
              • 149

              #7
              I downloaded the entire 3.7.5 PL1 content from vbulletin.com. Unzipped and uploaded all non-image files in ASCII mode. I ran suspect file check. It didn't recognize the various files from my two plugins, iTrader (2.1.0) and AddonChat, including 2 files each from those plugins in the xml folder. It did not indicate any "File does not contain expected contents" warnings.

              I then disabled the plugin system via the method you described. I deleted the RSS entry again and started a new one from scratch. I still get the same error for the IIHS RSS feed:

              XML Error: Empty document at Line 1

              I note that my other two RSS feeds work fine from these sources:






              Originally posted by Steve Machol
              You probably have a modification that is causing this. Either that or it's a server issue.

              To troubleshoot this, first reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server. Also be sure to upload the admincp files to whichever directory you have set in your config.php file. Then run 'Suspect File Versions' in Diagnostics to make sure you have all the original files for your version and that none show 'File does not contain expected contents':

              Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions

              [Note: In some cases you may also need to remove any of the listed .xml files in the includes/xml directory.]

              Next, disable all plugins.

              Note: To temporarily disable the plugin system, edit config.php and add this line right under <?php

              define('DISABLE_HOOKS', true);


              Do you have the same problem?

              Comment

              • Steve Machol
                Former Customer Support Manager
                • Jul 2000
                • 154488

                #8
                Then this is a server issue. For some reason is cannot properly process that feed. I just tested this on my server and an unmodified vB and it works fine.
                Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                Change CKEditor Colors to Match Style (for 4.1.4 and above)

                Steve Machol Photography


                Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                Comment

                • Carsafety
                  Senior Member
                  • Jan 2003
                  • 149

                  #9
                  Provider has so far been unable to troubleshoot any issue. Does anyone happen to have any suggestions on what might cause one RSS feed to generate this error but allow others to work?

                  Comment

                  • peterska2
                    Senior Member
                    • Oct 2003
                    • 8869
                    • 3.7.x

                    #10
                    Your server cannot connect to their server. The host will need to
                    investigate this further as it is a server issue.

                    The other alternative is to simply use a different feed from a different provider.

                    Comment

                    • MrEyes
                      Senior Member
                      • Nov 2004
                      • 220
                      • 3.0.3

                      #11
                      Holy thread resurrection!!!

                      I am experiencing exactly the same problem so rather than raise a new thread it seemed like a good idea to bring this one back from the dead.

                      I have a number of different RSS items feeding into my site and all work fine. However I have added another today and I get the "XML Error: Empty document at Line 1" as described previously.

                      The feed in question is:



                      The consensus here seemed to be that the cause was that the server was unable to connect to the feed URL, as I have multiple feeds already working I wasn't entirely sold on this cause. So I have done some more digging and confirmed that the feed data is being read in correctly.

                      To verify this I have edited the following function in class_rss_poster.php

                      Code:
                      function fetch_xml($url)
                      Immediately after this line:

                      Code:
                      $xml_string =& fetch_file_via_socket($url);
                      I have echoed out the $xml_string array, and seen the headers and XML for the feed. So it is definitely coming back in when requested. To be absolutely certain I have also echo'd out the value of $xml_string immediately before this line in the fetch_xml function:

                      Code:
                      $this->set_xml_string($xml_string);
                      and after this line in rssposter.php

                      Code:
                      $feed['xml']->fetch_xml($feed['url']);
                      and seen that this variables still contain the feed XML

                      Now I think I know where the problem is, rssposter.php falls into this conditional:

                      Code:
                      else if ($feed['xml']->parse_xml() === false)
                      It would seem that the parse_xml function does not like the XML it is being given. On closer inspection it would seem that there are some odd characters at the beginning of the XML being parsed:

                      <?xml version="1.0" encoding="utf-8"?><rss version="2.0"><chan...
                      I if hack the rssposter.php to include the following (yeah it is nasty):

                      Code:
                      //START - HACK - Remove glitch characters from the incoming RSS XML
                      if ($feed['xml']->xml_string[0] == 'ï')
                      {
                        $feed['xml']->xml_string = str_replace('', '', $feed['xml']->xml_string);
                      }
                      //END - HACK - Remove glitch characters from the incoming RSS XML
                      Immediately after this line:

                      Code:
                      $feed['xml']->fetch_xml($feed['url']);
                      Then the feed works without any problems whatsoever.

                      So there you have it, the problem is I have no idea where those characters are coming from and the W3C RSS validator reports the feed to be valid. So somewhere between, vbulletin, php, curl and the remote site those glitches are being added.

                      Anybody got any ideas?

                      EDIT: I have to admit that I haven't done the traditional "disable all plugins", however having looked through the code there are no plugin hook points that could be causing this.
                      Last edited by MrEyes; Thu 3 Sep '09, 4:11pm.
                      This is a signature, with a picture

                      sigpic

                      UK Motorbike Forum

                      Comment

                      • Carsafety
                        Senior Member
                        • Jan 2003
                        • 149

                        #12
                        Originally posted by MrEyes
                        So there you have it, the problem is I have no idea where those characters are coming from and the W3C RSS validator reports the feed to be valid. So somewhere between, vbulletin, php, curl and the remote site those glitches are being added.

                        Anybody got any ideas?
                        I wish I did. I never could resolve my issue. My provider said they had no problems with connectivity to the external website with the RSS feed. The feed source said it conformed to the right syntax.

                        Just out of curiousity, could you try my feed as a test?

                        The Insurance Institute for Highway Safety (IIHS) is an independent, nonprofit scientific and educational organization dedicated to reducing deaths, injuries and property damage from motor vehicle crashes through research and evaluation and through education of consumers, policymakers and safety professionals.


                        I tried yours and it caused the same problem, Empty document at Line 1...

                        Thanks!

                        Incidentally, I'm currently running 3.8.3.
                        Darren

                        Comment

                        • MrEyes
                          Senior Member
                          • Nov 2004
                          • 220
                          • 3.0.3

                          #13
                          Originally posted by Carsafety
                          Just out of curiousity, could you try my feed as a test?
                          Tried it and got exactly the same problem as I described above, the XML read in from the RSS feed has some odd glitch characters at the beginning of it that breaks the parser.

                          <?xml version="1.0" encoding="utf-8"?>....
                          Lets see what the VB guys can come up with because I don't like hacking the VB code because it makes things complicated when upgrading.

                          BTW I am on vb 3.8.0
                          This is a signature, with a picture

                          sigpic

                          UK Motorbike Forum

                          Comment

                          • Steve Machol
                            Former Customer Support Manager
                            • Jul 2000
                            • 154488

                            #14
                            I was able to use this feed on my unmodifed 3.8.4 test forum with no errors:



                            I suspect either a modification or a server issue is causing this.
                            Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                            Change CKEditor Colors to Match Style (for 4.1.4 and above)

                            Steve Machol Photography


                            Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                            Comment

                            • MrEyes
                              Senior Member
                              • Nov 2004
                              • 220
                              • 3.0.3

                              #15
                              I find it hard to believe that this is a modification that is causing the problem, possibly some combination of php/os/curl version but not a modification.

                              The reasons for this are as follows:
                              • Other RSS feeds work perfectly OK
                              • There are no hook points in the fetch_file_via_socket function for a modification to make any changes to the standard runtime workflow.
                              • If I echo out the raw curl result ($full_result) immediately after this line in class_rss_poster.php:

                                Code:
                                $full_result = curl_exec($ch);
                                I can see the http headers used and also the RSS XML with the glitches, so these are coming back from the PHP curl_exec function, I can't speak for Carsfety but I can absolutely assure you that I haven't hacked around curl and recompiled php.


                              I know its the easy option, but "it works on my machine" just doesn't quite fit the evidence here.
                              Last edited by MrEyes; Thu 3 Sep '09, 11:28pm.
                              This is a signature, with a picture

                              sigpic

                              UK Motorbike Forum

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...