Remote dataset: Xibo always fetches same response (Xibo 2.0.0)

Hello,

I’m trying to fetch data from an API from XIBO to use in a dataset. However, no matter what I try or what API I use, I always get this response, when I click the “Test data URL” button:
{
“theme”: {
“store”: {},
“pool”: {},
“rootUri”: “/”,
“envTested”: false,
“envFault”: false,
“envWarning”: false,
“middleware”: null,
“logHandlers”: null,
“logProcessors”: null,
“authentication”: null,
“samlSettings”: null,
“casSettings”: null,
“cacheDrivers”: null,
“cacheNamespace”: “Xibo”,
“themeConfig”: {
“theme_name”: “Xibo Default Theme”,
“theme_title”: “Xibo Digital Signage”,
“app_name”: “Xibo”,
“theme_url”: “http://xibo.org.uk”,
“cms_source_url”: “https://github.com/xibosignage/xibo/”,
“cms_install_url”: “http://xibo.org.uk/manual/en/install_windows_client.html”,
“cms_release_notes_url”: “http://xibo.org.uk/manual/en/release_notes.html”,
“themeCode”: “default”,
“themeFolder”: “theme/default/”
}
},
“version”: “2.0.0”
}

So I guess this is something from Xibo but I don’t know what.
The result I excepted and also received when I tried in my browser was this:
{
“result”: {
“previous”: 18,
“now”: 6
},
“took_ms”: 0,
“calculated_at”: “2019-03-25T12:20:23.236Z”
}

I also tested this public API but I get the same response as above.

Why am I getting this response from Xibo and how can I get the actual reponse from the API?

Thanks in advance.

What’s the URL of the json you’re trying to access with your dataset?

Im trying to access the API of a locally hosted website which is not accessible from outside of the network. It’s in the format of [server].[domain].local. Xibo is hosted in the same network and can access the site (I tried displaying a website from the same domain). However, I’m also getting the same response from public APIs from outside of my network, e.g. https://httpbin.org/get.
It also doesn’t matter which dataroot I specify, it’s always the same response.

If I put that URL in to a new dataset on v2.0.0 I get:

{
   "entries": [
      {
         "args": {},
         "headers": {
            "Host": "httpbin.org",
            "User-Agent": "GuzzleHttp/6.3.3 curl/7.61.1 PHP/7.2.13"
         },
         "origin": "xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx",
         "url": "https://httpbin.org/get"
      }
   ],
   "number": 1,
   "processed": [
      [
         [],
         [],
         [],
         []
      ]
   ],
   "messages": [
      "Processing 1 results into 0 potential columns",
      "Processing Result with Data Root ",
      "DataRoot is an object",
      "Processing as Multiple Rows",
      "Processing args",
      "Processing headers",
      "Processing origin",
      "Processing url",
      "Consolidating entries",
      "There are 4 entries in total"
   ]
}

Which is as expected.

The only way I can get the same output as you is if I leave the URI field empty, rather than putting https://httpbin.org/get in there.

Is this a custom install?

Yes, I installed Xibo manually.
It’s running with IIS 10 on Windows Server 2016 with PHP 5.6.
So far this is the only issue I encountered with this installation.

Do you have web in the URL you use to access the CMS?

No, I pointed the DocumentRoot at [xibo-path]/web, so I access the CMS with https://[xibo-server].[domain].local.

Has your PHP got some restrictions perhaps on remote URLs that it is allowed to access?

So, I think I identified part of the problem. I changed my log level and saw that the request of the API data threw a curl error 60. So I tried this solution and am now not getting this error anymore. My log now looks like this when I try e.g. the httpbin API:
“ID”,“Ausführen”,“Datum”,“Kanal”,“Funktion”,“Level”,“Bildschirm”,“Seite”,“Meldung”
“2191”,“5e9839d”,“2019-03-26 09:43”,“WEB”,“POST”,“DEBUG”,"","/dataset/remote/test",“Making request to http://httpbin.org/get with params: array (
‘query’ =>
array (
),
)”
“2190”,“5e9839d”,“2019-03-26 09:43”,“WEB”,“POST”,“DEBUG”,"","/dataset/remote/test",“No authentication required”
“2189”,“5e9839d”,“2019-03-26 09:43”,“WEB”,“POST”,“DEBUG”,"","/dataset/remote/test",“Calling remote service for DataSet: Graylog Test Widget and URL http://httpbin.org/get
“2188”,“5e9839d”,“2019-03-26 09:43”,“WEB”,“POST”,“DEBUG”,"","/dataset/remote/test",“Checking permissions against the logged in user: ID: 1, Name: xxxxx, UserType: 1”
“2187”,“5e9839d”,“2019-03-26 09:43”,“WEB”,“POST”,“DEBUG”,"","/dataset/remote/test",“CMS font CSS returned from Cache.”
“2186”,“5e9839d”,“2019-03-26 09:43”,“WEB”,“POST”,“DEBUG”,"","/dataset/remote/test",“Install Fonts called with options: {“invalidateCache”:false}”
“2182”,“5e9839d”,“2019-03-26 09:43”,“WEB”,“POST”,“DEBUG”,"","/dataset/remote/test",“Loading 1. All Objects = 0”

Is this how the log is supposed to look like? At least I’m not getting any errors anymore.
However, my problem still is not solved. When I click the test data url button while editing the dataset, I still only get the response from Xibo I posted in my initial post. I’m also not getting any data in my dataset. Do you have any clue where this response is coming from?

Hi @alex - just to help point you in the right direction, I’m experiencing the same issue on a (trial) Xibo/Springsignage -hosted instance of v2 CMS

@reda you can kindly log a ticket with our service desk on that we can take a look: support@xibosignage.com

Okay, I think I managed to find the reason I don’t get the correct output. Everytime the request sent to the API fails for whatever reason, Xibo presents me the “standard” response from my first post.
I managed to get it working now, altough I find this behaviour very confusing.

1 Like

I agree I don’t think it should present that if the call fails.

How was the call failing so I can try and replicate this to get it looked at?

It had this happening to me with two different errors. First was the curl error 60, when the certificate was found to be valid.
Another time I got curl error 7. The request timeouted because the site couldn’t be reached.
Here are the log entries for each of the errors:
787 0616460 2019-03-25 14:05 WEB POST ERROR /dataset/remote/test Error making request. cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

797 8b585e0 2019-03-25 14:28 WEB POST ERROR /dataset/remote/test Error making request. cURL error 7: Failed to connect to [URL] port 80: Timed out (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
I replaced the URL in the second one. Hope this helps.

Thank you.

I’ve logged an issue here so this will get looked at:

1 Like