| Summary: | No such thing as Koha::Exceptions::Exception | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Magnus Enger <magnus> |
| Component: | Architecture, internals, and plumbing | Assignee: | Marcel de Rooy <m.de.rooy> |
| Status: | RESOLVED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
| Severity: | major | ||
| Priority: | P5 - low | CC: | fridolin.somers, lucas, m.de.rooy, wainuiwitikapark |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
24.05.00,23.11.03,23.05.09
|
|
| Circulation function: | |||
| Bug Depends on: | |||
| Bug Blocks: | 35962 | ||
| Attachments: |
Bug 35843: Correct invalid exception
Bug 35843: Correct invalid exception Bug 35843: Correct invalid exception |
||
Looks like the code was changed from
Koha::Exception->throw('Job has not been enqueued');
to
Koha::Exceptions::Exception->throw('Job has not been enqueued');
by bug 30172: https://git.koha-community.org/Koha-community/Koha/commit/7585db29c08078d2b85faf27d110c4598e03881d
Looks like there was Koha::Exceptions::Exception, but it was changed to Koha::Exception by bug 29857. Created attachment 161177 [details] [review] Bug 35843: Correct invalid exception Test plan: Run background job tests. Especially the changed one. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 161181 [details] [review] Bug 35843: Correct invalid exception Test plan: Run background job tests. Especially the changed one. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Magnus Enger <magnus@libriotech.no> All test pass when running this: prove t/db_dependent/Koha/BackgroundJobs* Created attachment 161311 [details] [review] Bug 35843: Correct invalid exception Test plan: Run background job tests. Especially the changed one. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Magnus Enger <magnus@libriotech.no> All test pass when running this: prove t/db_dependent/Koha/BackgroundJobs* Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Pushed for 24.05! Well done everyone, thank you! Pushed to 23.11.x for 23.11.03 Backported to 23.05.x for upcoming 23.05.09 Not backporting to 22.11 unless requested |
On Koha 22.11.04-1 installed with the Debian packages I have some background jobs that are failing, and I see this in the logs: ==> /var/log/koha/mykoha/plack-intranet-error.log <== [2024/01/19 08:47:02] [WARN] The job has not been sent to the message broker: (Can't locate object method "throw" via package "Koha::Exceptions::Exception" (perhaps you forgot to load "Koha::Exceptions::Exception"?) at /usr/share/koha/lib/Koha/BackgroundJob.pm line 141. ) at /usr/share/koha/lib/Koha/BackgroundJob.pm line 148. The relevant code looks like this: 134 try { 135 # This namespace is wrong, it must be a vhost instead. 136 # But to do so it needs to be created on the server => much more work when a new Koha instance is created. 137 # Also, here we just want the Koha instance's name, but it's not in the config... 138 # Picking a random id (memcached_namespace) from the config 139 my $namespace = C4::Context->config('memcached_namespace'); 140 my $encoded_args = Encode::encode_utf8( $json_args ); # FIXME We should better leave this to Net::Stomp? 141 $conn->send_with_receipt( { destination => sprintf("/queue/%s-%s", $namespace, $job_queue), body => $encoded_args } ) 142 or Koha::Exceptions::Exception->throw('Job has not been enqueued'); 143 } catch { 144 $self->status('failed')->store; 145 if ( ref($_) eq 'Koha::Exceptions::Exception' ) { 146 $_->rethrow; 147 } else { 148 warn sprintf "The job has not been sent to the message broker: (%s)", $_; 149 } 150 }; This code is the only place Koha::Exceptions::Exception is mentioned in the code: $ sudo grep -rn "Koha::Exceptions::Exception" /usr/share/koha/ /usr/share/koha/lib/Koha/BackgroundJob.pm:142: or Koha::Exceptions::Exception->throw('Job has not been enqueued'); /usr/share/koha/lib/Koha/BackgroundJob.pm:145: if ( ref($_) eq 'Koha::Exceptions::Exception' ) {