[Bug 27245] New: bulkmarcimport.pl error 'Already in a transaction'
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Bug ID: 27245 Summary: bulkmarcimport.pl error 'Already in a transaction' Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz When using script to import records misc/migration_tools/bulkmarcimport.pl, I get the error : .DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1. I thinks it is because of transaction in the script : $dbh->{AutoCommit} = 0; And C4::Biblio::AddBiblio launches a transation : $schema->txn_do(sub { Records are imported well but its a scary error :/ -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26518 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Looks like it is since Bug 26518 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26518 [Bug 26518] Adding a record can succeed even if adding the biblioitem fails -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Bug 27245 depends on bug 26518, which changed state. Bug 26518 Summary: Adding a record can succeed even if adding the biblioitem fails https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26518 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 114521 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114521&action=edit Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl To prevent DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1. Test plan: Export more than 100 records Use bulkmarcimport (with -commit=10) to import them Modify a record to make the import fail (for instance having a too long lccn) Use bulkmarcimport (with -commit=10) to import them Notice that the import stops but that the imported record are imported (a part from the last batch of 10) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #3 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Without the patch I'm getting «Already in a transaction» even with a (supposedly) valid MARCXML file with 120 records. I just exported the first 120 records of the sample data in XML. With the patch, with valid or invalid data, it's just importing one record: kohadev-koha@kohadevbox:/kohadevbox/koha$ misc/migration_tools/bulkmarcimport.pl -commit 10 -file 120-records.xml . 1 MARC records done in 0.0640840530395508 seconds kohadev-koha@kohadevbox:/kohadevbox/koha$ misc/migration_tools/bulkmarcimport.pl -commit 10 -file 120-records-one-invalid.xml . 1 MARC records done in 0.0556449890136719 seconds Maybe I'm missing a param from bulkmarcimport.pl? (-b doesn't help) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 --- Comment #4 from Fridolin Somers <fridolin.somers@biblibre.com> --- For me its ok, works as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114521|0 |1 is obsolete| | --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 114750 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114750&action=edit Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl To prevent DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1. Test plan: Export more than 100 records Use bulkmarcimport (with -commit=10) to import them Modify a record to make the import fail (for instance having a too long lccn) Use bulkmarcimport (with -commit=10) to import them Notice that the import stops but that the imported record are imported (a part from the last batch of 10) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 --- Comment #6 from Victor Grousset/tuxayo <victor@tuxayo.net> --- @Fridolin how did you use bulkmarcimport.pl ? And how did you get the records? So I can test with then to check if my records were wrong. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114750|0 |1 is obsolete| | --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 114958 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114958&action=edit Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl To prevent DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1. Test plan: 1 - Export more than 100 records 2 - Use bulkmarcimport (with -commit=10) to import them perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10 3 - Modify a record to make the import fail (for instance having a too long lccn) 4 - Use bulkmarcimport (with -commit=10) to import them perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10 5 - Notice that the import stops but that the imported record are imported (apart from the last batch of 10) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable Version(s)|21.05.00 |21.05.00,20.11.02,20.05.08 released in| | --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00,20.11.02,20.05.08 |21.05.00,20.11.02,20.05.08, released in| |19.11.14 Status|Pushed to oldstable |Pushed to oldoldstable --- Comment #11 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 19.11.x branch for 19.11.14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27245 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29325 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org