New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use string ("live") as a HASH ref while "strict refs" in use at libexec/NfProfile.pm line 1238 #1

Closed
p-alik opened this Issue Nov 15, 2017 · 12 comments

Comments

Projects
None yet
4 participants
@p-alik
Copy link
Owner

p-alik commented Nov 15, 2017

actually it's not a new issue.

Steps to reproduce:

  • new installation with sudo ./install.pl /PATH-TO/nfsen.conf ends in exception:
Profile live: spool directories:
Creating: mkdir /var/cache/profiles-data/live/asa-lab-01
asa-lab-01
Rename gif RRDfiles ... done.
Create profile info for profile 'live'

Rebuilding profile stats for './live'
Can't use string ("live") as a HASH ref while "strict refs" in use at libexec/NfProfile.pm line 1238

@p-alik p-alik added the bug label Nov 15, 2017

@p-alik

This comment has been minimized.

Copy link
Owner Author

p-alik commented Nov 15, 2017

nfsen is the project of @phaag.
With regard to the install message:

* You may want to subscribe to the nfsen-discuss mailing list:
* http://lists.sourceforge.net/lists/listinfo/nfsen-discuss
* Please send bug reports back to me: phaag@sourceforge.net

I tried unfortunately without success to report the issue.

@t0d0r

This comment has been minimized.

Copy link

t0d0r commented Jan 10, 2018

There is the patch about it,
ref: https://sourceforge.net/p/nfsen/mailman/message/35850749/

diff --git a/install.pl b/install.pl
index 5ce265e..2a213db 100755
--- a/install.pl
+++ b/install.pl
@@ -553,7 +553,7 @@ sub UpgradeProfiles {
 				if( ! -f "$NfConf::PROFILEDATADIR/$profilepath/$channel/.nfstat") {
 					# no shadow profile, but missing channel stat
 					print "Rebuilding profile stats for '$profilegroup/$profilename'\n";
-					NfProfile::DoRebuild(\%profileinfo, $profilename, $profilegroup, $profilepath, 1, 0);
+					NfProfile::DoRebuild(*STDOUT, \%profileinfo, $profilename, $profilegroup, $profilepath, 1, 0);
 					NfProfile::WriteProfile(\%profileinfo);
 				}
 				# make sure it's own by nfsen_uid after the rebuild
diff --git a/libexec/NfProfile.pm b/libexec/NfProfile.pm
index 1ca7436..d58fcd2 100644
--- a/libexec/NfProfile.pm
+++ b/libexec/NfProfile.pm
@@ -3441,7 +3441,7 @@ sub CheckProfiles {
 				} else {
 					$profileinfo{'type'} = 1;
 				}
-				my $status = DoRebuild(\%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
+				my $status = DoRebuild(*STDOUT, \%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
 				syslog('err', "Rebuilded profile '$profile' in group '$profilegroup': $status ");
 			}
 			if ( -f "$NfConf::PROFILESTATDIR/$profilepath/.CANCELED" ) {
@@ -3453,7 +3453,7 @@ sub CheckProfiles {
 				} else {
 					$profileinfo{'type'} = 1;
 				}
-				my $status = DoRebuild(\%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
+				my $status = DoRebuild(*STDOUT, \%profileinfo, $profile, $profilegroup, $profilepath, 0, 0);
 				syslog('err', "Rebuilded profile '$profile' in group '$profilegroup': $status ");
 			}
 			if ( $profileinfo{'locked'} ) {
@p-alik

This comment has been minimized.

Copy link
Owner Author

p-alik commented Jan 10, 2018

Indeed, but the issue was reported 2016 for 1.3.7.
https://sourceforge.net/p/nfsen/mailman/message/35147369/

@aiso-net

This comment has been minimized.

Copy link

aiso-net commented Jan 25, 2018

Im having this issue on CentOS 7 with stable 1.3.8, how do I fix it?

@t0d0r

This comment has been minimized.

Copy link

t0d0r commented Jan 25, 2018

@aiso-net, did you tried to apply the patch?

@aiso-net

This comment has been minimized.

Copy link

aiso-net commented Jan 25, 2018

sorry, not familiar with that, any info on how to?

@t0d0r

This comment has been minimized.

Copy link

t0d0r commented Jan 25, 2018

https://www.thegeekstuff.com/2014/12/patch-command-examples

TLDR:

- remove the line
+ add the line 
@aiso-net

This comment has been minimized.

Copy link

aiso-net commented Jan 25, 2018

thanks, but that didnt work:
[root@nms nfsen-1.3.8]# patch libexec/NfProfile.pm NfProfile.pm-patch
patching file libexec/NfProfile.pm
Hunk #1 FAILED at 3441.
Hunk #2 FAILED at 3453.
2 out of 2 hunks FAILED -- saving rejects to file libexec/NfProfile.pm.rej
[root@nms nfsen-1.3.8]# >install.pl-patch
[root@nms nfsen-1.3.8]# vi install.pl-patch
[root@nms nfsen-1.3.8]# patch install.pl install.pl-patch
patching file install.pl
Hunk #1 FAILED at 553.
1 out of 1 hunk FAILED -- saving rejects to file install.pl.rej

@aiso-net

This comment has been minimized.

Copy link

aiso-net commented Jan 25, 2018

Applied the patch manually and that fixed it, thanks

@sebastian-be

This comment has been minimized.

Copy link

sebastian-be commented Jul 5, 2018

This one works:

patch -p 1 -i fix.patch

patching file install.pl
Hunk #1 succeeded at 553 with fuzz 1.
patching file libexec/NfProfile.pm

Ps: the fix.patch contains content as posted by t0d0r above

@p-alik

This comment has been minimized.

Copy link
Owner Author

p-alik commented Sep 24, 2018

https://github.com/p-alik/nfsen/releases/tag/nfsen-1.3.8 based on origin nfsen-1.3.8 but includes the patch 98bf068 for the issue.

@p-alik

This comment has been minimized.

Copy link
Owner Author

p-alik commented Nov 16, 2018

In PR #8 @candlerb described the matter of doRebuild + $socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment