New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dev.icinga.com #12835] Posting config stage fails on FreeBSD #4709
Comments
Updated by tgelf on 2016-10-11 14:51:17 +00:00
This is not a Director issue. Please check permissions for /var/lib/icinga2/api/packages as suggested in the linked forum. |
Updated by tgelf on 2016-10-13 13:09:55 +00:00
Closing this as not really Director-related. Please let me know in case you continue having such after having checked your directory permissions. In case they are wrong, this should probably be fixed in the Icinga 2 FreeBSD packages. |
Updated by LarsEngels on 2016-10-17 09:22:58 +00:00 @tgelf: I am facing the same issue. All files and directories are owned by "icinga" which also runs the icinga2 daemon. |
Updated by tgelf on 2016-10-18 01:59:56 +00:00
@LarsEngels: thank you! Still, I do not see much Director can do here. It fires an API request via HTTPS to port 5665 and does in no way directly work with those files. Could you please try to manually create a config package with curl or similar? Like shown here: In case it doesn't work we have an easy way to reproduce this and move the issue to the core queue. If it doesn't it must be something weird, then I'd next try to figure out whether something changes when either Director or the Core does not run on FreeBSD while the other component still does. Thanks for your help! |
Updated by LarsEngels on 2016-10-18 08:17:42 +00:00 Creating the config package works:
However uploading a configuration does not work:
|
Updated by LarsEngels on 2016-10-18 08:20:16 +00:00 Strangely the configuration file was created:
|
Updated by LarsEngels on 2016-10-18 08:24:17 +00:00 I guess it's okay that new directories in /var/lib/icinga2/api/packages get created with mode 0700 and owner icinga? |
Updated by LarsEngels on 2016-10-18 09:38:51 +00:00 debug.log for the "failing" creation:
|
Updated by andrem on 2016-10-18 14:14:39 +00:00 Hi All, icingaweb2 has Zend-Framwork2 as depency. I have now edit my Makefile to this : RUN_DEPENDS= ${LOCALBASE}/share/ZendFramework/bin/classmap_generator.php:www/zend-framework1 and deinstall / reinstalled icingaweb2 now it works for me. Is it possible, that zendframework2 is not compatibple yet? Here the Log : Deployment Zeit 2016-10-18 16:03:13 information/cli: Icinga application loader (version: r2.5.4-1) Best Regards |
Updated by LarsEngels on 2016-10-18 14:43:40 +00:00 @andrem: That's a good catch! I will update the FreeBSD ASAP. |
Updated by LarsEngels on 2016-10-18 14:45:50 +00:00 One thing: Why is this a problem with Icinga Web 2 when using curl also exposes the problem? /me scratches his head.... |
Updated by andrem on 2016-10-18 14:59:10 +00:00
@LarsEngels i have rebuild Curl with this Switches : |
Updated by LarsEngels on 2016-10-18 15:42:35 +00:00 Negative. Having replaced Zend-Framework 2 with version 1, I still get the same error like before. |
Updated by andrem on 2016-10-18 15:47:07 +00:00 LarsEngels wrote:
nginx php-fpm icinga2 restarted? |
Updated by LarsEngels on 2016-10-18 15:53:18 +00:00 Apache, yes. |
Updated by tgelf on 2016-10-18 17:42:25 +00:00
LarsEngels wrote:
Thanks for this, I'll move the issue to the Icinga 2 core project. The CURL example perfectly shows that this is not related to Web or Director, thanks for your efforts! Regarding the Zend Framework: Icinga Web 2 uses and ships ZF1. Some packages ship with dependencies, others contain library/vendor/Zend. ZF2 is a completely different beast, we'll never switch to that one. Cheers, |
Updated by tgelf on 2016-10-18 17:45:18 +00:00
|
Updated by LarsEngels on 2016-10-20 10:21:30 +00:00
As I'm out of guesses, @dnsmichi could you please look into this? |
Updated by mfriedrich on 2016-12-07 20:21:25 +00:00
Anyone who's interested in reproducing this and not having a FreeBSD box - I've added one for Virtualbox using an official Vagrant box image. Required some fiddling though, as the image doesn't provide a base mac address and so on. Still, it is working. Minimal docs included. https://github.com/Icinga/icinga-vagrant/tree/master/icinga2x-freebsd Tried to reproduce the mentioned issue, I am not able to do so.
(that one is obviously not activated as the config validation will fail)
I'm not a FreeBSD user so anyone capable of knowing possible permission issues or other security measurements - feel free to comment. If not I'll close this for not being reproducible with a standard FreeBSD install. |
@larsengels please have a look into the Vagrant boxes. You're the FreeBSD pro and might see the difference in minutes. |
I started the Vagrant box, ran
|
Strange. Can you modify the request body and add
to get a more verbose error message? |
here you go: |
That's rather unusual. Can you please show us the output of the following two commands:
The error message you're getting implies that Icinga is unable to figure out the path for the "icinga2" executable - which should never happen. :) |
Not finding things isn't very uncommon on FreeBSD, since many Linux-y assumptions regarding paths and PATH environments often fail.
unfortunately, there is no /proc//environ, there isn't even procfs if you don't enable it ;) |
Oh, I only just realized you were using FreeBSD (should've read the subject!). What I'd be interested in is the value of the PATH environment variable. Maybe there's another way to figure that out for a currently-running process. :) |
yes, that's procstat -e: so I guess, /usr/local/sbin is missing here, since the icinga2 binary lives there, and tadaah:
|
This should now be fixed in the master branch. Thanks for reporting this problem. :) |
Seems @larsengels pushed a workaround to the FreeBSD package. |
I had the same issue when trying to configure Director. Turns out the API user needed an extra permission called
|
@vercotux i am getting the same error message currently. Did you have to remove your database completely? In the activity log I can see all the commands imported & everything imported, but deploying gives me the error (RestApiResponse.php:108). API works via curl in command line strangely enough. Tried to add the "console" permission to my api user, did not work unfortunately, here is how it looks currently: if the permissions are set to: If I set the permissions to : Would appreciate a hint, thanks! |
Indeed.
I had the same issue. The reason was that everything was actually not imported. It looked like the import was successful, but about half of the stuff was missing in the DB. Try with the following permissions: Also make sure your config file & directory permissions are correct. Hope it helps. |
Hey @vercotux ! Thanks for the fast answer. I was on holiday, got to try your suggestion yesterday. However, it is still not working unfortunately. I set up a new database "director" to use it in icinga2. This is how i imported the resource: I then configured the director module: This is my api-users.conf: Kickstart looks like this: --> endpoint name is same as icinga host I would be very thankful if anyone has more tips. No idea where to start atm Thanks & cheers |
Please move this discussion to https://community.icinga.com This issue was closed in 2016, no need to bump it again and again. Thanks. |
This issue has been migrated from Redmine: https://dev.icinga.com/issues/12835
Created by andrem on 2016-09-30 13:14:54 +00:00
Assignee: andrem
Status: Feedback (closed on 2016-10-13 13:09:55 +00:00)
Target Version: (none)
Last Update: 2016-12-07 20:21:25 +00:00 (in Redmine)
Hi All,
when i deploy a config from Director to my Icinga2, I get this :
/usr/local/www/icingaweb2/modules/director/library/Director/Core/RestApiClient.php:194:string '{error creation failed."}' (length=49)
The Versions are : Icinga2 (v.r2.5.4-1) und Icingaweb2 (v.2.3.4) Director 1.1.0 (Git from 30.09.2016) mySQL 56 php56 Nginx FreeBSD 10.3
Icinga2 debug.log show this :
[2016-09-30 15:11:50 +0200] information/ApiListener: New client connection from [::ffff:172.16.1.54]:17538 (no client certificate)
[2016-09-30 15:11:50 +0200] notice/ApiListener: New HTTP client
[2016-09-30 15:11:50 +0200] debug/HttpRequest: line: GET /v1/config/packages HTTP/1.1, tokens: 3
[2016-09-30 15:11:50 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'HttpServerConnection'
[2016-09-30 15:11:50 +0200] information/HttpServerConnection: Request: GET /v1/config/packages (from [::ffff:172.16.1.54]:17538, user: root)
[2016-09-30 15:11:50 +0200] debug/HttpServerConnection: Http client disconnected
[2016-09-30 15:11:50 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'HttpServerConnection'
[2016-09-30 15:11:51 +0200] debug/IdoMysqlConnection: Query: COMMIT
[2016-09-30 15:11:51 +0200] debug/IdoMysqlConnection: Query: BEGIN
[2016-09-30 15:11:52 +0200] debug/IdoMysqlConnection: Query: COMMIT
[2016-09-30 15:11:52 +0200] debug/IdoMysqlConnection: Query: BEGIN
[2016-09-30 15:11:53 +0200] debug/IdoMysqlConnection: Query: COMMIT
[2016-09-30 15:11:53 +0200] debug/IdoMysqlConnection: Query: BEGIN
[2016-09-30 15:11:54 +0200] debug/IdoMysqlConnection: Query: COMMIT
[2016-09-30 15:11:54 +0200] debug/IdoMysqlConnection: Query: BEGIN
[2016-09-30 15:11:54 +0200] information/ApiListener: New client connection from [::ffff:172.16.1.54]:10582 (no client certificate)
[2016-09-30 15:11:54 +0200] notice/ApiListener: New HTTP client
[2016-09-30 15:11:54 +0200] debug/HttpRequest: line: GET /v1/config/packages HTTP/1.1, tokens: 3
[2016-09-30 15:11:54 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'HttpServerConnection'
[2016-09-30 15:11:54 +0200] information/HttpServerConnection: Request: GET /v1/config/packages (from [::ffff:172.16.1.54]:10582, user: root)
[2016-09-30 15:11:54 +0200] debug/HttpRequest: line: DELETE /v1/config/stages/director/icinga2-tb.XXX.de-1475240554-51 HTTP/1.1, tokens: 3
[2016-09-30 15:11:54 +0200] information/HttpServerConnection: Request: DELETE /v1/config/stages/director/icinga2-tb.XXX.de-1475240554-51 (from [::ffff:172.16.1.54]:10582, user: root)
[2016-09-30 15:11:54 +0200] debug/HttpRequest: line: GET /v1/config/packages HTTP/1.1, tokens: 3
[2016-09-30 15:11:54 +0200] information/HttpServerConnection: Request: GET /v1/config/packages (from [::ffff:172.16.1.54]:10582, user: root)
[2016-09-30 15:11:54 +0200] debug/HttpRequest: line: POST /v1/config/stages/director HTTP/1.1, tokens: 3
[2016-09-30 15:11:54 +0200] information/HttpServerConnection: Request: POST /v1/config/stages/director (from [::ffff:172.16.1.54]:10582, user: root)
[2016-09-30 15:11:54 +0200] information/ConfigPackageUtility: Updating configuration file: /var/lib/icinga2/api/packages/director/icinga2-tb.XXX.de-1475241114-52/zones.d/director-global/001-director-basics.conf
[2016-09-30 15:11:54 +0200] information/ConfigPackageUtility: Updating configuration file: /var/lib/icinga2/api/packages/director/icinga2-tb.XXX.de-1475241114-52/zones.d/director-global/commands.conf
[2016-09-30 15:11:54 +0200] information/ConfigPackageUtility: Updating configuration file: /var/lib/icinga2/api/packages/director/icinga2-tb.XXX.de-1475241114-52/zones.d/director-global/host_templates.conf
[2016-09-30 15:11:54 +0200] debug/HttpServerConnection: Http client disconnected
[2016-09-30 15:11:54 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'HttpServerConnection'
Logfiles from php-fpm und nginx Show no Errors.
Best Regards.
https://monitoring-portal.org/index.php?thread/37556-icinga2-director-und-freebsd/&s=b8c3e7cf8c686b98975218ae43a1559b34f9ecef
Attachments
The text was updated successfully, but these errors were encountered: