Ok my hunch was correct. There were 2 LOCK files that remained after stopping the container. One in /etc/backuppc one in /data/log/

After removing those and restarting the container I can now see the status of the server.

I am guessing when power loss occurred the LOCK files could not be cleared and because I am using persistent storage for config and data (easier to back up) those LOCK remained on container start making it think an instance was running when it really was not.

Anyway, thanks for pointing me in the right direction. It is a testament to this project that this is the first time in 5 years I have ever had any issues with it. Solid stuff.


Thanks. Y'all have a nice week.



















On 02/12/2024 16:47, p2k-...@roosoft.ltd.uk wrote:
On 02/12/2024 15:05, G.W. Haywood wrote:
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).

Sorry about that.  From Meta.pmI get this. Which sounds about right as the install was about 5 years ago.

>  Version 4.3.0, released 25 Nov 2018.


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


Here is the  output from config.pl

```
###########################################################################
# General server configuration
###########################################################################
#
# Host name on which the BackupPC server is running.
#
$Conf{ServerHost} = 'dfd2b2dc4fea';

#
# TCP port number on which the BackupPC server listens for and accepts
# connections.  Normally this should be disabled (set to -1). The TCP
# port is only needed if apache runs on a different machine from BackupPC.
# In that case, set this to any spare port number over 1024 (eg: 2359).
# If you enable the TCP port, make sure you set $Conf{ServerMesgSecret}
# too!
#
$Conf{ServerPort} = -1;

#
# Shared secret to make the TCP port secure.  Set this to a hard to guess
# string if you enable the TCP port (ie: $Conf{ServerPort} > 0).
```




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?


Was jut trying to find what command was being run so I could see why it was failing. It may well be totally unrealted but I am no bckuppc developer so I have no idea.


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.

Well as I said I am using a docker image.

```

"Id": "sha256:4f369840a050f6c69bb7a24c357c31fa2723a4deb4cf74ed0e0d1decfd86aac8",
        "RepoTags": [
            "adferrand/backuppc:latest"
        ],
        "RepoDigests": [
"adferrand/backuppc@sha256:7a40d4f04925c326d88b106650f0f8de244a54bc46ffdba55f1f973704cc614e"
        ],

```

Looking at the docker logs I see this error though. But I can only see one instance running? Could there be a rogue lockfile somewhere as I have persistent volumes?

```

2024-12-02 16:43:31 [9188] | 2024-12-02 16:43:31 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:43:36 [9190] | 2024-12-02 16:43:36 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:43:41 [9193] | 2024-12-02 16:43:41 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:43:46 [9195] | 2024-12-02 16:43:46 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:43:51 [9197] | 2024-12-02 16:43:51 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:43:56 [9199] | 2024-12-02 16:43:56 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:44:01 [9201] | 2024-12-02 16:44:01 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:44:06 [9203] | 2024-12-02 16:44:06 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:44:11 [9205] | 2024-12-02 16:44:11 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:44:16 [9207] | 2024-12-02 16:44:16 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:44:21 [9209] | 2024-12-02 16:44:21 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:44:26 [9211] | 2024-12-02 16:44:26 Another BackupPC is running (pid 26); quitting...

2024-12-02 16:44:31 [9213] | 2024-12-02 16:44:31 Another BackupPC is running (pid 26); quitting...

```



TIA





_______________________________________________
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/


--
==

D LoCascio

Director

RooSoft Ltd



_______________________________________________
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/

Reply via email to