Bug 29076 - cleanup_database.pl dies of passed zebraqueue and not confirm
Summary: cleanup_database.pl dies of passed zebraqueue and not confirm
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 24153
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-22 12:02 UTC by Nick Clemens
Modified: 2021-10-17 01:14 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11


Attachments
Bug 29076: Fetch the zebraqueue entries when not confirm (1.29 KB, patch)
2021-09-22 12:05 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29076: Fetch the zebraqueue entries when not confirm (1.35 KB, patch)
2021-09-22 12:08 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29076: Fetch the zebraqueue entries when not confirm (1.44 KB, patch)
2021-09-22 14:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.