[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Lift_embargos: Can't call method "current_repository" on an undefined value



Problem solved!



The issue was caused by the document/eprint_fields_automatic scripts which
were trying to display error messages to an undefined user (since there is
no current_user while running the script from the command line). Still no
idea why this was working before the upgrade though, but now it works.



Thank you all for your help!

Robin



De : Robin Sylvestre <robin.sylvestre at polymtl.ca>
Envoy? : 20 novembre 2019 10:38
? : John Salter <J.Salter at leeds.ac.uk>; eprints-tech at ecs.soton.ac.uk
Objet : Re: [EP-tech] Lift_embargos: Can't call method
"current_repository" on an undefined value



Thanks John,



Your grep formula helped me solve the ?Use of uninitialized value in
string ne at (eval 65)? issue, but that?s not what is causing the script
to fail.



We are running Eprints 3.3.13 which is not concerned by the Apache 2.4
problem you mentioned (but thanks for the info).



I still suspect it?s something related to Apache config, I?ll investigate
this with our IT team.



Robin



De : John Salter <J.Salter at leeds.ac.uk <mailto:J.Salter at leeds.ac.uk> >
Envoy? : 20 novembre 2019 07:21
? : eprints-tech at ecs.soton.ac.uk <mailto:eprints-tech at ecs.soton.ac.uk> ;
Robin Sylvestre <robin.sylvestre at polymtl.ca
<mailto:robin.sylvestre at polymtl.ca> >
Objet : RE: [EP-tech] Lift_embargos: Can't call method
"current_repository" on an undefined value



Hi Robin,

*** Firstly, if you have moved from Apache 2.2 to Apache 2.4, make sure
your restricted documents are restricted!

*** There may be a change needed in
~/archives/ARCHIVEID/cfg/cfg.d/security.pl

*** See: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fissues%2F322&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C147a983cd9a245735ec008d76dee1461%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=n1d%2BlLK75hP7ksMagN%2FBVC8hp5nGeF3c39XbbsF%2Br04%3D&amp;reserved=0
<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.
com%2Feprints%2Feprints%2Fissues%2F322&data=01%7C01%7Ceprints-tech%40ecs.s
oton.ac.uk%7C3931be5440cc4d0a72ea08d76dcf9b10%7C4a5378f929f44d3ebe89669d03
ada9d8%7C0&sdata=vIu6kRSXz4SjFkQjJGB7OtqRSYGfWNxiwi7DDRL7AAs%3D&reserved=0
>



On to your reported problem


I would check any 'commit' triggers in your repository config.

This might also help (it's a bit crude, but has helped me in the past) -
grepping for a 'ne' on line 48 of a repository's config:

grep -n ' ne ' archives/ARCHVIEID/cfg/  | grep 48

if that doesn't return anything, try other config locations  like
lib/cfg.d/



I suspect there's a commit trigger that either:

- works OK if there's an online session, but not from the command-line

- generates a warning that's ignored in an online session, but not in the
bin script - which then fails



Does that help at all?



Cheers,

John



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] On Behalf Of Robin Sylvestre
via Eprints-tech
Sent: 19 November 2019 18:42
To: eprints-tech at ecs.soton.ac.uk <mailto:eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] Lift_embargos: Can't call method "current_repository"
on an undefined value



Hello fellow Eprinters,



We?ve been running Eprints 3.3.13 and a modified ?lift_embargos? script
for quite some time without any issue. But we noticed lately that the
script has stopped working. It seems that it is now unable to commit any
changes. Running in debug mode, I can see that the script fails after
calling the ?$doc->commit(1)? line:



Lifting expired embargo on eprint #2957, document #41378 (2019-11-19)



main::CODE(0x999baa0)(lift_embargos:149):

149:            if( !$dryrun )

150:            {

main::CODE(0x999baa0)(lift_embargos:151):

151:                    $doc->set_value( "security", "public" );

main::CODE(0x999baa0)(lift_embargos:152):

152:                    $doc->set_value( "date_embargo", undef );

main::CODE(0x999baa0)(lift_embargos:154):

154:                    $doc->commit( 1 ); # pass force through to parent
eprint



Use of uninitialized value in string ne at (eval 65)[(eval
55)[/usr/share/eprints/bin/../perl_lib/EPrints/Config.pm:272]:19] line 48.

at (eval 65)[(eval
55)[/usr/share/eprints/bin/../perl_lib/EPrints/Config.pm:272]:19] line 48.

        EPrints::Config::Ecole::__ANON__[(eval 65)[(eval
55)[/usr/share/eprints/bin/../perl_lib/EPrints/Config.pm:272]:19]:68]('EPr
ints::DataObj::Document=HASH(0x9a2f8f0)') called at
/usr/share/eprints/bin/../perl_lib/EPrints/Repository.pm line 1726

        eval {...} called at
/usr/share/eprints/bin/../perl_lib/EPrints/Repository.pm line 1726

        EPrints::Repository::call('EPrints::Repository=HASH(0x4654aa0)',
'set_document_automatic_fields',
'EPrints::DataObj::Document=HASH(0x9a2f8f0)') called at
/usr/share/eprints/bin/../perl_lib/EPrints/DataObj.pm line 463


EPrints::DataObj::update_triggers('EPrints::DataObj::Document=HASH(0x9a2f8
f0)') called at
/usr/share/eprints/bin/../perl_lib/EPrints/DataObj/Document.pm line 1217


EPrints::DataObj::Document::commit('EPrints::DataObj::Document=HASH(0x9a2f
8f0)', 1) called at lift_embargos line 154


main::__ANON__[lift_embargos:184]('EPrints::Repository=HASH(0x4654aa0)',
'EPrints::DataSet=HASH(0x57200e8)',
'EPrints::DataObj::Document=HASH(0x9a2f8f0)', undef) called at
/usr/share/eprints/bin/../perl_lib/EPrints/List.pm line 664

        EPrints::List::map('EPrints::List=HASH(0x2ff0af8)',
'CODE(0x999baa0)') called at lift_embargos line 184

Can't call method "current_repository" on an undefined value at
/usr/share/eprints/bin/../perl_lib/EPrints/BackCompatibility.pm line 443.



Looking at the code, I can see that the session information is passed to
the other functions, but it doesn?t seem to be working anymore as the
session is undefined when calling the method ?current_repository? on line
443 of BackCompatibility.pm:



return $EPrints::HANDLE->current_repository;



The only thing that changed in the last few weeks has been a server
upgrade (not sure what was the previous version but we are now running on
CentOS 7 with Perl 5.16.3 and Apache 2.4.6). Using the workflow to commit
changes still work without any issue.



Has anyone encountered this error before? Could this be related to Perl or
Apache?s configuration?



Thank you for your input on this issue!



Robin Sylvestre

Technicien des syst?mes informatis?s

Biblioth?que Louise-Lalonde-Lamarre

Polytechnique Montr?al

514-340-4711 poste 5973



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