The problem seems to be produced by a double SELECT:
- get_next_task() execute a SELECT which is valid and returns a valid ROW
- Then get_next_task() creates an instance from PackageTask, which executes a second SELECT to bring some fields from the database.
I must mention that get_next_task() is inside a transaction by the @with_cursor decorator, which shouldn't fail.
This solution optimizes the number of queries sent to the database and prevents this exception from happening.
The problem seems to be produced by a double SELECT:
- get_next_task() execute a SELECT which is valid and returns a valid ROW
- Then get_next_task() creates an instance from PackageTask, which executes a second SELECT to bring some fields from the database.
I must mention that get_next_task() is inside a transaction by the @with_cursor decorator, which shouldn't fail.
This solution optimizes the number of queries sent to the database and prevents this exception from happening.
A PR that removed the unnecessary SELECT has been proposed: /github. com/CanonicalLt d/landscape- client/ pull/146
https:/