Hi there,
On Mon, 2 Dec 2024, p2k-dev wrote:
I have an instance of BackupPC installed via docker on a client server
It always helps to give version number(s).
that has not had any updates for a while. (not needed as not online) but
after an unscheduled reboot the WebUI now shows the following error
message when trying to determine the status of
```
Error: Unable to connect to BackupPC server
This CGI script (/BackupPC_Admin) is unable to connect to the BackupPC
server on dfd2b2dc4fea port -1.
I think the port number should be 9876.
You need to find out is why the port number which is given in the
error message is -1 instead of 9876. There are many possibilities,
and they include that the thing which is reporting the error may be
lying, but I'd assume that it's, er, correctly wrong until you can
prove otherwise. It could be just that you've managed to break the
configuration file. The port number is set in the hash element
$Conf{SCGIServerPort}
in the file
/etc/BackupPC/config.pl
which is just a text file. In my version (more or less from upstream)
it's at about line 2050, but if you've ever used the Web interface to
change anything in config.pl, I think all line numbering bets will be
off and you will need to search for that hash key using a pager or a
text editor (or even 'grep').
Just for completeness (from the error message it doesn't look like the
script is trying to connect to 9876) check that the server is actually
listening on the port. You can do that in several ways, I'd probably
use nmap but if you don't have it can try telnet.
If there is nothing listening on the port you'll see something like
below, where I deliberately choose an unused port:
8<----------------------------------------------------------------------
$ telnet 127.0.0.1 9999
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
$
8<----------------------------------------------------------------------
but if BackupPC is listening you'll see
8<----------------------------------------------------------------------
$ telnet 127.0.0.1 9876
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
$
8<----------------------------------------------------------------------
There I just hit [RETURN] a few times to get out of the connection.
```
I tried restarting the container but still same error. I looked inside
the container at the log file but it seems to be backing up correctly.
And indeed I can see the logs from the WebUI as well as the Config I
just can't see any status of hosts of the server itself ?
For reference the docker hostname is `dfd2b2dc4fea` and when I try and
run `BackupPC_Admin_SCGI` as the backuppc user I get:
```
./BackupPC_Admin_SCGI
BackupPC_Admin_SCGI: can't load perl SCGI module - install via CPAN;
exiting in 60 seconds
```
What made you try that?
The error message is boilerplate when an eval{} fails at around line 121
in BackupPC_Admin_SCGI. Either SGCI.pm really is missing, or it isn't in
the search path which Perl uses when it runs. The search path is in @INC
which you can see using 'perl -V', which produces quite a lot of output,
but luckily @INC is the last few lines:
8<----------------------------------------------------------------------
$ perl -V | tail
@INC:
/etc/perl
/usr/local/lib/arm-linux-gnueabihf/perl/5.32.1
/usr/local/share/perl/5.32.1
/usr/lib/arm-linux-gnueabihf/perl5/5.32
/usr/share/perl5
/usr/lib/arm-linux-gnueabihf/perl-base
/usr/lib/arm-linux-gnueabihf/perl/5.32
/usr/share/perl/5.32
/usr/local/lib/site_perl
$
8<----------------------------------------------------------------------
You can check if SCGI.pm is present with something like 'locate' if
you have it installed:
8<----------------------------------------------------------------------
$ locate SCGI
/usr/local/BackupPC/bin/BackupPC_Admin_SCGI
/usr/share/man/man3/SCGI.3pm.gz
/usr/share/man/man3/SCGI::Request.3pm.gz
/usr/share/perl5/SCGI
/usr/share/perl5/SCGI.pm
/usr/share/perl5/SCGI/Request.pm
$
8<----------------------------------------------------------------------
As you can see, SCGI.pm in my system is in /usr/share/perl5/ which is the
path in the fifth line of the @INC output. It's pure luck that there are
only ten lines of @INC information in my 'perl -V' output and that the
default for 'tail' is to print the last ten lines of the input.
If SCGI.pm really isn't there you need to install it as the message says,
or it might be broken rather than missing - in which case reinstall it.
That probably won't hurt anyway.
It might also be worth checking there's only one instance of BackupPC
actually running - probably simplest to stop it, make sure that it's
stopped by looking at the process list with 'ps', then start it and
check that the right processes seem to be running. Some of them do
start child processes:
8<----------------------------------------------------------------------8<----------------------------------------------------------------------
$ ps afux | grep BackupPC | grep -v grep
backuppc 24204 0.0 0.6 21276 6096 ? S Dec01 0:28 /usr/bin/perl
/usr/local/BackupPC/bin/BackupPC -d
backuppc 24205 0.0 0.1 44408 1688 ? SN Dec01 0:01 \_
/usr/bin/perl /usr/local/BackupPC/bin/BackupPC_Admin_SCGI
backuppc 24206 0.0 0.0 44408 668 ? SN Dec01 0:00 \_
/usr/bin/perl /usr/local/BackupPC/bin/BackupPC_Admin_SCGI
$
8<----------------------------------------------------------------------8<----------------------------------------------------------------------
All the paths on your system might be different from mine.
That ought to do for a start, but there are many other things
which might need to be checked and some of those above might
need more work.
--
73,
Ged.
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/