PQL regexp character is unrecognized #21
-
Does anyone else have problems with PQL queries with regular expressions in them? I am getting this error whenever i try to use the tilde
which is thrown here: caused by the module |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments
-
But it works for other pql queries? The expr code shouldn’t even be hit at this point as it’s not a expr query. So there is probsbly some logic error. Can you show the command you run to cause this pls? |
Beta Was this translation helpful? Give feedback.
-
Disclaimer: This might not be the exact same query as in the initial post, but still the same problem/error. This command works fine and gets me results:
while this command with the same query fails with the error mentioned above:
|
Beta Was this translation helpful? Give feedback.
-
Really weird, I cannot reproduce this at all. I saw another issue that prevents this from working - but what you are seeing really no idea how that error from compound even happened. |
Beta Was this translation helpful? Give feedback.
-
There has to be a different query handling on The second best solution would be to get |
Beta Was this translation helpful? Give feedback.
-
If you can, patch this:
Should be in I bet that fixes it? |
Beta Was this translation helpful? Give feedback.
-
The PQL query should never get anywhere near exprvar, I have no idea how that code path is followed. Expr cannot parse pql queries and PQL queries arent compound, so there's a major bug somewhere but I cant trigger that code path on my side |
Beta Was this translation helpful? Give feedback.
-
That fixes it! Can you release this patch? (I am using choria-mcorpc-support-2.25.2 btw. so a little newer than you, could help with the reproducing.) I have a really special talent for finding bugs in open source software i just want to use... Happens to me way too often. :D |
Beta Was this translation helpful? Give feedback.
-
haha yeah this bug has been there for like a decade :) the combination of PQL filters, batch mode (that the tasks agent use internally) triggers it. I really dont think anyone uses PQL queries in this sense really, seemed like a good idea at the time but dont think the UX really work. |
Beta Was this translation helpful? Give feedback.
-
I suspect I will do a release only next month though, I could do the gem only unannounced I guess if you are desperate |
Beta Was this translation helpful? Give feedback.
-
I can get along with PQL, but just out of curiosity: How would the above filter look like when you would write it? I am always desperate the moment i open a github issue/discussion 😆 |
Beta Was this translation helpful? Give feedback.
-
I can get close:
Unfortunately the
works exactly for me and this is searching insie a array |
Beta Was this translation helpful? Give feedback.
-
I believe that would be a useful feature. I certainly would love to have it. I took your second command and changed it to match my original purpose and it works like a charm. It selects the same hosts as my long PQL.
As always, thank you for your amazing help and work! ❤️ |
Beta Was this translation helpful? Give feedback.
-
nice, certainly a lot nicer than PQL :) I will look to ship that gem tomorrow for you |
Beta Was this translation helpful? Give feedback.
-
this does a regex match on all items in the array |
Beta Was this translation helpful? Give feedback.
-
Works like a charm! Thank you very much! |
Beta Was this translation helpful? Give feedback.
-
https://rubygems.org/gems/choria-mcorpc-support/versions/2.25.3 |
Beta Was this translation helpful? Give feedback.
If you can, patch this:
Should be in
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/choria-mcorpc-support-2.25.1/lib/mcollective/rpc/client.rb
I bet that fixes it?