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

search with two 'conditional' yields no record #290

Open
jokdbx opened this issue Oct 15, 2018 · 6 comments
Open

search with two 'conditional' yields no record #290

jokdbx opened this issue Oct 15, 2018 · 6 comments
Labels

Comments

@jokdbx
Copy link
Contributor

jokdbx commented Oct 15, 2018

i am trying to setup a search in sal for a custom condition we have defined, and for os_version_minor to a specific version. It looks like if i use a fact and a condition in my search, things are found, but if i use two stacked conditions, it doesn't yield any results.

first block:
 searchitem: Condition
 searchfield: kextcount
 operator: <
 searchterm: 7
second block:
 and/or: AND
 searchitem: Condition
 searchfield: os_vers_minor
 operator: =
 searchterm: 13
@grahamgilbert
Copy link
Member

@grahamgilbert
Copy link
Member

Who wants this one? I’m about to go on paternity so I’m not going to get to start it. @jokdbx do you want to attempt this?

@jokdbx
Copy link
Contributor Author

jokdbx commented Oct 16, 2018

I will try to look at it...

@pptrvv670
Copy link

I'm interested in getting this issue fixed. I do scripting, but not really programming. Looking at the code pointed out by Graham looks like something I might be able to figure out. I'd at least like to try. A few questions to help me get started.

  1. Is it precisely line 108 that is the issue? Or is the issue likely to be on that page?
  2. It's been quite some time since that issue was reported on. Is the error still likely on this page?

What is the best way to troubleshoot this? I have SAL running in Docker and I created a pgadmin Docker instance so I can look at the database.

I figured the first thing I'd want to do is look at the SQL Query that gets submitted for a search with multiple Conditions to see if the SQL Query is right and the output is wrong, or if the SQL Query is wrong to begin with.

How would I do that? What tools would I need, and would they need to be installed in Docker or on a local machine. I have SAL running in Docker on a Linux Virtual Machine. Docker is not running on my Linux workstation.

I'd really like to understand how to diagnose programs rather than individual scripts in hopes of being able to contribute.

Thanks for the great program.

@grahamgilbert
Copy link
Member

It’s roughly around that area as my best guess. The dev setup is documented at https://github.com/salopensource/sal/wiki/Developer-Installation

@pptrvv670
Copy link

I followed the directions and got SAL setup along with a client to report in. However, there is a problem with the installation. When you go to create a search, everything looks normal until you change 'Search Item' from 'Machine', then nothing is populated in 'Search Field'. If you reselect 'Machine', the 'Search Field' remains empty. The 'search_searchfieldcache' table is empty. This is after a munki and SAL run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants