[BUG] - Unable to target Oracle Linux 8 machines by grains if all minions are at version 3002.5. UPDATE: Also affects Oracle Linux 7.
Description On 3002.5, unable to target Oracle Linux 8 machines by built-in grains if all of the OL8 minion version is at 3002.5. We are able to target Oracle Linux 7. NOTE: we are able to target any custom grains without issue
Setup Default setup
Steps to Reproduce the behavior
Targeting with salt -G "osmajorrelease:8" test.ping yields zero results. (NOTE: The saltmaster is OL8 and it cannot test.ping itself when trying to target built-in grain.)
[root@hci-inf-d-slt03 ~]# salt -G "osmajorrelease:8" test.ping
No minions matched the target. No command was sent, no jid was assigned.
ERROR: No return received
Targeting with salt -G "osmajorrelease:7" test.ping yields results.
[root@hci-inf-d-slt03 ~]# salt -G "osmajorrelease:7" test.ping
hci-inf-z-snd246:
True
hci-inf-z-snd234:
True
hci-inf-z-snd201:
True
hci-inf-z-snd235:
True
hci-inf-z-snd249:
True
hci-inf-z-snd239:
True
The master has both OL7 and OL8. You can do a grains.get and get the osmajorrelease for both OL7 and OL8.
[root@hci-inf-d-slt03 ~]# salt \* grains.get osmajorrelease
hci-inf-d-slt03:
8
hci-inf-z-snd239:
7
hci-inf-z-snd241:
8
hci-inf-z-snd201:
7
hci-inf-z-snd246:
7
hci-inf-z-snd234:
7
hci-inf-z-snd235:
7
hci-inf-z-snd233:
8
hci-inf-z-snd240:
8
hci-inf-z-snd249:
7
Expected behavior We expect to be able to target just like osmajorrelease:7
Versions Report This is the master report.
Salt Version:
Salt: 3002.5
Dependency Versions:
cffi: 1.11.5
cherrypy: unknown
dateutil: 2.6.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.10.1
libgit2: 1.0.0
M2Crypto: 0.35.2
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: 2.14
pycrypto: Not Installed
pycryptodome: Not Installed
pygit2: 1.2.1
Python: 3.6.8 (default, Nov 5 2020, 18:03:20)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 19.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: oracle 8.3
locale: UTF-8
machine: x86_64
release: 4.18.0-240.15.1.el8_3.x86_64
system: Linux
version: Oracle Linux Server 8.3
Additional context We downgraded one of the OL8 minions to 3001.6. When that happened, we could test.ping them all by built-in grain.
[root@hci-inf-d-slt03 ~]# salt -G "osmajorrelease:8" test.version
hci-inf-d-slt03:
3002.5
hci-inf-z-snd240:
3002.5
hci-inf-z-snd233:
3001.6
hci-inf-z-snd241:
3002.5
After upgrading the one minion back to 3002.5, we were unable to target by built-in grain again. However, we could always target a custom grain we set.
[root@hci-inf-d-slt03 ~]# salt -G "environment:sandbox" grains.get environment
hci-inf-z-snd240:
sandbox
hci-inf-z-snd241:
sandbox
hci-inf-z-snd239:
sandbox
hci-inf-z-snd246:
sandbox
hci-inf-z-snd234:
sandbox
hci-inf-z-snd201:
sandbox
hci-inf-z-snd233:
sandbox
hci-inf-z-snd235:
sandbox
hci-inf-z-snd249:
sandbox
Here is another example of trying to target a built-in grain.
[root@hci-inf-d-slt03 ~]# salt \* grains.get saltversion
hci-inf-d-slt03:
3002.5
hci-inf-z-snd240:
3002.5
hci-inf-z-snd241:
3002.5
hci-inf-z-snd239:
3000.3
hci-inf-z-snd246:
3001
hci-inf-z-snd201:
3001
hci-inf-z-snd233:
3002.5
hci-inf-z-snd249:
3002.5
hci-inf-z-snd235:
3001
hci-inf-z-snd234:
3002.5
[root@hci-inf-d-slt03 ~]# salt -G "saltversion:3001" test.ping
hci-inf-z-snd201:
True
hci-inf-z-snd246:
True
hci-inf-z-snd235:
True
[root@hci-inf-d-slt03 ~]# salt -G "saltversion:3002.5" test.ping
No minions matched the target. No command was sent, no jid was assigned.
ERROR: No return received
[root@hci-inf-d-slt03 ~]# salt -G "saltversion:3000.3" test.ping
hci-inf-z-snd239:
True
Running more test. We upgraded all the Oracle Linux 7 machines. As long as one of the minions is at a lower version, you are able to target all minions with built-in grains.
[root@hci-inf-d-slt03 ~]# salt -C "G@osmajorrelease:7" test.version
hci-inf-z-snd239:
3002.5
hci-inf-z-snd201:
3002.5
hci-inf-z-snd234:
3002.5
hci-inf-z-snd246:
3002.5
hci-inf-z-snd249:
3002.5
hci-inf-z-snd235:
3001
We then upgraded hci-inf-z-snd235 to 3002.5. Now we cannot target the Oracle Linux 7 machines by built-in grains.
[root@hci-inf-d-slt03 ~]# salt -C "G@osmajorrelease:7" test.version
No minions matched the target. No command was sent, no jid was assigned.
ERROR: No return received
[root@hci-inf-d-slt03 ~]# salt \* grains.get saltversion
hci-inf-d-slt03:
3002.5
hci-inf-z-snd240:
3002.5
hci-inf-z-snd233:
3002.5
hci-inf-z-snd241:
3002.5
hci-inf-z-snd246:
3002.5
hci-inf-z-snd201:
3002.5
hci-inf-z-snd234:
3002.5
hci-inf-z-snd239:
3002.5
hci-inf-z-snd249:
3002.5
hci-inf-z-snd235:
3002.5
We found the solution. (Not sure exactly what it was. 2 of us were working on it and it could have been a combination of the 2 things)
We had systemctl restart salt-master before, and it didnt help the situation.
But at near identical times, one of us:
systemctl restart salt-master
and the other
salt \* saltutil.refresh_grains
we can now query by built-in grains.
We have tried downgrading and upgrading a specific minion, but we cannot get it to fail again.
oh did you get this figured out?
It was weird. We had never had to saltutil.refresh_grains like this before. We had restarted the salt-master service many times without it helping the issue.
The "solution" was either:
salt \* saltutil.refresh_grains or
systemctl restart salt-master + salt \* saltutil.refresh_grains.