[EP-tech] Coversheet Plugin Help

John Salter J.Salter at leeds.ac.uk
Wed Oct 6 22:24:50 BST 2021


CAUTION: This e-mail originated outside the University of Southampton.
I've had a quick look on my server, and I may have also banged my head against this at some point.

Try adding the '$c->{executables}->{openoffice}…' line to the following places (one at a time - test, then try the next one):
~/lib/cfg.d/zzz_openoffice_test.pl
~/lib/syscfg.d/zzz_openoffice_test.pl
~/archives/ARCHIVEID/cfg/cfg.d/zzz_openoffice_test.pl

Do any of them change the behaviour?

I think I managed to get it working with the ~/lib/cfg.d/ one - but I wasn't 100% sure why…
I've also got the change David suggests in that file:-
$c->{executables}->{uno_converter} = "$c->{archiveroot}/bin/DocumentConverter.py";

Hope this gets another step along the way!
Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of David R Newman via Eprints-tech
Sent: 06 October 2021 20:24
To: James Kerwin <jkerwin2101 at gmail.com>; John Salter <J.Salter at leeds.ac.uk>
Cc: eprints-tech at ecs.soton.ac.uk
Subject: Re: [EP-tech] Coversheet Plugin Help


Hi James,

This is very odd.  You are basically saying I print out the variable $oo_cmd and then a few lines later the unless statement causes a return with undef as the "defined $oo_cmd" clause is not satisfied.  I would advise using "print STDERR" rather than just print as this could lead to problems.  However, not anything I can think should lead to the oddity you have reported.

Do you get past the line:

return undef if( $oo_cmd =~ /\$\([a-z]*\)/i );

As you do not have another log line.  I would assume not as the prior unless statement suggests $oo_cmd is not set somehow.

I very much suspect if I was fixing this problem, I would be banging my head against a wall for a while.  There are numerous things I would try but I think it would take forever for me to say, try A and tell me what happens and them I might suggest B or C depending on the result.  If I was doing this on my own EPrints instance if it had this issue, I could get to the end of the alphabet quite quickly but trying to do this over email, we could still be here next week and not really any further forward.  So for now my best suggestions are to switch to "print STDERR" and add another log line after the penultimate return statement.

Regards

David Newman
On 06/10/2021 19:59, James Kerwin wrote:
CAUTION: This e-mail originated outside the University of Southampton.
Right, I've done the unthinkable and edited OpenOffice.pm in plugins/EPrints/Plugin/OpenOffice.pm in order to see why I'm getting the "OpenOffice executable not found" in the openoffice.log. Using some imaginative logs and prints I've determined that something is happening in my:

sub get_command (starts around line 394). It gets through the if/else and comes out with the bits it needs. According to my print statements the relevant variables are:

$oo_path = /opt/openoffice.org3/program/soffice.bin
$oo_cmd = $(openoffice) "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -norestore -nofirststartwizard -nologo -headless

This is what I expect looking at the conf files. Then for some reason at line 412 it fails and returns undef to  "sub new" at line  131 and subsequently fails and gives my error mentioned above.

If I delete "&& defined $oo_cmd" from :

Line 412: return undef unless( defined $oo_path && defined $oo_cmd && (-e $oo_path) );

It progresses to my other log phrases I'm using to track progression (HERE One and HERE TWO):

sub get_command
{
my( $self ) = @_;

my ( $oo_path, $oo_cmd );

if( defined $self->{session} )
{
# Attempt to read the paths from a local conf file
$oo_path = $self->{session}->config( 'executables', 'openoffice' );
$oo_cmd = $self->{session}->config( 'invocation', 'openoffice' );
}
else
{
$oo_path = EPrints::Config::get( "executables" )->{"openoffice"};
$oo_cmd = EPrints::Config::get( "invocation" )->{"openoffice"};
}
#my $dog = "Bonnie";
print "\n";
print $oo_path;
print "\n";
print $oo_cmd;

$self->log( "HERE THREE" );
return undef unless( defined $oo_path && defined $oo_cmd && (-e $oo_path) );
$self->log( "HERE ONE" );
$oo_cmd =~ s/\$\(([a-z]*)\)/quotemeta($oo_path)/gei;
$self->log( "HERE TWO" );
return undef if( $oo_cmd =~ /\$\([a-z]*\)/i );

return $oo_cmd;
}
From playing around outside of EPrints I'm anticipating the end result of this subroutine is to produce something like this:

\/opt\/openoffice\.org3\/program\/soffice\.bin "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -norestore -nofirststartwizard -nologo -headless

I've struggled to work out what's happening and can only assume I'm missing something really obvious or something isn't quite doing what I think it is. Maybe something weird happens in the openoffice->invocation part of the config, although it shouldn't matter as I've copied it from both the wiki and the file in the Bazaar (this bit: $c->{invocation}->{openoffice} = '$(openoffice) "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -norestore -nofirststartwizard -nologo -headless';)

Thanks,
James




On Wed, Oct 6, 2021 at 2:25 PM John Salter <J.Salter at leeds.ac.uk<mailto:J.Salter at leeds.ac.uk>> wrote:
The 'unexpected absence' is caused by OpenOffice not running.

If you get that fixed, all should work ☺


From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>] On Behalf Of James Kerwin via Eprints-tech
Sent: 06 October 2021 13:50
To: David R Newman <drn at ecs.soton.ac.uk<mailto:drn at ecs.soton.ac.uk>>
Cc: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] Coversheet Plugin Help

CAUTION: This e-mail originated outside the University of Southampton.
Right so I checked the logs:

openoffice.log is very clear with:

OpenOffice executable not found

indexer.log says this for each attempt (with the correct Doc ID n each case):

[uolrepo] [Convert::AddCoversheet] Failed to add coversheet to document '79108'
[uolrepo] [Convert::AddCoversheet] Unexpected absence of coversheet files.
[uolrepo] [Event::AddCoversheet] Couldn't create coversheet document

I'm a little confused with the indexer.log output because the coversheet file is there in [archive_name]/cfg/static/coversheets/1/frontfile.odt and the permissions are rwx for owner, group and others (to help rule out permissions issues).

There was an email detailing a very similar problem back in 2015, but I can't see how it ended.

On Wed, Oct 6, 2021 at 12:50 PM James Kerwin <jkerwin2101 at gmail.com<mailto:jkerwin2101 at gmail.com>> wrote:
Hi David,

I accessed the Bazaar through the repository admin section (Admin -> System Tools -> EPints Bazaar and so on). It says on there that I am using V.1.0.4

One thing I've noticed just now when stopping the indexer is that I have a button saying "Stop OpenOffice". When I click this I get a red warning with "Failed to stop OpenOffice". This might be something for me to look at as I think I should probably be able to stop that if everything was working as expected.

Thanks,
James

On Wed, Oct 6, 2021 at 12:19 PM David R Newman <drn at ecs.soton.ac.uk<mailto:drn at ecs.soton.ac.uk>> wrote:

Hi James,

So we are not cross purpose, please could you tell me which version of the coversheets plugin you are using.  Is it the one that can be currently downloaded from:

https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbazaar.eprints.org%2F350%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960893153%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=2RJLe0RNdaQ5t%2B3k1%2FfD1xWYviPpMUscSB7BoQPCPB4%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbazaar.eprints.org%2F350%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7JXM0i%2BLN7bb5axsUANOvhxkM9iOW91i22XEa6RskZQ%3D&amp;reserved=0>

If not please could you tell me where it is from.  Not having the cfg/static/coversheets / directory in your local archive will be a problem.  You will also need to copy the variously numbered sub-directories from you live repository.

There does seem to be some confusion on the correct location for the stitchPDF scripts should go according to the coversheets wiki page [1].  I think $c->{archiveroot} . "/bin/tools/stitchPDFs " is the more appropriate location.  So it is probably better to move the script that change the command.  I will update the wiki page to that effect.

If you reinstate the coversheets directory as describe above, coversheets should start being applied but also I would expect an error id they were not.  The other things to sort out are making sure OpenOffice is running.  It is possible that something may still be at issue that does not cause the indexer task to fail and it "succeeds" to quickly for you to see in the event queue.  I would look in EPRINTS_PATH/var/indexer.log to see if you can see anything going on?

Regards

David Newman

[1] https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2Fw%2FCoversheets&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=swgG450mEvwCKdCLu3rz9SmgCKRKfZdmo4P9h9XgmJk%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2Fw%2FCoversheets&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=swgG450mEvwCKdCLu3rz9SmgCKRKfZdmo4P9h9XgmJk%3D&amp;reserved=0>


On 06/10/2021 12:03, James Kerwin via Eprints-tech wrote:
CAUTION: This e-mail originated outside the University of Southampton.
Hello everyone,

I hope we are all keeping well.

Can anybody help me with the coversheets plugin? I have installed it and the dependencies, uploaded a coversheet template, set it to active and deposited several items that should be suitable for a coversheet to be generated.

When I deposit an item (through Elements) to the repository it goes into the review and no coversheet tasks appear in the Indexer. I move it to the live archive and no coversheets appear. The item does not have a coversheet added to it.

Even if there is some way to troubleshoot this or logs I could look at to get a clue.

At the moment the sheet is set to be added to items of type "Thesis".

There were some things I noticed and have changed. First being the template couldn't be uploaded. There was no "coversheets" folder in cfg/static so I added one and it worked. Permissions fully open as it's on the test server and I'm narrowing down problems.

The next thing I changed was in z_coversheet.pl<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fz_coversheet.pl%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=wMpCjw0mMfOCeWe5%2BgPsRfNi3sl3Wr3Js0nwPqGbUic%3D&amp;reserved=0>:

$c->{gs_pdf_stich_cmd} = $c->{archiveroot} . "/bin/tools/stitchPDFs ";

to:

$c->{gs_pdf_stich_cmd} = $c->{archiveroot} . "/bin/stitchPDFs ";

because that matches the actual location of  stitchPDFs.

Looking in bin I can see the following aren't set to be  allowed to be executed by any user or group:

DocumentConverter.py
remove_coversheets
openoffice-local.pl<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fopenoffice-local.pl%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=9KjMZspHxZS3357GEZu94cFbRvDvF97P7cKyuctLU8s%3D&amp;reserved=0>

I will open them up and have another attempt, but if anybody has any more guidance it will be massively appreciated.

Thanks,
James


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech

*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Pd0IFe9GuJCdMRicr3nl82O2YpddzecPv90jT2DxMmw%3D&amp;reserved=0!<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Kr2Gx7oVifpOem3KNXhAxt%2B6f5JN9hgJGEmxkwvAUvo%3D&amp;reserved=0>

 .org/tech.php/<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Kr2Gx7oVifpOem3KNXhAxt%2B6f5JN9hgJGEmxkwvAUvo%3D&amp;reserved=0>

*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Ktd3SV5WDX9oo%2FAFohUCNMAHWv8sEmqt81wHPFUx%2Bd0%3D&amp;reserved=0!<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Ktd3SV5WDX9oo%2FAFohUCNMAHWv8sEmqt81wHPFUx%2Bd0%3D&amp;reserved=0>

 /<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Ktd3SV5WDX9oo%2FAFohUCNMAHWv8sEmqt81wHPFUx%2Bd0%3D&amp;reserved=0>

[!]<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=xRAIxqDIW8vtdHt6lwFdUktGawQbAcJkEVDCHIYPXE4%3D&amp;reserved=0>
Virus-free. https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Tg7FLgQLHKkV5LbnK1DEeG%2FDP0Ell3pW0noPhsvo1tU%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C03cfa4ac751a463245a808d9890fbd37%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637691522960903111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=xRAIxqDIW8vtdHt6lwFdUktGawQbAcJkEVDCHIYPXE4%3D&amp;reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20211006/fe6536a0/attachment-0001.html 


More information about the Eprints-tech mailing list