API configuration problem, consult your administrator

Hey,

I’ve got the problem that I can’t get a access_token via Postman. I’ve already found the articles with the private, public and encryption key but none of the ideas have worked at my XIBO version. I’m hosting XIBO on a Linux System and the server is on the version 3.3.3.

Have you got any ideas to solve the problem?

Hey,

A full error message will be recorded in your CMS logs, so the first place to check is there. You can filter the “channel” by AUTH to see only messages related to the endpoint which issues access tokens.

If I check the logs there is nothing in the channel AUTH… the only message I’ve got is in Postman
image

Xibo definitely logs an error immediately before that message is raised. Can you make sure your log level is set to error or higher and repeat?

Aside from that I suggest upgrading to the latest 3.3 release (currently 3.3.6)

So the only error log I found is on the Server…

If we can’t get that message logged into the CMS logs then we are essentially guessing. Please can you try and set your CMS “server mode” to “Test” and then repeat your access token request to see if anything further is output or logged?

So after I changed the XIBO server mode to test I’ve got this error message:


Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45

Warning: file_get_contents(/var/www/vhosts/customer.net/ShopTV-Medien/certs/encryption.key): Failed to open stream: No such file or directory in /var/www/vhosts/customer.net/shoptv.customer.net/lib/Service/ConfigService.php on line 600

Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45

Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45

Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45
{"error":0,"message":"API configuration problem, consult your administrator"}

The API requires a pub/private RSA keypair and an encryption key to be provided. The docker entrypoint will create these in /library/certs.

As you’re installing manually you’ll need to provide these yourself. You can override the generated keys paths and encryption key by providing an alternative in settings-custom.php.
For example:

$apiKeyPaths = [
    'publicKeyPath' => '/var/www/cms/custom/public.key',
    'privateKeyPath' => '/var/www/cms/custom/private.key',
    'encryptionKey' => ''
];

Is there a specific folder where the settings-custom.php is installed?

Yes, you place that file inside your custom/ folder.

Alternatively you can put the public.key, private.key and encryption.key in the location specified in the error message you see, namely /var/www/vhosts/customer.net/ShopTV-Medien/certs/. If you do this then a custom settings file is not required and the CMS will take those files from that location.

So I just moved the files into the folder, that the server is using and it seems to work. But how can I remove all the other errors?


Deprecated: Method ReflectionParameter: :getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45



Deprecated: Method ReflectionParameter: :getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45



Deprecated: Method ReflectionParameter: :getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45



Deprecated: Method ReflectionParameter: :getClass() is deprecated in /var/www/vhosts/customer.net/shoptv.customer.net/vendor/php-di/php-di/src/Invoker/FactoryParameterResolver.php on line 45

{
“error”: 0,
“message”: “API configuration problem, consult your administrator”
}

Those other deprecations are being output due to the CMS being in “Test” mode. However, are you sure you’re running a supported version of PHP?

v3.3 does not support PHP8 (7.4 max).

v4.0 will support PHP 8.1+.

So I’m currently working on PHP 8 but only v3.3.3 of XIBO… is there any chance I can get the CMS to work with this configuration or do I have to downgrade my PHP version back to 7.4.?

Correct :+1:

PHP8 is not supported by any CMS earlier than v4 which is currently in alpha. You should run PHP 7.4 to use Xibo 3.3.

We do not recommend running v4 in production yet, but we will have a release candidate available in 1 month which you could run in production if you wanted. That would allow you to keep with PHP 8.1+.

So now I’ve downgraded PHP back to 7.4. but still, when I try to get an access token via postman I’ve got the same error message. Even when I put the system into Test mode there is no more info about the error. It is just the same error message as always.

image

There will be an error log recorded with the exact details - if you log into the CMS and go to Advanced → Logs. Recreate the issue and then press refresh.You should see a log in the AUTH channel explaining what the problem is.

The only reported errors we’ve ever had of this type of issues is with those keys not being present or being incorrectly configured.

Maybe this is a permissions issue on those files - these are the permissions we set in the container::

chmod 600 /var/www/cms/library/certs/private.key
chmod 660 /var/www/cms/library/certs/public.key

Obviously you’d need yours in here: /var/www/vhosts/customer.net/ShopTV-Medien/certs/

I’ve put the private and public key into the same folder as the encryption key but still the CMS isn’t working… there are no Logs in the AUTH channel, there is only one in the PLAYER channel but I am pretty sure, that this isn’t the problem


(screenshot of the error message)

There are no other logs at all. Is there another thing I can try to get the CMS to work?

Okay, so I think that I’ve found the problem…

The problem is that the file is in the folder but still I’m getting the same message. Do I have to give the private.key any permission in another file or why can’t the CMS read the file?

Tracing through the error, I think it can see the file and the file is readable, but it can’t parse it as a valid key.

Did you put a pass phrase on your private key? If so then please try without one.

I tried it with a pass phrase but also without and both ways I’ve got the same error message