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

dependencies: unable to resolve related property #1142

Closed
vita2 opened this issue Aug 30, 2017 · 14 comments
Closed

dependencies: unable to resolve related property #1142

vita2 opened this issue Aug 30, 2017 · 14 comments
Assignees

Comments

@vita2
Copy link
Contributor

vita2 commented Aug 30, 2017

i'm trying to create the dependencies examples from the icinga2 documentation (Dependencies for Network Reachability) but i can't choose the necessary service as parent service.

Current Behavior

currently my host pfsense.home.lan has two services:

  • http-cert
  • ping4

both services will be applied with help of assignment rules:

apply Service "http-cert" {
    import "http"

    assign where host.name == "pfsense.home.lan"
    vars.http_certificate = 31
    vars.http_ssl = true

    import DirectorOverrideTemplate
}

apply Service "ping4" {
    import "ping4"

    assign where host.address

    import DirectorOverrideTemplate
}

at the dependencies form i can only choose the service http-cert but i need the ping4-service as parent service. i think the field can't find services which was assigned by the new "is true/set" operator.

add-dependency-01

when trying to input the ping4 service manually i will get the error message:

Unable to resolve related property: "parent_service_id" (IcingaDependency.php:414)

add-dependency-02

Steps to Reproduce (for bugs)

  1. create a ping4 service template
  2. apply the template to all hosts with "is set" operator (assign where host.address)
  3. try to create a dependency and choose the new ping4 service as parent service

Your Environment

  • Director version (System - About): 604cd24 feature/dependencies-1096
  • Icinga Web 2 version and modules (System - About): 2.4.1
  • Icinga 2 version (icinga2 --version): r2.7.0-1
  • Operating System and version: Debian Jessie 8.9 (3.16.0-4-amd64)
  • Webserver, PHP versions: nginx 1.6.2-5 + php5-fpm 5.6.30
@Thomas-Gelf Thomas-Gelf self-assigned this Sep 28, 2017
@Thomas-Gelf Thomas-Gelf added this to the 1.4.0 milestone Sep 28, 2017
@Thomas-Gelf
Copy link
Contributor

@vita2: I merged dependencies to master. They are still considered experimental, but should work fine. The issue you've raised should no longer exist, as "single dependency objects" are currently not allowed, just apply rules. In case you're still experiencing related issues please let me know.

@log1-c
Copy link

log1-c commented Mar 28, 2018

Hi @Thomas-Gelf ,

the issue is still present for me in v1.4.3:

Check applied to host by apply rule:

apply Service "Ping_Lo1" {
    check_command = "ping4"
    max_check_attempts = "5"
    check_interval = 5m
    retry_interval = 1m
    enable_notifications = true
    enable_active_checks = true
    enable_passive_checks = false
    enable_event_handler = true
    enable_perfdata = true
    volatile = false
    assign where match("TS-*-LR01", host.display_name)
    vars.ping_address = host.notes + "254"

    import DirectorOverrideTemplate
}

Dependency apply rule with service Ping-Lo1 as parent:
image

@matt407
Copy link

matt407 commented Sep 5, 2018

Hi,
unfortunately I experience the same issue 'Unable to resolve related property: "parent_service_id" (IcingaDependency.php:414)' with director version 1.4.3.

@Thomas-Gelf Thomas-Gelf modified the milestones: 1.4.0, 1.6.0 Sep 5, 2018
@Thomas-Gelf
Copy link
Contributor

This has been moved to the v1.6.0 milestone some time ago, but unfortunately kept it's "closed" state. Is this still a thing?

@Thomas-Gelf Thomas-Gelf reopened this Dec 10, 2018
@Thomas-Gelf Thomas-Gelf removed this from the 1.6.0 milestone Dec 10, 2018
@vita2
Copy link
Contributor Author

vita2 commented Dec 10, 2018

yes, the issue still exists. in related objects the field "parent service" doesn't offer services which was applied with the "is true/set" operator in the where clause.

ping_apply_rule

however, using the "!="-operator in the apply rule works. with it i can choose the applied service in dependencies. just tested.

@Thomas-Gelf Thomas-Gelf added this to the 1.6.1 milestone Dec 10, 2018
@Thomas-Gelf
Copy link
Contributor

Thanks for testing this!

@Thomas-Gelf Thomas-Gelf modified the milestones: 1.6.1, 1.7.0 Feb 14, 2019
@stevie-sy
Copy link

Also in our Environment (master branch) it still exists. Dependencies from host to host works fine, but not with service-host-dependencies.
In combination with downtimes it would be very nice if this would be fixed.

@log1-c
Copy link

log1-c commented Jun 7, 2019

The problem, that "is true" services are not shown, also exist for service that are assigne via a service set.
Is it possible to address this too?
I already opened a issue for this:
#1697

terra-nova pushed a commit to terra-nova/icingaweb2-module-director that referenced this issue Jul 6, 2019
@Thomas-Gelf
Copy link
Contributor

@vita2: when using a Service name, I've been able to figure out the following behavior:

  • when skipping the parent host, a custom string can be used as a Service name. That service needs to exist on hosts matching your rule, otherwise the configuration would probably be rejected
  • when choosing a parent host, the chosen service must exist on that host

Can you confirm that those two are working for you? What specific scenario is failing? And apart from all this, the above error message is obviously wrong and confusing. It's triggered by a tree resolver.

@Thomas-Gelf Thomas-Gelf modified the milestones: 1.7.0, 1.8.0 Sep 20, 2019
@vita2
Copy link
Contributor Author

vita2 commented Sep 24, 2019

hello @Thomas-Gelf,

sorry for the late response. i am able to configure the scenario from the initially post without any blocking messages. for me the issue is resolved. thank you! 🥇

Can you confirm that those two are working for you?

both variants work.

do you need more information for further investigation?

@dbu1986
Copy link

dbu1986 commented Apr 1, 2020

Interesting.

I want to apply a Dependency based on a parent Service which originates from a parent Host. However, the Dependency shall be assigned to completely different Hosts.

So I created a Dependency with parent Host = "ParentHost" and parent Service = "ParentService".

That resulted in different issues. It seems to depend on the way how "ParentService" has been applied to its "ParentHost". I tried several cases:

  1. Director --> Hosts --> "ParentHost" --> Add Service "ParentService"
    Issue: In the Dependency View, "ParentService" is chooseable as a parent service, but as I do so, the error message mentioned above is displayed:
    Unable to resolve related property: "parent_service_id" (IcingaDependency.php:584)

  2. Director --> Services --> Service Apply Rules --> Add Service "ParentService" --> Assign where host.name = "Testhost"
    Issue: none, that's working fine! :) "ParentService" is choosable, Dependency saveable, and config deployable.

  3. Director --> Services --> Service Sets (Assign where host.name = "Testhost") --> Add Service "ParentService"
    Issue: In the Dependency View, "ParentService" is not even chooseable as parent service. When I type manually "ParentService" into the parent Service field, the error message mentioned above is displayed:
    Unable to resolve related property: "parent_service_id" (IcingaDependency.php:584)

######################################################################

  • Director Version: 1.7.0

  • Icinga2 Version: 2.11.2

  • Icingaweb2 Version: 2.7.1

@devopstt
Copy link

Same here. I can not add a service from a serviceset (case 3).
I'm thinking about a workaround like blacklisting the needed service and manually adding it as "single serivce" or "Service Apply Rule".
But I think servicesets are there for a reason and we use them as a set of standard checks for many hosts. Any chance this will be fixed in future? Would be really helpful for us.

@Thomas-Gelf Thomas-Gelf removed this from the 1.8.0 milestone Nov 30, 2020
@Thomas-Gelf Thomas-Gelf added this to the 1.9.0 milestone Nov 30, 2020
@Thomas-Gelf Thomas-Gelf modified the milestones: 1.9.0, 1.10.0 Dec 13, 2021
@Thomas-Gelf Thomas-Gelf modified the milestones: 1.10.0, next Jun 20, 2022
@v0tti
Copy link

v0tti commented Jul 15, 2022

The issue you've raised should no longer exist, as "single dependency objects" are currently not allowed, just apply rules.

This seems to only apply to single dependency objects that are created directly. It is still possible to try to add single dependency objects via a sync rule, but it seems to fail nevertheless. The options should probably be removed as well if it is not supported.

@Thomas-Gelf
Copy link
Contributor

Should have been fixed with #2669. As it affects only some special Dependencies, it would be great if you could test this in your setup and let me know, whether it now works as expected.

@nilmerg nilmerg removed this from the next milestone Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants