Skip to content

Cell 5 Register: a failed folder re-check shows "confirm the axes again", then every press crashes silently (AttributeError) #580

Backlog

Description

@guijacquemet

Found while diagnosing the owner's Stable 1 report on v0.9.0 (669a1f9, notebook pin 338629c, same src): in MorphoBricks_Preprocessing_Cellpose, cell 5 Register the masks "shows nothing and lags", and the run folder was left with no [masks.*] in morphobricks.toml and no mask_relationships.json.

What a press of Register does (notebook_mask_register.MaskRegistration.register)

  1. refusal() → open_run (reads every image whole for its SHA-256).
  2. Unless the app's last check already saw the new mask type: app.check_folder() with the masks folder. This clears the app's run (app.result = None) and its confirmed axes.
  3. app.confirmed_mapping is None → stop with AXES_AGAIN (always after step 2). The user confirms the axes in cell 3 and presses Register again.
  4. Second press: answer each mask on Masks, save_experiment() (writes [masks.Cells]), run() (republishes), Describe the masks (writes mask_relationships.json).

Nothing is written to the run folder until press 2 succeeds. Cell 5 shows nothing while a press works: all progress is drawn in cell 3 (covered by draft #578).

Defect (reproduced headlessly with the repo's Cellpose stub)

If the folder check of step 2 fails (any OSError, e.g. Google Drive not answering, or a coded refusal), check_folder returns None and sets app.preflight = None, with the reason drawn only in cell 3's step Images. Then:

  • cell 5 shows AXES_AGAIN ("confirm the axes again"). That is wrong: there is no check to confirm.
  • every later press raises AttributeError: 'NoneType' object has no attribute 'discovery' from _app_run (app.preflight.discovery.root) out of the button's click handler. Cell 5's status still shows the old axes line, so the press appears to do nothing.
  • running cell 5 again raises the same AttributeError while the widget is built.

An unexpected exception (not OSError or a coded refusal) inside a press is re-raised by check_folder out of the click handler too, and cell 5's status stays empty.

The run folder is unchanged in all of these cases (no partial writes). The user is left exactly where the owner was: a finished run with no masks.

Reproduction: monkeypatch notebook_folder.preflight to raise OSError during the press. Press 1 shows the axes line. Press 2 and a cell 5 re-run raise AttributeError. The run folder holds the same 8 files as before.

Fix

Draft PR to follow: show CHECK_FAILED with cell 3's reason, refuse cleanly on later presses until cell 3's check is made again, and show any unexpected error in cell 5 (STOPPED, still raised). It has regression tests. Nothing checked, declared or written changes.

Related: #574, #578 (cell 5 progress/busy, which also covers "shows nothing"), #579.

Activity

  1. added a commit that references this issue on Nov 26, 2026
    1968364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions