Skip to content

Fixed the error "cannot pickle sqlite3.Cursor"#11500

Merged
micheles merged 2 commits into
masterfrom
safelog
May 29, 2026
Merged

Fixed the error "cannot pickle sqlite3.Cursor"#11500
micheles merged 2 commits into
masterfrom
safelog

Conversation

@micheles
Copy link
Copy Markdown
Contributor

It happened only with cache=true in the lines

                logging.info(f"Already calculated, {old_job_id=}")
                self.datastore = datastore.read(old_job_id)
                logs.dbcmd(
                    "UPDATE job SET ds_calc_dir = ?x WHERE id=?x",
                    self.datastore.filename[:-5], calc_id)  # strip .hdf5

because in presence of a DbServer the update query returns a sqlite3.Cursor object which is not pickleable.
Also, if the database is locked, just don't log; we do not want to break the calculation in DbServer mode (we still want to break it with a local db since errors should never pass silently).

@micheles micheles added this to the Engine 3.26.0 milestone May 29, 2026
@micheles micheles requested a review from ptormene May 29, 2026 01:08
@micheles micheles merged commit d86f19f into master May 29, 2026
4 checks passed
@micheles micheles deleted the safelog branch May 29, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant