Add Application gives no Key and Secret

Hi,
we have the following problem: We want to use the API to change the content of a dataset in Xibo. When we try to
add an Application to get the Key and Secret as described in the “scripting Xibo guide”, we get always end in
the dialog to enter the full name and email. Pressing “Register” has no effect. Only a spinning wheel right to the
"Register" button appears. When we click again another spinning wheel appears next to it and so on. Clicking
"cancel" ends the dialog. There is also a small spinning wheel next to the “Application” heading in that section
that never stops spinning. Anyone an idea what’s going wrong?

The rest of Xibo works so far. We can add displays and layouts. No errors or other appearances in the Log-section.

Thanks in advance, Lonzo

which version of Xibo are you using please?

if you want to use the API then you might be better trying out 1.8 series as the API is much closer to being complete.

Dear Dan,
I use the latest 1.7.6, but tried with 1.7.5 before. It’s installed on a CentOS7 machine.
Is version 1.8 in a state where we can try it in an production environment with only
some (up to 10) displays? Then I will have a look at the 1.8 development line.

After the tries in 1.7.5 I completely deleted the database and the library folder before
I installed 1.7.6. The first try by using the 1.7.5 database with update to 1.7.6 also
had no effect on the issue.

Best, L.

If you’d like to continue with 1.7 we would need you to follow the instructions on the Fault page and provide the logging.

1.8 is alpha quality, but if you are prepared to undertake suitable testing you could run it in production. It is functional although there may be the odd bug.

Dear Dan,
here a screenshot of the issue and the pasted troubleshoot.txt (no txt-upload allowed).
I will have also a look at the 1.8 version - but it would be nice to get an idea whats going
wrong in 1.7.6 for me.

Date,Page,Function,Message
"2016-01-29 16:58:28","","","Login with referring page: p=index"
"2016-01-29 16:58:28","User","DisplayList","SQL: SELECT display.displayid,     display.display,     displaygroup.description,     layout.layout,     display.loggedin,     IFNULL(display.lastaccessed, 0) AS lastaccessed,     display.inc_schedule,     display.licensed,     display.email_alert,     displaygroup.DisplayGroupID,     display.ClientAddress,     display.MediaInventoryStatus,     display.MacAddress,     display.client_type,     display.client_version,     display.client_code,     display.screenShotRequested,     display.storageAvailableSpace,     display.storageTotalSpace,     currentLayout.layout AS currentLayout,     currentLayout.layoutId AS currentLayoutId   FROM display     INNER JOIN lkdisplaydg ON lkdisplaydg.DisplayID = display.DisplayID     INNER JOIN displaygroup ON displaygroup.DisplayGroupID = lkdisplaydg.DisplayGroupID     LEFT OUTER JOIN layout ON layout.layoutid = display.defaultlayoutid     LEFT OUTER JOIN layout currentLayout ON currentLayout.layoutId = display.currentLayoutId WHERE displaygroup.IsDisplaySpecific = 1 ORDER BY display. Params: array (
)."
"2016-01-29 16:57:17","","","Form token incorrect from: 172.16.0.2 with token [ba38796735dff36486807de06e38b262] for session_id [fbssrk49h1u0plbhkla497r032]"

Might need you to try again with the CMS switched to test mode im afraid, no useful messages in that log.

If you are familiar with developer tools, you could look in the network tab and see that each time you press register a new XHR fires off - the response from that will tell us whats wrong for sure

Hi Dan,
did the same in test-mode. Here is the output of the troubleshoot.txt

Date,Page,Function,Message
"2016-01-29 16:58:28","","","Login with referring page: p=index"
"2016-01-29 16:58:28","User","DisplayList","SQL: SELECT display.displayid,     display.display,     displaygroup.description,     layout.layout,     display.loggedin,     IFNULL(display.lastaccessed, 0) AS lastaccessed,     display.inc_schedule,     display.licensed,     display.email_alert,     displaygroup.DisplayGroupID,     display.ClientAddress,     display.MediaInventoryStatus,     display.MacAddress,     display.client_type,     display.client_version,     display.client_code,     display.screenShotRequested,     display.storageAvailableSpace,     display.storageTotalSpace,     currentLayout.layout AS currentLayout,     currentLayout.layoutId AS currentLayoutId   FROM display     INNER JOIN lkdisplaydg ON lkdisplaydg.DisplayID = display.DisplayID     INNER JOIN displaygroup ON displaygroup.DisplayGroupID = lkdisplaydg.DisplayGroupID     LEFT OUTER JOIN layout ON layout.layoutid = display.defaultlayoutid     LEFT OUTER JOIN layout currentLayout ON currentLayout.layoutId = display.currentLayoutId WHERE displaygroup.IsDisplaySpecific = 1 ORDER BY display. Params: array (
)."
"2016-01-29 16:57:17","","","Form token incorrect from: 172.16.0.2 with token [ba38796735dff36486807de06e38b262] for session_id [fbssrk49h1u0plbhkla497r032]"

When I looked in the log-tab, there was an entry like this
oauth SQLSTATE 40001 serialization failure: 1213 deadlock found when trying to get lock. try restarting transaction.

For the Developer Tools: Where can I find the network-tab you mentioned? Is there a hidden menu in XIbo or
do I have to get somewhere else to get in development mode?

Best, L…

Hmm, unfortunately there doesn’t seem to be anything additional in there that will help us diagnose the issue. The deadlock message is interesting and might imply that your database is under some load, which is preventing a transaction from running.

The Form Token incorrect message is also interesting and was in the last log as well.

Developer Tools is a console built into Chrome/IE which allows you to view certain technical information - I mentioned it because as someone using the API I thought you might be familiar with it… as you aren’t the learning curve is rather steep im afraid.

Is it possible to get remote access to your CMS?

Dear Dan,
I switched to chrome and used the dev-tools network tab, when I tried the register of the application. See Screenshot.


There is always an Fatal error when I click on “register”:
Call to undefined function mb_strlen() in /var/www/html/xibo/3rdparty/oauth-php/library/store/OAuthStorePDO.php on line 218
This is the python-oauth2 version that is installed:

Name : python-oauth2
Arch : noarch
Version : 1.5.211
Release : 8.el7
Size : 105 k
Repo : installed
From repo : epel
Summary : Python support for improved oauth
URL : oauth2 · PyPI

Maybe this is not the version that is needed?

Best, L.

Thats great!

You need to enable that function in your PHP installation (http://www.php.net/manual/en/mbstring.installation.php).

Dear Dan,
that’s in deed great! A simple

yum install php-mbstring
service httpd restart

did the job. Now key and secret are displayed as expected!

Now I can start to test the API to load a CSV-file in a dataset regularly.
Many thanks for your quick help, L.

You are welcome - you may want to keep in mind what I said about 1.8 having the completed api (it will change as its only in beeta in 1.7)

Happy api-ing :smile: