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

Robin Sylvestre via Eprints-tech <[email protected]> Tue, 19 Nov 2019 13:41:49 -0500 (EST)
Newsgroups gmane.comp.web.eprints.devel
Message-ID <EMEW3|ce908d0d1d972ce3f2223174b8e79438vAIIgE14eprints-tech-bounces|ecs.soton.ac.uk|[email protected]>
--===============6604687980819174694==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0055_01D59EDF.17E8B540"
Content-Language: fr-ca

------=_NextPart_000_0055_01D59EDF.17E8B540
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

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




------=_NextPart_000_0055_01D59EDF.17E8B540
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"><meta name=3DGenerator content=3D"Microsoft Word =
15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DFR-CA =
link=3D"#0563C1" vlink=3D"#954F72"><div class=3DWordSection1><p =
class=3DMsoNormal>Hello fellow Eprinters,<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><span =
lang=3DEN-CA>We&#8217;ve been running Eprints 3.3.13 and a modified =
&#8220;lift_embargos&#8221; 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 <i>commit </i>any changes. Running in =
debug mode, I can see that the script fails after calling the =
&#8220;$doc-&gt;commit(1)&#8221; line: <o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-CA><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>Lifting expired embargo on eprint =
#2957, document #41378 (2019-11-19)<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>main::CODE(0x999baa0)(lift_embargos:149):<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>149:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if( !$dryrun =
)<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>150:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>main::CODE(0x999baa0)(lift_embargos:151):<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>151:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
$doc-&gt;set_value( &quot;security&quot;, &quot;public&quot; =
);<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>main::CODE(0x999baa0)(lift_embargos:152):<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>152:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
$doc-&gt;set_value( &quot;date_embargo&quot;, undef =
);<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>main::CODE(0x999baa0)(lift_embargos:154):<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New"'>154:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
=A0=A0=A0$doc-&gt;commit( 1 ); # pass force through to parent =
eprint<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>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.<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'> at (eval 65)[(eval =
55)[/usr/share/eprints/bin/../perl_lib/EPrints/Config.pm:272]:19] line =
48.<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>=A0=A0=A0=A0=A0=A0=A0 =
EPrints::Config::Ecole::__ANON__[(eval 65)[(eval =
55)[/usr/share/eprints/bin/../perl_lib/EPrints/Config.pm:272]:19]:68]('EP=
rints::DataObj::Document=3DHASH(0x9a2f8f0)') called at =
/usr/share/eprints/bin/../perl_lib/EPrints/Repository.pm line =
1726<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>=A0=A0=A0=A0=A0=A0=A0 eval {...} =
called at /usr/share/eprints/bin/../perl_lib/EPrints/Repository.pm line =
1726<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>=A0=A0=A0=A0=A0=A0=A0 =
EPrints::Repository::call('EPrints::Repository=3DHASH(0x4654aa0)', =
'set_document_automatic_fields', =
'EPrints::DataObj::Document=3DHASH(0x9a2f8f0)') called at =
/usr/share/eprints/bin/../perl_lib/EPrints/DataObj.pm line =
463<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>=A0=A0=A0=A0=A0=A0=A0 =
EPrints::DataObj::update_triggers('EPrints::DataObj::Document=3DHASH(0x9a=
2f8f0)') called at =
/usr/share/eprints/bin/../perl_lib/EPrints/DataObj/Document.pm line =
1217<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>=A0=A0=A0=A0=A0=A0=A0 =
EPrints::DataObj::Document::commit('EPrints::DataObj::Document=3DHASH(0x9=
a2f8f0)', 1) called at lift_embargos line 154<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>=A0=A0=A0=A0=A0=A0=A0 =
main::__ANON__[lift_embargos:184]('EPrints::Repository=3DHASH(0x4654aa0)'=
, 'EPrints::DataSet=3DHASH(0x57200e8)', =
'EPrints::DataObj::Document=3DHASH(0x9a2f8f0)', undef) called at =
/usr/share/eprints/bin/../perl_lib/EPrints/List.pm line =
664<o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>=A0=A0=A0=A0=A0=A0=A0 =
EPrints::List::map('EPrints::List=3DHASH(0x2ff0af8)', 'CODE(0x999baa0)') =
called at lift_embargos line 184<o:p></o:p></span></p><p =
class=3DMsoNormal style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier =
New";background:yellow;mso-highlight:yellow'>Can't call method =
&quot;current_repository&quot; on an undefined value at =
/usr/share/eprints/bin/../perl_lib/EPrints/BackCompatibility.pm line =
443.</span><span lang=3DEN-CA style=3D'font-family:"Courier =
New"'><o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-CA>Looking at the code, I can see that =
the session information is passed to the other functions, but it =
doesn&#8217;t seem to be working anymore as the session is undefined =
when calling the method &#8220;current_repository&#8221; on line 443 of =
BackCompatibility.pm:<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-CA><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal =
style=3D'margin-left:35.4pt'><span lang=3DEN-CA =
style=3D'font-family:"Courier New"'>return =
$EPrints::HANDLE-&gt;current_repository;<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-CA><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-CA>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. <o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-CA><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-CA>Has anyone encountered this error before? Could this be =
related to Perl or Apache&#8217;s configuration? =
<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-CA><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-CA>Thank you for your input on this =
issue!<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-CA><o:p>&nbsp;</o:p></span></p><div><p =
class=3DMsoNormal><b><span =
style=3D'font-size:16.0pt;color:#BF8F00;mso-fareast-language:FR-CA'>Robin=
 Sylvestre</span></b><span lang=3DFR =
style=3D'mso-fareast-language:FR-CA'><o:p></o:p></span></p><p =
class=3DMsoNormal><b><span =
style=3D'mso-fareast-language:FR-CA'>Technicien des syst=E8mes =
informatis=E9s</span></b><span lang=3DFR =
style=3D'mso-fareast-language:FR-CA'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:FR-CA'>Biblioth=E8que =
Louise-Lalonde-Lamarre</span><span lang=3DFR =
style=3D'mso-fareast-language:FR-CA'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:FR-CA'>Polytechnique =
Montr=E9al</span><span lang=3DFR =
style=3D'mso-fareast-language:FR-CA'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:FR-CA'>514-340-4711 poste 5973</span><span =
lang=3DFR =
style=3D'mso-fareast-language:FR-CA'><o:p></o:p></span></p></div><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:FR-CA'>&nbsp;</span><o:p></o:p></p></div></=
body></html>
------=_NextPart_000_0055_01D59EDF.17E8B540--

--===============6604687980819174694==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/

--===============6604687980819174694==--