Bug 29076

Summary: cleanup_database.pl dies of passed zebraqueue and not confirm
Product: Koha Reporter: Nick Clemens <nick>
Component: Command-line UtilitiesAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: fridolin.somers, kyle, m.de.rooy, martin.renvoize, tomascohen, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11
Bug Depends on: 24153    
Bug Blocks:    
Attachments: Bug 29076: Fetch the zebraqueue entries when not confirm
Bug 29076: Fetch the zebraqueue entries when not confirm
Bug 29076: Fetch the zebraqueue entries when not confirm

Description Nick Clemens 2021-09-22 12:02:35 UTC
To recreate:
perl  misc/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites --z3950 --logs 180 --mail 375
Confirm flag not passed, running in dry-run mode...
{UNKNOWN}: DBI Exception: DBD::mysql::st fetchrow_hashref failed: fetch() without execute()  at /usr/share/perl5/DBIx/Class/Schema.pm line 1118.
	DBIx::Class::Schema::throw_exception(Koha::Schema=HASH(0x55c5ab09aff0), "DBI Exception: DBD::mysql::st fetchrow_hashref failed: fetch("...) called at /usr/share/perl5/DBIx/Class/Storage.pm line 113
	DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::mysql=HASH(0x55c5b27dc0c8), "DBI Exception: DBD::mysql::st fetchrow_hashref failed: fetch("...) called at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1501
	DBIx::Class::Storage::DBI::__ANON__("DBD::mysql::st fetchrow_hashref failed: fetch() without execu"..., DBI::st=HASH(0x55c5b494d6f8), undef) called at misc/cronjobs/cleanup_database.pl line 290
Comment 1 Nick Clemens 2021-09-22 12:05:05 UTC
Created attachment 125130 [details] [review]
Bug 29076: Fetch the zebraqueue entries when not confirm

This patch remove a check for confirm when fetching the entries
for possible deletion from the zebraqueue

Without this we die when we try to access the entries for counting

To test:
1 - perl  misc/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites --z3950 --logs 180 --mail 375 -v
2 - Dies
3 - Apply patch
4 - Repeat 1
5 - Success!
Comment 2 Tomás Cohen Arazi 2021-09-22 12:08:13 UTC
Created attachment 125131 [details] [review]
Bug 29076: Fetch the zebraqueue entries when not confirm

This patch remove a check for confirm when fetching the entries
for possible deletion from the zebraqueue

Without this we die when we try to access the entries for counting

To test:
1 - perl  misc/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites --z3950 --logs 180 --mail 375 -v
2 - Dies
3 - Apply patch
4 - Repeat 1
5 - Success!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Marcel de Rooy 2021-09-22 14:46:13 UTC
Created attachment 125134 [details] [review]
Bug 29076: Fetch the zebraqueue entries when not confirm

This patch remove a check for confirm when fetching the entries
for possible deletion from the zebraqueue

Without this we die when we try to access the entries for counting

To test:
1 - perl  misc/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites --z3950 --logs 180 --mail 375 -v
2 - Dies
3 - Apply patch
4 - Repeat 1
5 - Success!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Jonathan Druart 2021-09-28 13:40:11 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall 2021-10-08 10:49:29 UTC
Pushed to 21.05.x for 21.05.05
Comment 6 Fridolin Somers 2021-10-09 02:18:59 UTC
Pushed to 20.11.x for 20.11.11
Comment 7 Victor Grousset/tuxayo 2021-10-17 01:14:48 UTC
Missing dependencies for 20.05.x, it shouldn't be affected, no backport.