Skip to content
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 #11455] ConfigSync broken from 2.4.3. to 2.4.4 under Windows #4066

Closed
icinga-migration opened this issue Mar 26, 2016 · 12 comments
Labels
bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11455

Created by sru on 2016-03-26 12:53:15 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2016-03-31 09:56:51 +00:00)
Target Version: 2.4.5
Last Update: 2016-04-20 08:16:02 +00:00 (in Redmine)

Icinga Version: 2.4.4
Backport?: Already backported
Include in Changelog: 1

Hello,

icinga2 - The Icinga 2 network monitoring daemon (version: v2.4.4)

Copyright (c) 2012-2016 Icinga Development Team (https://www.icinga.org/)
License GPLv2+: GNU GPL version 2 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Application information:
  Installation root: d:\Program Files\ICINGA2
  Sysconf directory: d:\Program Files\ICINGA2\etc
  Run directory: d:\Program Files\ICINGA2\var\run
  Local state directory: d:\Program Files\ICINGA2\var
  Package data directory: d:\Program Files\ICINGA2\share\icinga2
  State path: d:\Program Files\ICINGA2\var/lib/icinga2/icinga2.state
  Modified attributes path: d:\Program Files\ICINGA2\var/lib/icinga2/modified-attributes.conf
  Objects path: d:\Program Files\ICINGA2\var/cache/icinga2/icinga2.debug
  Vars path: d:\Program Files\ICINGA2\var/cache/icinga2/icinga2.vars
  PID path: d:\Program Files\ICINGA2\var\run/icinga2/icinga2.pid

System information:
  Platform: Windows
  Platform version: Vista SP2
  Kernel: Windows
  Kernel version: 6.0
  Architecture: x86

Ojects under ...\ICINGA2\var\lib\icinga2\api\zones are not created.
The debug log shows:

...
[2016-03-26 10:58:32 Mitteleuropäische Zeit] notice/JsonRpcConnection: Received 'config::Update' message from 'devsv1'
[2016-03-26 10:58:32 Mitteleuropäische Zeit] warning/JsonRpcConnection: Error while processing message for identity 'devsv1'
Error: Function call 'mkdir' for file 'd:' failed with error code 13, 'Permission denied'

[2016-03-26 10:58:37 Mitteleuropäische Zeit] notice/CheckerComponent: Pending checkables: 0; Idle checkables: 0; Checks/s: 0
...

After renaming sbin to sbin-2.4.4 and copying sbin from a 2.4.3 satelite / restarting the service it works again.

Changesets

2016-03-29 07:44:05 +00:00 by (unknown) 016f47d

Fix Utility::MkDirP on Windows

fixes #11455

2016-04-20 08:07:24 +00:00 by (unknown) 0d2ae5c

Fix Utility::MkDirP on Windows

fixes #11455
@icinga-migration
Copy link
Author

Updated by sru on 2016-03-27 06:32:36 +00:00

sru wrote:

Hello,
[...]

Ojects under ...\ICINGA2\var\lib\icinga2\api\zones are not created.
The debug log shows:

[...]

After renaming sbin to sbin-2.4.4 and copying sbin from a 2.4.3 satelite / restarting the service it works again.

Cause:
lib/base/utility.cpp function MkDirP
pos is initialized with zero. Must be at least 2.

// Version 2.4.3
void Utility::MkDirP(const String& path, int mode)
{
    size_t pos = 0;

    while (pos != String::NPos) {
        pos = path.Find("/", pos + 1);
        MkDir(path.SubStr(0, pos), mode);
    }
}

// Version 2.4.4 with proposal / thoughts:
void Utility::MkDirP(const String& path, int mode)
{
#ifndef _WIN32    
        size_t pos = 0;
        while (pos != String::NPos) {
                pos = path.Find("/", pos + 1);
                MkDir(path.SubStr(0, pos), mode);
        }

#else /*_ WIN32 */
        // Possibilities and the number of separators to skip:
        // Local:        Skip 1 D:\FirstPos/...
        // UNC:          Skip 4 \\host\share\FirstPos/...
        // Volume Path's Skip 4 \\?\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e6963}\FirstPos        
        // What about our asian friends requiring Unicode ?

        size_t pos = 2; // Quickshot just supporting local
        while (pos != String::NPos) {    
                pos = path.FindFirstOf("/\\", pos + 1);
                MkDir(path.SubStr(0, pos), mode);
        }                

#endif /* _WIN32 */

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-03-29 06:09:50 +00:00

  • Category changed from Cluster to libbase
  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 2.4.5

Meh, looks like the patch for #10231 wasn't tested at all.

@icinga-migration
Copy link
Author

Updated by sru on 2016-03-29 06:53:44 +00:00

While we are on it,
above assumes an absolute path.

  • What about relative paths: "./firstpos", "../../firstpos", "existingdir/firstpos"
  • What about directory parts i have no create permission but browse permissions on?
    "D:\program files (x86)\icinga2" with everything but icinga2 existing but only browse access rights.
    Would it return "exists" or would it return "no permission", at which versions of Windows ?

I found no instructions how to set up a build toolchain for windows, so i am of no help with testing here...

@icinga-migration
Copy link
Author

Updated by Anonymous on 2016-03-29 07:45:03 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 016f47d.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-03-29 07:50:57 +00:00

  • Status changed from Resolved to Feedback
  • Assigned to changed from gbeutner to sru

Please test the fix. You can use the snapshot packages from http://packages.icinga.org/windows/ once they're built (timestamp > March 18th).

@icinga-migration
Copy link
Author

Updated by sru on 2016-03-29 09:44:48 +00:00

Still does not work, last lines of var/log/icinga2.log:

[2016-03-29 11:36:53 Mitteleuropäische Sommerzeit] information/ApiListener: Sending replay log for endpoint 'devsv1'.
[2016-03-29 11:36:53 Mitteleuropäische Sommerzeit] information/ApiListener: Finished sending replay log for endpoint 'devsv1'.
[2016-03-29 11:36:53 Mitteleuropäische Sommerzeit] warning/JsonRpcConnection: Error while processing message for identity 'devsv1'
Error: Function call 'mkdir' for file 'd:' failed with error code 13, 'Permission denied'

Version tested:

D:\Program Files\ICINGA2\sbin>icinga2.exe --version
icinga2.exe - The Icinga 2 network monitoring daemon (version: v2.4.4-275-gdf2adb1)

Copyright (c) 2012-2016 Icinga Development Team (https://www.icinga.org/)
License GPLv2+: GNU GPL version 2 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Application information:
  Installation root: d:\Program Files\ICINGA2
  Sysconf directory: d:\Program Files\ICINGA2\etc
  Run directory: d:\Program Files\ICINGA2\var\run
  Local state directory: d:\Program Files\ICINGA2\var
  Package data directory: d:\Program Files\ICINGA2\share\icinga2
  State path: d:\Program Files\ICINGA2\var/lib/icinga2/icinga2.state
  Modified attributes path: d:\Program Files\ICINGA2\var/lib/icinga2/modified-attributes.conf
  Objects path: d:\Program Files\ICINGA2\var/cache/icinga2/icinga2.debug
  Vars path: d:\Program Files\ICINGA2\var/cache/icinga2/icinga2.vars
  PID path: d:\Program Files\ICINGA2\var\run/icinga2/icinga2.pid

System information:
  Platform: Windows
  Platform version: Vista SP2
  Kernel: Windows
  Kernel version: 6.0
  Architecture: x86

@icinga-migration
Copy link
Author

Updated by sru on 2016-03-29 10:23:32 +00:00

Just tested on another satelite running Server 2012R2 64Bit, worked without problems.
Rechecked that the access rights on the vista machine are fine:

Service runs as NETZWERKDIENST.

D:\>icacls  d:\
d:\ NT-AUTORITÄT\Authentifizierte Benutzer:(OI)(CI)(M)
    NT-AUTORITÄT\SYSTEM:(OI)(CI)(F)
    VORDEFINIERT\Administratoren:(OI)(CI)(F)
    VORDEFINIERT\Benutzer:(OI)(CI)(RX)

1 Dateien erfolgreich verarbeitet, bei 0 Dateien ist ein Verarbeitungsfehler aufgetreten.

D:\>icacls  "d:\Program Files"
d:\Program Files NT-AUTORITÄT\Authentifizierte Benutzer:(I)(OI)(CI)(M)
                 NT-AUTORITÄT\SYSTEM:(I)(OI)(CI)(F)
                 VORDEFINIERT\Administratoren:(I)(OI)(CI)(F)
                 VORDEFINIERT\Benutzer:(I)(OI)(CI)(RX)

1 Dateien erfolgreich verarbeitet, bei 0 Dateien ist ein Verarbeitungsfehler aufgetreten.

D:\>icacls  "d:\Program Files\ICINGA2"
d:\Program Files\ICINGA2 NT-AUTORITÄT\Authentifizierte Benutzer:(OI)(CI)(F)
                         NT-AUTORITÄT\NETZWERKDIENST:(OI)(CI)(F)
                         NT-AUTORITÄT\Authentifizierte Benutzer:(I)(OI)(CI)(M)
                         NT-AUTORITÄT\SYSTEM:(I)(OI)(CI)(F)
                         VORDEFINIERT\Administratoren:(I)(OI)(CI)(F)
                         VORDEFINIERT\Benutzer:(I)(OI)(CI)(RX)

1 Dateien erfolgreich verarbeitet, bei 0 Dateien ist ein Verarbeitungsfehler aufgetreten.

Just for fun, gave full permissions:

D:\>icacls d:\ /grant NETZWERKDIENST:(F)
Bearbeitete Datei: d:\
1 Dateien erfolgreich verarbeitet, bei 0 Dateien ist ein Verarbeitungsfehler aufgetreten.

D:\>icacls  d:\
d:\ NT-AUTORITÄT\NETZWERKDIENST:(F)
    NT-AUTORITÄT\Authentifizierte Benutzer:(OI)(CI)(M)
    NT-AUTORITÄT\SYSTEM:(OI)(CI)(F)
    VORDEFINIERT\Administratoren:(OI)(CI)(F)
    VORDEFINIERT\Benutzer:(OI)(CI)(RX)

1 Dateien erfolgreich verarbeitet, bei 0 Dateien ist ein Verarbeitungsfehler aufgetreten.

D:\>icacls "d:\Program Files" /grant NETZWERKDIENST:(F)
Bearbeitete Datei: d:\Program Files
1 Dateien erfolgreich verarbeitet, bei 0 Dateien ist ein Verarbeitungsfehler aufgetreten.

Still getting:

[2016-03-29 12:22:00 Mitteleuropäische Sommerzeit] information/ApiListener: Finished sending replay log for endpoint 'devsv1'.
[2016-03-29 12:22:00 Mitteleuropäische Sommerzeit] warning/JsonRpcConnection: Error while processing message for identity 'devsv1'
Error: Function call 'mkdir' for file 'd:' failed with error code 13, 'Permission denied'

@icinga-migration
Copy link
Author

Updated by sru on 2016-03-29 10:33:13 +00:00

Access rights of the working machine running Server 2012R2:

C:\Users\administrator.ADMINISTRATION>icacls c:\
c:\ NT AUTHORITY\SYSTEM:(OI)(CI)(F)
    BUILTIN\Administratoren:(OI)(CI)(F)
    BUILTIN\Benutzer:(OI)(CI)(RX)
    BUILTIN\Benutzer:(CI)(AD)
    BUILTIN\Benutzer:(CI)(IO)(WD)
    CREATOR OWNER:(OI)(CI)(IO)(F)

Successfully processed 1 files; Failed processing 0 files

C:\Users\administrator.ADMINISTRATION>icacls "c:\Program Files (x86)"
c:\Program Files (x86) NT SERVICE\TrustedInstaller:(F)
                       NT SERVICE\TrustedInstaller:(CI)(IO)(F)
                       NT AUTHORITY\SYSTEM:(M)
                       NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
                       BUILTIN\Administratoren:(M)
                       BUILTIN\Administratoren:(OI)(CI)(IO)(F)
                       BUILTIN\Benutzer:(RX)
                       BUILTIN\Benutzer:(OI)(CI)(IO)(GR,GE)
                       CREATOR OWNER:(OI)(CI)(IO)(F)
                       APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(RX)
                       APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(OI)(CI)(IO)(GR,GE)

Successfully processed 1 files; Failed processing 0 files

C:\Users\administrator.ADMINISTRATION>icacls "c:\Program Files (x86)\ICINGA2"
c:\Program Files (x86)\ICINGA2 NT AUTHORITY\NETWORK SERVICE:(OI)(CI)(M)
                               NT SERVICE\TrustedInstaller:(I)(F)
                               NT SERVICE\TrustedInstaller:(I)(CI)(IO)(F)
                               NT AUTHORITY\SYSTEM:(I)(F)
                               NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
                               BUILTIN\Administratoren:(I)(F)
                               BUILTIN\Administratoren:(I)(OI)(CI)(IO)(F)
                               BUILTIN\Benutzer:(I)(RX)
                               BUILTIN\Benutzer:(I)(OI)(CI)(IO)(GR,GE)
                               CREATOR OWNER:(I)(OI)(CI)(IO)(F)
                               APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                               APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(OI)(CI)(IO)(GR,GE)

Successfully processed 1 files; Failed processing 0 files

I mean, not to support vista would not hurt, but not to support Server 2008 (the Server version of Vista) would for sure.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-03-29 13:25:45 +00:00

df2adb1 seems to be missing the patch. Try again. :)

@icinga-migration
Copy link
Author

Updated by sru on 2016-03-29 13:56:46 +00:00

Yes, now it is resolved.

Version checked:

D:\Program Files\ICINGA2\sbin>icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: v2.4.4-288-g83e0bcd)

Copyright (c) 2012-2016 Icinga Development Team (https://www.icinga.org/)
License GPLv2+: GNU GPL version 2 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Application information:
  Installation root: d:\Program Files\ICINGA2
  Sysconf directory: d:\Program Files\ICINGA2\etc
  Run directory: d:\Program Files\ICINGA2\var\run
  Local state directory: d:\Program Files\ICINGA2\var
  Package data directory: d:\Program Files\ICINGA2\share\icinga2
  State path: d:\Program Files\ICINGA2\var/lib/icinga2/icinga2.state
  Modified attributes path: d:\Program Files\ICINGA2\var/lib/icinga2/modified-attributes.conf
  Objects path: d:\Program Files\ICINGA2\var/cache/icinga2/icinga2.debug
  Vars path: d:\Program Files\ICINGA2\var/cache/icinga2/icinga2.vars
  PID path: d:\Program Files\ICINGA2\var\run/icinga2/icinga2.pid

System information:
  Platform: Windows
  Platform version: Vista SP2
  Kernel: Windows
  Kernel version: 6.0
  Architecture: x86

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-03-31 09:56:51 +00:00

  • Status changed from Feedback to Resolved
  • Assigned to changed from sru to gbeutner

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-04-20 08:16:02 +00:00

  • Backport? changed from Not yet backported to Already backported

@icinga-migration icinga-migration added bug Something isn't working libbase labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.4.5 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant