Electron100 / butane

An ORM for Rust with a focus on simplicity and on writing Rust, not SQL
Apache License 2.0
101 stars 13 forks source link

CI failure in rollback of newtype migrations #256

Closed jayvdb closed 7 months ago

jayvdb commented 7 months ago

https://github.com/Electron100/butane/pull/250 passed, but then failed on main twice with

---- migrate_and_rollback_pg stdout ----
Rolled back 20240406_035726416_tags
thread 'migrate_and_rollback_pg' panicked at examples/newtype/tests/rollback.rs:46:60:
called `Result::unwrap_err()` on an `Ok` value: ()
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result<T,E>::unwrap_err
   4: rollback::migrate_and_rollback
   5: rollback::migrate_and_rollback_pg
   6: rollback::migrate_and_rollback_pg::{{closure}}
   7: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

i.e. the rollback was successful. Locally it passes; i.e. the rollback is unsuccessful , every time.

And on the latest push for PR #252 , it has now failed 5 times in a row on linux. https://github.com/Electron100/butane/actions/runs/8766992655?pr=252

Luckily, since it is always unsuccessful for me, I can investigate it. Will do later today.

jayvdb commented 7 months ago

Locally I now see

---- migrate_and_rollback_pg stdout ----
thread 'migrate_and_rollback_pg' panicked at examples/newtype/tests/rollback.rs:40:43:
called `Result::unwrap()` on an `Err` value: Postgres(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E2BP01), message: "cannot drop table blog because other objects depend on it", detail: Some("constraint post_blog_fkey on table post depends on table blog"), hint: Some("Use DROP ... CASCADE to drop the dependent objects too."), position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("dependency.c"), line: Some(1197), routine: Some("reportDependentObjects") }) })