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

fix: handle custom node errors on startup, clear session queue via migration #6100

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

psychedelicious
Copy link
Collaborator

Summary

  • Custom node import errors could crash the app on startup. For example, if a custom node isn't updated for v4.0.0, it might try to import an nonexistent class from the invokeai python package. These errors are how handled gracefully - an error message is printed to the python terminal and the app startups up normally.

    image

  • Empty the session queue during data migration. This prevents pydantic errors from spamming the terminal on startup, if the queue items are no longer valid. This can occur if we change any pydantic schemas from SessionQueueItem and on downward.

Related Issues / Discussions

Discord thread: https://discord.com/channels/1020123559063990373/1020123559831539744/1224527169753976956

(thanks for raising @empessah)

QA Instructions

Node error:

Session Queue:

  • Load up a v3.7.0 db
  • Queue up some stuff
  • Kill the app before the queue is empty
  • Change to v4, start app, expect constant errors in terminal
  • Check out he PR, start the app, no errors in terminal and your queue should be empty

Merge Plan

The release notes should include a blurb about the queue being cleared on first run. Probably a good idea to do this for every release.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable) n/a
  • Documentation added / updated (if applicable) n/a

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations services PRs that change app services labels Apr 2, 2024
@psychedelicious psychedelicious changed the title fix: v4.0.0 followups fix: handle custom node errors on startup, clear session queue via migration Apr 2, 2024
@psychedelicious psychedelicious enabled auto-merge (rebase) April 2, 2024 02:15
Previously, exceptions raised as custom nodes are initialized were fatal errors, causing the app to exit.

With this change, any error on import is caught and the error message printed. App continues to start up without the node.

For example, a custom node that isn't updated for v4.0.0 may raise an error on import if it is attempting to import things that no longer exist.
Empties the session queue. This is done to prevent any lingering session queue items from causing pydantic errors due to changed schemas.
@psychedelicious psychedelicious merged commit f75de8a into main Apr 2, 2024
14 checks passed
@psychedelicious psychedelicious deleted the psyche/fix/v4-followups branch April 2, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invocations PRs that change invocations python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants