Error - Kickstart -Assistent - Rest.Api.Response.php:111

Hello, I get an error message while running the kickstart wizard.

Error message:
The requested path ‘v1 / console / execute-script’ could not be found or the request method is not valid for this path. (RestApiResponse.php: 111)

After I click on the activity log I get the error message:
The requested path ‘v1 / config / packages’ could not be found or the request method is not valid for this path. (RestApiResponse.php: 111)

Versions:

Icinga Web 2 version 2.8.1
PHP version 7.2.24
Loaded modules

director master
doc 2.8.1
incubator 0.5.0
ipl v0.5.0
monitoring 2.8.1
reactbundle 0.7.0

Troubleshooting:

Output of the curl test with certificates
curl -u api-user --cacert ca.crt ‘https: // localhost: 5665 / v1’
Enter host password for user ‘api-user’:
curl: (77) error setting certificate verify locations:
CAfile: approx. Crt
CApath: none

Output of the curl without a certificate
curl -k -s -u api-user ‘https: // localhost: 5665 / v1’
Enter host password for user ‘api-user’:

Icinga 2

Hello from Icinga 2 (Version: 2.12.0-1)!

You are authenticated as api-user . Your user has the following permissions:

  • status/query
  • actions/*
  • objects/modify/*
  • objects / query / *

More information about API requests is available in the documentation .

/var/log/icinga2/icinga2.log

[2020-08-12 12:07:54 +0200] information / ApiListener: New client connection from [localhost-IP]: 46526 (no client certificate)
[2020-08-12 12:07:54 +0200] information / HttpServerConnection: Request: GET / v1 / (from [localhost-IP]: 46526), ​​user: api-user, agent:).
[2020-08-12 12:07:54 +0200] information / HttpServerConnection: Request: GET / v1 / status (from [localhost-IP]: 46526), ​​user: api-user, agent:).
[2020-08-12 12:07:54 +0200] information / HttpServerConnection: Request: GET / v1 / objects / zones (from [localhost-IP]: 46526), ​​user: api-user, agent:).
[2020-08-12 12:07:54 +0200] information / HttpServerConnection: Request: POST / v1 / console / execute-script (from [localhost-IP]: 46526), ​​user: api-user, agent:).
[2020-08-12 12:07:54 +0200] warning / FilterUtility: Missing permission: console
[2020-08-12 12:07:54 +0200] information / HttpServerConnection: HTTP client disconnected (from [localhost-IP]: 46526)

I know that I seem to be missing permissions, I just don’t know how to set them and where ?!

Hi,

the available permissions can be found here. These are configured as part of your ApiUser object.

Though, I don’t know which permissions the director exactly requires. The documentation also only suggests to grant everything (*).

Small thing I’d like to mention:
I think it would be best to use a release version(v1.7.2 is the latest) of the Director, not the git master. That should be more reliable afaik

Ok, changing the permissions helped. I have assigned all rights to the api user. I know this is not the right way, but the fastest way.

nano /etc/icinga2/conf.d/api-users.conf

object ApiUser “api-user” {
password = “top secret”
permissions = ["*"]
}

1 Like