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

Error while searching through VM snapshots #3208

Closed
andrijapanicsb opened this issue Mar 11, 2019 · 2 comments · Fixed by #3257
Closed

Error while searching through VM snapshots #3208

andrijapanicsb opened this issue Mar 11, 2019 · 2 comments · Fixed by #3257

Comments

@andrijapanicsb
Copy link
Contributor

ISSUE TYPE
  • Bug Report
COMPONENT NAME
API listVMSnapshot
CLOUDSTACK VERSION
4.11.2+ (didn't test on older ones)
CONFIGURATION

No special config needed

OS / ENVIRONMENT

Not relevant

SUMMARY

Can't search through VM snapshots

STEPS TO REPRODUCE

"cmk list vmsnapshot listall=true keyword=ldap" or simply searching through VM snapshots with just a keyword typed in the search field gives errors 530 with SQL error (check below for output)

EXPECTED RESULTS
Can search successfully through VM snapshots
ACTUAL RESULTS

SQL error displayed in the GUI as following (keyword used was "ldap"):

Caught: com.mysql.jdbc.JDBC4PreparedStatement@339fb43b: SELECT vm_snapshots.id, vm_snapshots.uuid, vm_snapshots.name, vm_snapshots.display_name, vm_snapshots.description, vm_snapshots.vm_id, vm_snapshots.account_id, vm_snapshots.domain_id, vm_snapshots.service_offering_id, vm_snapshots.vm_snapshot_type, vm_snapshots.state, vm_snapshots.created, vm_snapshots.removed, vm_snapshots.current, vm_snapshots.parent, vm_snapshots.updated, vm_snapshots.update_count FROM vm_snapshots INNER JOIN account ON vm_snapshots.account_id=account.id WHERE vm_snapshots.state IN ('Ready','Creating','Allocated','Error','Expunging','Reverting') AND (vm_snapshots.name LIKE _binary'%ldap%' OR OR vm_snapshots.description LIKE ** NOT SPECIFIED ** ) AND vm_snapshots.removed IS NULL AND (account.type != ** NOT SPECIFIED ** ) ORDER BY vm_snapshots.created DESC LIMIT 0, 20

shwstppr added a commit to shapeblue/cloudstack that referenced this issue Apr 3, 2019
Using db column instead of VO variable name was causing issue with SQL select statement.
This change fixes the problem by using VO variable for adding conditional.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
shwstppr added a commit to shapeblue/cloudstack that referenced this issue Apr 3, 2019
)

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor

shwstppr commented Apr 3, 2019

Additionally, per documentation, no parameter is REQUIRED, all are optional, which seems to not be the case.

@andrijapanic Not able get the above part, rest should be fixed with my PR #3257

@andrijapanicsb
Copy link
Contributor Author

Ignore that, my bad!

rohityadavcloud pushed a commit that referenced this issue Apr 8, 2019
Using db column instead of VO variable name was causing issue with SQL select statement.
This change fixes the problem by using VO variable for adding conditional.

Fixes #3208

Using db column instead of VO variable name was causing issue with SQL select statement.
This PR fixes the problem by using VO variable for adding conditional.
Additionally in UI listAll parameter was being sent twice in the listVMSnapshot API call. It is fixed with this PR.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
pbankonier pushed a commit to pbankonier/cloudstack that referenced this issue Apr 24, 2019
Using db column instead of VO variable name was causing issue with SQL select statement.
This change fixes the problem by using VO variable for adding conditional.

Fixes apache#3208

Using db column instead of VO variable name was causing issue with SQL select statement.
This PR fixes the problem by using VO variable for adding conditional.
Additionally in UI listAll parameter was being sent twice in the listVMSnapshot API call. It is fixed with this PR.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants