InvokeAI/invokeai/app/services
psychedelicious 4b334be7d0 feat(nodes,ui): fix soft locks on session/invocation retrieval
When a queue item is popped for processing, we need to retrieve its session from the DB. Pydantic serializes the graph at this stage.

It's possible for a graph to have been made invalid during the graph preparation stage (e.g. an ancestor node executes, and its output is not valid for its successor node's input field).

When this occurs, the session in the DB will fail validation, but we don't have a chance to find out until it is retrieved and parsed by pydantic.

This logic was previously not wrapped in any exception handling.

Just after retrieving a session, we retrieve the specific invocation to execute from the session. It's possible that this could also have some sort of error, though it should be impossible for it to be a pydantic validation error (that would have been caught during session validation). There was also no exception handling here.

When either of these processes fail, the processor gets soft-locked because the processor's cleanup logic is never run. (I didn't dig deeper into exactly what cleanup is not happening, because the fix is to just handle the exceptions.)

This PR adds exception handling to both the session retrieval and node retrieval and events for each: `session_retrieval_error` and `invocation_retrieval_error`.

These events are caught and displayed in the UI as toasts, along with the type of the python exception (e.g. `Validation Error`). The events are also logged to the browser console.
2023-07-23 21:41:01 +10:00
..
models feat(db,nodes,api): refactor metadata 2023-07-13 15:40:05 +10:00
__init__.py all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00
board_image_record_storage.py feat(ui): another go at gallery (#3791) 2023-07-19 12:06:38 -04:00
board_images.py feat(ui): another go at gallery (#3791) 2023-07-19 12:06:38 -04:00
board_record_storage.py feat(db): add get_all() method for boards 2023-06-22 16:25:49 +10:00
boards.py feat(db): add get_all() method for boards 2023-06-22 16:25:49 +10:00
config.py prettify startup messages 2023-07-20 22:45:35 -04:00
default_graphs.py feat(nodes): default to CPU noise 2023-06-27 13:57:31 +10:00
events.py feat(nodes,ui): fix soft locks on session/invocation retrieval 2023-07-23 21:41:01 +10:00
graph.py Union[foo, None]=>Optional[foo] 2023-07-03 12:17:45 -04:00
image_file_storage.py feat(app): embed PNG info in invokeai_metadata and invokeai_graph 2023-07-13 15:40:05 +10:00
image_record_storage.py ui: enhance intermediates clear, enhance board auto-add (#3851) 2023-07-20 17:44:22 +12:00
images.py feat(api,db): allow creating an image with a board_id 2023-07-21 07:26:12 -04:00
invocation_queue.py Union[foo, None]=>Optional[foo] 2023-07-03 12:17:45 -04:00
invocation_services.py fix(nodes): fix typing of configuration service 2023-07-16 10:52:18 +10:00
invoker.py Union[foo, None]=>Optional[foo] 2023-07-03 12:17:45 -04:00
item_storage.py feat(db,nodes,api): refactor metadata 2023-07-13 15:40:05 +10:00
latent_storage.py Union[foo, None]=>Optional[foo] 2023-07-03 12:17:45 -04:00
model_manager_service.py prettify startup messages 2023-07-20 22:45:35 -04:00
processor.py feat(nodes,ui): fix soft locks on session/invocation retrieval 2023-07-23 21:41:01 +10:00
resource_name.py feat(nodes): add nameservice 2023-05-28 20:19:56 -04:00
sqlite.py feat(db,nodes,api): refactor metadata 2023-07-13 15:40:05 +10:00
urls.py feat(db,nodes,api): refactor metadata 2023-07-13 15:40:05 +10:00