Fatal error with API

Hello…

I have some problems config the API in XIBO… i did all as you describe in https://github.com/dasgarner/xibo-example-api.

In INDEX.PHP from example i had config the access data to Database (oauth_consumer)

Then i create an app and i copy the KEY and The SECRET for index.php from example…

But when i try to call any function from index.php i allways recibe an error like this…

Fatal error: Uncaught exception 'OAuthException2' with message 'No server tokens available for http://signage.innovuela.com/services.php' in /home/admin/public_html/signage/xibo/oauth-php/library/store/OAuthStoreSQL.php:225 Stack trace: 
#0 /home/admin/public_html/signage/xibo/oauth-php/library/OAuthRequestSigner.php(111): OAuthStoreSQL->getSecretsForSignature('http://signage....', 1, '') 
#1 /home/admin/public_html/signage/xibo/oauth-php/library/OAuthRequester.php(112): OAuthRequestSigner->sign(1, NULL, '') 
#2 /home/admin/public_html/signage/xibo/index.php(551): OAuthRequester->doRequest(1) 
#3 /home/admin/public_html/signage/xibo/index.php(158): callService(Array, true) 
#4 /home/admin/public_html/signage/xibo/index.php(42): MakeSignedRequest() 
#5 {main} thrown in /home/admin/public_html/signage/xibo/oauth-php/library/store/OAuthStoreSQL.php on line 225

Can anyone please help me with this…

Thanks

Any one Please… Thanks

I’d really recommend upgrading your CMS to the 1.8.0-beta (or wait a little while and get rc1). The API in 1.7 was experimental and didn’t get released. However the 1.8 API is completely rewritten and full functional (and tested).

There are API wrappers available for easy integration - you can find out more here: http://xibo.org.uk/manual-tempel/en/cms_api.html

hi Dan… Thanks for your reply…

so i start install xibo cms 1.8.0 with docker… but at the ende i get this error… and i cant get xibo working…

Can You help me… Thanks

Status: Image is up to date for mysql:5.6
f842e519ae7ce40e68b16d58b0a9da85d81e6ab9e2b40c4ca00fa239c010a8f4
82ff2c245138405675d83896b1d790906631d9bcf2548d0ba9840b4e7a63d6f3
Error response from daemon: Cannot start container 82ff2c245138405675d83896b1d790906631d9bcf2548d0ba9840b4e7a63d6f3: iptables failed: iptables -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.18 --dport 9505 -j ACCEPT: iptables: No chain/target/match by that name.
(exit status 1)
fac2033ab659655f0bb41bb64d40654d6fae572254ffe8445d3cbcaf82b2ef48
Error response from daemon: Cannot start container fac2033ab659655f0bb41bb64d40654d6fae572254ffe8445d3cbcaf82b2ef48: iptables failed: iptables -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.19 --dport 80 -j ACCEPT: iptables: No chain/target/match by that name.
(exit status 1)
CMS is starting. It may take a few moments to be fully running

I’ve not seen that error before - its a Docker error rather than a Xibo error. I did a little googling and it might be your host machine firewall? What host o/s are you using?

Unless @alex has any ideas?

Hi… Dan… Now i get this error… do you no Why… thanks

Digest: sha256:ceb550137877216803323e220c0a48eab942ff3914ec33c45f3405c88c61745f
Status: Image is up to date for mysql:5.6
3234fdec44300aec8aedcd846774a499d8ab630016b4207d9c305bc4859642af
b06f315209196f2fc1a86f1258af40e6d8b4132cdf03a59f403663055286a5c3
5941980cad02c231cd74e26ad34ae071a5df652e8f6b873fc53dad8c0d7ac0ef
Error response from daemon: Cannot start container 5941980cad02c231cd74e26ad34ae 071a5df652e8f6b873fc53dad8c0d7ac0ef: Error starting userland proxy: listen tcp 0 .0.0.0:80: listen: address already in use
CMS is starting. It may take a few moments to be fully running
root@server [/home/admin/public_html/signage]#

tcp 0 .0.0.0:80: listen: address already in use

There is already ‘something’ running on port 80. Either your/a container is already running or you have another server up.

I suppose you are running docker on your own server? It appears that the host already has something running on port 80 - I guess a web server is already installed?

You can change the port the Xibo CMS Web container will bind to by editing your launcher.env file and adjusting the WEBSERVER_PORT configuration option.

If you do this then you will need to access Xibo over http://<yourip>:<WEBSERVER_PORT> instead of port 80 - or use your existing web server to reverse proxy requests into Docker.

Hi … Thanks for yours replys… I think that i must describe all things… So

I have a CentOS server with CPANEL, Easy Apache 4, CSF Firewall… My DOMAIN have a diferent ip from server ip…

SERVER IP - 192.168.0.1
DOMAIN IP - 192.168.0.2

What i want is istall XIBO 1.8.0 in a SUBDOMAIN…

SUBDOMAIN.DOMAIN.COM:8080

until now i have this…

DOCKER
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

i also change port in launcher.env to port 8080, and i open port 8080 in CSF firewall…

I also include this in Apache Pre VirtualHost Include

< VirtualHost *:80>
ProxyPreserveHost On

# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example: 
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ServerName subdomain.domain.com

< /VirtualHost>

SO… with this configuration my ERROR IS:

root@server [/home/admin/public_html/signage]# ./launcher bootstrap
Reading configuration
: command not found3:
: command not found11:
: command not found30:
: command not found33:
: command not found36:
: command not found40:
Bootstrapping CMS Docker Containers
release_1.8.0-beta: Pulling from xibosignage/xibo-cms
bb04ed60c038: Already exists
0812a82a4eba: Already exists
f6662ef795ac: Already exists
39a955bdc1e1: Already exists
348ae5f2350a: Already exists
d61c7e9067e9: Already exists
78a58c16256c: Already exists
af9e23c418de: Already exists
4b12cc99a718: Already exists
db99b68cc82a: Already exists
72f30ace3da6: Already exists
7a9babf113e7: Already exists
55dd9b9aa7f9: Already exists
450dc02b555f: Already exists
ab2c0c89d822: Already exists
e50773168051: Already exists
3154bc587ff2: Already exists
f60673602735: Already exists
4cc7a243535f: Already exists
fe8f5e24b751: Already exists
2be638466ce8: Already exists
4e408007630c: Already exists
e72f298d9f25: Already exists
6a7868ca2668: Already exists
6d80907b7218: Already exists
e5afca742940: Already exists
1a2597ae95be: Already exists
2fa96bbd9a55: Already exists
637927a1913e: Already exists
e6348c23c000: Already exists
34638a7f12da: Already exists
6d6960e40684: Already exists
bcef7bd22426: Already exists
8b7a36e67c2e: Already exists
92266f1c160c: Already exists
e240ccf17fb2: Already exists
9c188c6d7d83: Already exists
b91b93471366: Already exists
c072a12f8c8a: Already exists
958f9ec53785: Already exists
016b28ef4e88: Already exists
afb6d2a03ce8: Already exists
a98604f09f39: Already exists
38867498f673: Already exists
Digest: sha256:ebd8500175b3a3f26cee64d16e10bd07ae0c8f384472b255f4a0c8bd4f0eec6b
Status: Image is up to date for xibosignage/xibo-cms:release_1.8.0-beta
release_1.8.0-beta: Pulling from xibosignage/xibo-xmr
b28db778d4f7: Already exists
2334d959c0cf: Already exists
20fc819717cc: Already exists
62059538b3f4: Already exists
6f0edf24dfd4: Already exists
5a9ee0cfae75: Already exists
fc0c66b2845b: Already exists
8739f5d52bcb: Already exists
870a17ec0209: Already exists
0d61bb1ba6a9: Already exists
7dcbfcdc93e0: Already exists
bb02395188b3: Already exists
3d5fe17b61b3: Already exists
f5473b984a48: Already exists
7b903f2f7100: Already exists
6298f5a41472: Already exists
deda80878066: Already exists
68d0df4d1336: Already exists
Digest: sha256:7440f6a4a57243cc3c15c3a65ff68445d70038e83a6c476f3fd0749e4a127095
Status: Image is up to date for xibosignage/xibo-xmr:release_1.8.0-beta
5.6: Pulling from mysql
d0c4f1eb7dc8: Already exists
faeaf6fdfdcb: Already exists
4a2897085f95: Already exists
936faa0ee7d7: Already exists
e51967e96883: Already exists
d5e95f8f84cb: Already exists
c704cbb8282a: Already exists
21cc688a5519: Already exists
1dcef7f67886: Already exists
008abf2d8341: Already exists
e8ecf6da07b5: Already exists
f6e176e27a9b: Already exists
a931525f7f72: Already exists
2afbc2d9b3a2: Already exists
b017979dd35e: Already exists
c6fb383dec4a: Already exists
629cd7ed78f5: Already exists
5e05ff1e9486: Already exists
aa95c129d6dc: Already exists
Digest: sha256:ceb550137877216803323e220c0a48eab942ff3914ec33c45f3405c88c61745f
Status: Image is up to date for mysql:5.6
-cms-db), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowedxibo
.ocker: Invalid hostPort: 9505
See 'docker run --help'.
.ocker: Invalid hostPort: 8080
See 'docker run --help'.
CMS is starting. It may take a few moments to be fully running

THANKS…

What is the output of docker ps -a ? It might be that you have some existing containers running which are conflicting. The error messages at the end of your docker output seem garbled?

Your approach is correct - Docker runs and binds to your host machine port 8080, which you then use your host Apache to proxy requests arriving on your sub domain, into the Docker container.

Your problem is that Docker can’t start the cms-web container - not anything related to apache… unless of course you already have something listening to port 8080!

Thanks again by your reply…

No i dont have anything in port 8080

after run docker ps -a

root@server [/home/admin/public_html/signage]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0e34fa85b5af hello-world “/hello” 2 weeks ago Exited (0) 2 weeks ago dreamy_mayer

I’m not sure if the hello-world binds to any ports - but you could remove the container anyway docker rm <container>

When you run launcher bootstrap is the log output at the end really mangled? Or was that a copy/paste issue?

here is a screenshot

i think that i dont have any port to the docker…

i think the problem is in the port…

i had run this command netstat -tunlp and i dont see the port 8080 …

Sorry, i mean the error message from when you ran launcher bootstrap - docker ps -a doesn’t show any Xibo docker containers, which means that they couldn’t be created for some reason.

Ok… Thanks… i had solve this…

Can i use this https://github.com/dasgarner/xibo-example-api in xibo 1.8.0?

Thanks

No that is for the old 1.7 beta API - you probably want to use: https://github.com/xibosignage/oauth2-xibo-cms