sandialabs/scot

Issues with Scot::Env module

dmenezesrj opened this issue ยท 11 comments

Anyone have any idea how to fix this issues with backup.pl and alert.pl? I installed SCOT 3.5.2 from the repository on Red Hat 7 with SE Linux.

Here are the errors:

[root@plrtir01 ~]# /opt/scot/bin/backup.pl
Can't locate Scot/Env.pm in @inc (you may need to install the Scot::Env module) (@inc contains: ../lib /opt/perl5/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux /opt/perl5/perls/perl-5.18.2/lib/site_perl/5.18.2 /opt/perl5/perls/perl-5.18.2/lib/5.18.2/x86_64-linux /opt/perl5/perls/perl-5.18.2/lib/5.18.2 .) at /opt/scot/bin/backup.pl line 9.
BEGIN failed--compilation aborted at /opt/scot/bin/backup.pl line 9.

[root@plrtir01 ~]# /opt/scot/bin/alert.pl
--- Starting Mail Ingester ---
Can't locate object method "log_config" via package "Scot::Env" at /opt/scot/lib/Scot/Env.pm line 113.
[root@plrtir01 ~]#

And the e-mail message:

X-Cron-Env: <XDG_SESSION_ID=1131>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: 20170605145002.8AEA3107@plrtir01.localdomain
Date: Mon, 5 Jun 2017 11:50:02 -0300 (-03)

Can't locate object method "log_config" via package "Scot::Env" at /opt/scot/lib/Scot/Env.pm line 113.
--- Starting Mail Ingester ---

Thanks!

Uncomment like 7 in backup.pl so it looks like:

use lib '/opt/scot/lib';

We have this and a bunch of other bug fixes queued but can't push just yet due to internal policies.

Didn't see your second issue, sorry. (Please separate multiple issues in the future).
The problem is a missing stanza in the your /opt/scot/etc/scot.cfg.pl

Make sure you have something like this in it:

log_config => {
    logger_name     => 'SCOT',
    layout          => '%d %7p [%P] %15F{1}: %4L %m%n',
    appender_name   => 'scot_log',
    logfile         => '/var/log/scot/scot.log',
    log_level       => 'DEBUG',
},

Hi!

Thanks! Saddly din't work. Here are the errors:

backup.pl - Running with fail. I did the change in line 7 at backup.pl. Now I got it:
Failed to create a snapshot! {"error":{"root_cause":[{"type":"repository_missing_exception","reason":"[scot_backup] missing"}],"type":"repository_missing_exception","reason":"[scot_backup] missing"},"status":404} at /opt/scot/bin/backup.pl line 135.

alert.pl - We have log_config defined in /opt/scot/etc/scot.cfg.pl. The file /var/log/scot/scot.log exists and we can see a lot of information. The error message still the same:
--- Starting Mail Ingester ---
Can't locate object method "log_config" via package "Scot::Env" at /opt/scot/lib/Scot/Env.pm line 113.

Sorry! I will separate multiple issues in the future.

Thank you!

To fix the backup error, try re-running:

$SCOTDIR/install/src/elasticsearch/mapping.sh

Hi!

Re-running mapping.sh I got this message:

[root@plrtir01 ~]# /opt/scot/install/src/elasticsearch/mapping.sh
Deleting Existing SCOT index
{"acknowledged":true}Creating SCOT index
{
"acknowledged" : true
}

The backup.pl error message still the same, but I found it from messages log file:

Jun 12 11:07:00 plrtir01 elasticsearch: [2017-06-12 11:07:00,159][WARN ][rest.suppressed ] path: /_snapshot/scot_backup, params: {repository=scot_backup}
Jun 12 11:07:00 plrtir01 elasticsearch: RepositoryException[[scot_backup] failed to create repository]; nested: CreationException[Guice creation errors:
Jun 12 11:07:00 plrtir01 elasticsearch: 1) Error injecting constructor, RepositoryException[[scot_backup] location [/opt/scotbackup/elastic] doesn't match any of the locations specified by p
ath.repo because this setting is empty]

Thanks!

Does /opt/scotbackup/elastic exist on your system? Should have been created.
At this point, I'd probably recommend the following, since I do not have confidence that the initial install fully worked.

# mv /opt/scot /opt/scot.bak
# mv /opt/scotbackup /opt/scotbackup.bak
# cd $HOMEDIR/SCOT
 # ./install.sh | tee -a $HOMEDIR/scot.install.log
 copy any config modifications  from /opt/scot.bak/etc/  to /opt/scot/etc

If you run into problems with the install, please look at the scot.install.log or share them with me.
Thanks.

Sorry for late! I was on vacation.

I tried to install again but failed ("FAILED to FIND revproxy config!"). Attached is the installation log.
scot.install.log.txt

Try the latest code. reopen issue if you continue to have difficulty.

Hi!

I'm using the latest code, but the problem still the same: FAILED to FIND revproxy config!.

Attached is the installation log.

Thanks!
scot.install.log.txt

@dmenezesrj, the problem is that I was assuming CentOS or Ubuntu. Your OS is "RedHatEnterprise". My fault, but I will upload fix shortly that will change your OS string to CentOS and then the install should just work. If you want to hack it your self, you can got into install/determine_os.sh and hard code the OS to "CentOS"