Search

What does a “Status code 0” mean in the output from a dynamic data source?

I’m trying to pull in XML from the FogBugz API via a URL of the following type:

https://fogbugz.domain.com/api.asp?token=[api_token]&cmd=viewPerson

The API token is obtained by logging in with email and password as GET parameteters (info here), and subsequent requests with the generated API token work fine in all browsers. But in my Symphony ?debug output I get this:

<fogbugz-viewperson valid="false">
    <error>Status code 0 was returned. Content-type: </error>
</fogbugz-viewperson>

Is that a HTTP status code or an internal Symphony status code? I’ve tried increasing $dsParamTIMEOUT in data.fogbugz_viewperson.php, but to no effect. Anybody have a guess as to the problem?

[Edited to clear up confusion about parameters. In the URL I’ve entered in Symphony, [api_token] is replaced by an actual string of numbers and characters.]

I think I’ve heard somebody talking about broken parameter-functionality in Dynamic XML DS URLs, can you verify that the URL is correctly being generated?

@phoque, thanks for following me around on the forum and answering all my n00b-questions :-)

How would I go about verifying the URL? I’ve checked $dsParamURL in data-sources/data.fogbugz_viewperson.php which matches what I’ve entered. Where else can I check it?

When I check /?profile=data-sources I can see that the fogbugz_viewperson datasource runs 3 queries, but not to much effect, clearly.

I think you might be on to something. I found the log, and whenever I “Save changes” on my data source in the backend, it logs this:

2010/07/14 12:38:16 > WARNING: 2 - array_map() [<a href='function.array-map'>function.array-map</a>]: Argument #2 should be an array in file /Users/klean/Sites/symphony/symphony/content/content.blueprintsdatasources.php on line 101
2010/07/14 12:38:16 > WARNING: 2 - array_keys() expects parameter 1 to be array, null given in file /Users/klean/Sites/symphony/symphony/content/content.blueprintsdatasources.php on line 120
2010/07/14 12:38:16 > WARNING: 2 - array_values() expects parameter 1 to be array, null given in file /Users/klean/Sites/symphony/symphony/content/content.blueprintsdatasources.php on line 121

Will have to dig around to see if I can make sense of that.

To figure out the actual URL that’s being called, try delving into the core with a good old var_dump/die pair:

/symphony/lib/toolkit/data-sources/datasource.dynamic_xml.php

I’m looking at 2.0.8RC3 and it looks like you should put this after line 37 (where the __processParametersInString function is called for the second time):

var_dump($this->dsParamURL, $this->dsParamXPATH);
die;

This should show you how the parameters are being resolved to actual string values.

@bewildergeist: Don’t worry, I’ve been too quied for too long so I am happy to post as often as possible.

You’ll have to excuse my half-assed answers though. Most of the time I’m not at home and can’t dig around in the code myself to tell you exactly what to do. Luckily, Nick came to the rescue… just follow the instructions he posted. :-)

I updated from 2.0.7 to 2.0.8RC3, but I still get the same errors in the log. But the error message in the XML has changed from Status code 0 was returned to:

Request timed out. 6 second limit reached.

Even if I update $dsParamTIMEOUT to something like 200, it claims to have timed out before the 200 second limit, even if 200 seconds haven’t passed.

I have tried @nickdunn’s trick, and the URL is returned exactly as I entered it.

Shouldn’t your parameters begin with a $?

Deleted

I’m constantly finding out that what I’m suggesting doesn’t make too much sense…

@Nils, those aren’t real parameters, I was just anonymizing the URL to avoid publishing a valid API key to our FogBugz installation. I’ve edited the original post to show [api_token] instead of {api_token}.

Sorry for the confusion — just to be clear, the URL I’ve entered as a dynamic data source contains no curly braces, so the error messages in the log must be referring to the GET parameters in the URL, not to any Symphony parameters.

Thanks for the tip, @Nils. That specific issue is not related to mine, but it led me on to issues 150, 158 and 338, which made me realize that the problem is that Symphony apparently doesn’t handle HTTPS URLs correctly for dynamic data sources.

I appended :443 to the root URL to specify the correct port for HTTPS, and everything now works perfectly. The same goes for other HTTPS URLs I was trying to import as dynamic data sources.

Thanks for all your help, guys! I’ve created issue 358 to report the problem.

I am also recieving this error with all dynamic datasources, different xml file sizes. All of my URLs respond correctly when typed into the browser, but not when used in Symphony. My XML is contained within my workspace folder, yet I always get an

<error>Request timed out. 6 second limit reached.</error>

I have tried upping the limit in the Symphony Core, yet it still only runs 6 seconds then fails.

EDIT: Also, there is no output in the log file that relates to this problem. It just fails.

EDIT: Forgot to mention that the XML Importer also fails every time when trying to use any XML… Including feeds from Twitter.

Could this be a PHP setting??

I am having similar issue when trying to import my Dribbble feed.

Update: I no longer have this issue. I was using an erroneous prefix to my url.

What is the best way to change the 6 second limit (i.e. modifying the least amount of code)?

has anyone been able to pull a github atom feed into a dynamic xml ds? when i try, i get

 <github valid="false">
     <error>Status code 400 was returned. Content-type: text/html</error>
 </github>

i'm able to curl it no problem. i've tried with https://github.com:443 and still no luck.

edit: for testing's sake, i also tried an ssl request of a twitter feed. this one didn't give me the same error, but it did time out, even though the response was almost instant with a regular curl request. how odd.

in case anybody ends up here in the future, i nailed my issue down. i was unable to process dynamic xml over https until curl support was installed into php.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details