If a title or other piece of metadata that needs to be included in the XML POSTed to the DataCite API contains non-standard characters it causes the event queue task to fail. This looks to be an encoding issue. This can seemingly be fixed by adding the following line to the datacite_request method of lib/plugins/EPrints/Plugin/Event/DataCiteEvent.pm before the HTTP::Request:
utf8::encode($content) if $content =~ /[^\x00-\xFF]/;
The text was updated successfully, but these errors were encountered:
I encountered the same issue, the error message (in indexer.log) was:
Event::DataCiteEvent::datacite_doi: Error during execution: HTTP::Message content must be bytes at /opt/eprints3/lib/plugins/EPrints/Plugin/Event/DataCiteEvent.pm line 83
For me, line 83 is: my $req = HTTP::Request->new(
I added line suggested by drn05r, and it solved the problem.
I had to remember to restart the indexer before the change took effect.
To reproduce the issue, use this as the eprint title: "Émerger des décombres… Œuvres et poèmes retrouvés : créations d’art-thérapie"
Encoding of the content was added in ec11dca; the headers are hard coded in the calling function so are safe (for now).
Given that, I'm resolving this issue as complete.
If a title or other piece of metadata that needs to be included in the XML POSTed to the DataCite API contains non-standard characters it causes the event queue task to fail. This looks to be an encoding issue. This can seemingly be fixed by adding the following line to the datacite_request method of lib/plugins/EPrints/Plugin/Event/DataCiteEvent.pm before the HTTP::Request:
utf8::encode($content) if $content =~ /[^\x00-\xFF]/;
The text was updated successfully, but these errors were encountered: