[Koha-bugs] [Bug 31351] New: Worker dies on reindex job when operator last name/first name/branch name contains non-ASCII chars

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 12 16:29:42 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31351

            Bug ID: 31351
           Summary: Worker dies on reindex job when operator last
                    name/first name/branch name contains non-ASCII chars
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: ASSIGNED
          Severity: major
          Priority: P5 - low
         Component: Searching
          Assignee: stalkernoid at gmail.com
          Reporter: stalkernoid at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: nugged at gmail.com

"malformed UTF-8 character in JSON string, at character offset 38 (before
"\x{fffd}"register_id...") at /home/vagrant/kohaclone/Koha/BackgroundJob.pm
line 170."

Steps to reproduce:
1. Go to your user settings and change your current logged user's name/surname
so it contains non-ASCII characters, for example, "รค" (U+00E4).
2. Log out and log back in with the same user so the session will be refreshed
with updated info.
3. Open any biblio record in marc-record edit mode and save it back: just to
initiate ElasticSearch background reindex job creation. 
4. Open background jobs admin page, and you will see there "Update
Elasticsearch index" job that is in the status "New". Normal behaviour for it
is to already get to "Finished" status, as this job is simple and going to be
completed quickly, but it's going to remain in "New" status and never get to
the "Finished" state. That's why:
5. Stop Koha-worker from the root user: `koha-worker --stop
%YOUR_KOHA_INSTANCE%` (%YOUR_KOHA_INSTANCE% is your Koha instance name, for ex.
'kohadev'), and stop RabbitMQ service inside the machine from root: `service
rabbitmq-server stop`, then if you run misc/background_jobs_worker.pl inside of
your koha machine from under koha user, that script won't be able to connect to
RabbitMQ (it warns about this) so it will process tasks one-by-one itself in
"no-server-available" mode, and thus you will be able to find the problem, why
background job task remains "New": you will see the "malformed UTF-8 character
in JSON string" error.
6. Apply the patch.
7. Run background_jobs_worker.pl script again, ensure that after it warns about
"Connection refused" to RabbitMQ server, it processes all "New" tasks again
like in step 5, but the "malformed UTF-8 character in JSON string" error is
gone and if you check background jobs admin page, the status of that same job
is now "Finished". This means since now the bug is solved, so:
8. Start RabbitMQ service inside the machine from root: `service
rabbitmq-server start`. Start Koha-worker from the root user: `koha-worker
--start %YOUR_KOHA_INSTANCE%`.
8. Repeat from step 3: edit biblio and save the record again, to create another
background job.
9. Check the background job page and see that the new job now has "Finished"
status, so the patch works.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list