question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong `minion_id` in matcher methods.

See original GitHub issue

Description of Issue

When filtering pillars with match.filter_by, they don’t get matched correctly. Reason is a wrong minion_id in the matcher methods. This bug was introduced in https://github.com/saltstack/salt/pull/48809/ , hence the question if that was somewhat intentional.

More specifically, it because of this deletion https://github.com/saltstack/salt/pull/48809/files#diff-889b4ad7294d8f45dfd1c3a87b9ba427L44

Can provide PR after clarification.

Setup

Any Setup with minion-filtered pillars, as described in https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.match.html

Steps to Reproduce Issue

Setup minion-filtered pillars as described in https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.match.html

Versions Report

Most of the 2019 versions, introduced with the PR https://github.com/saltstack/salt/pull/48809/

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
peter-slovakcommented, May 15, 2020

We’re running into the same problem. Although getting minion_id from __opts__ should be a safe fallback from grains['id'], the reality is that __opts__['minion_id'] actually contains a different minion’s name.

That’s why the pcre_match keeps working and glob_match broke down - the first one uses opts['id'] (which in our case contains the correct minion name), the other one uses __opts__['minion_id'] (which contains another minion’s name).

I’m not sure how this is possible; my guess would be that __opts__['minion_id'] is somehow, somewhere modified as a result of a race or thread unsafety.

This problem goes away for a while after we restart the master. However, with 100% reproducibility, after we render the pillar on all minions (salt --async '*' pillar.items), the problem is back.

0reactions
peter-slovakcommented, May 15, 2020

FWIW, changing minion_id = opts.get('minion_id', opts['id']) to minion_id = opts['id'] in matchers/glob_match.py works around the problem (thus bypassing the incorrect value in opts['minion_id']).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compound matchers - Salt Project Documentation
Compound matchers allow very granular minion targeting using any of ... PCRE Minion ID ... Failing to obey this rule may result in...
Read more >
Java: pattern matcher method returns wrong result
Regex explained. Your regex finds 0 length items,which adds a lot of matches of 0 length. Explained. As the output is all on...
Read more >
Matcher (Java Platform SE 8 ) - Oracle Help Center
A matcher is created from a pattern by invoking the pattern's matcher method. Once created, a matcher can be used to perform three...
Read more >
How to work with SaltStack Config minions in vRealize ...
The minionId value must match the value specified for the machine's /salt/minion_id in the cloudConfig section of the cloud template code.
Read more >
Boss machine only 1 error left to fix! - Codecademy Forums
So I have only one error left to fix: 60 passing (2s) 1 failing BONUS: ... to use router parameters or other methods...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found