Hi, I use Amanda with vtapes to backup a server. The backup is stored on an extra partition and is mirrored daily using rsync with a remote NAS. To keep the traffic low, the dump cycle is set to 90 days. To force Amanda to just create increments of increments, bumpmult, bumpdays and bumpsize are set to 1.
The setup will produce a level 0 backup about every 90 days (size 8 GB) and daily increments of about 200 MB. A full partition restore works nicely using amfetchdump and tar. I have a problem using amrecover if I want to recover a directory tree (e.g. etc). After the system processes a couple of vtapes it stops throwing the following error: *** buffer overflow detected ***: amrecover terminated First I had to increase for some reason the number of open files otherwise amrecover would quit telling me it ran out of file descriptor space. Recovering single files and small directories did not seem to be a problem and the problem was not there when the number of tapes to process was small. But with presently 80 tapes to process I hit this limit. Below are the last lines from a long amrecover.debug. amrecover is obviously trying to establish a new connection when the buffer overflow happened. amrecover: connect_port: Try port 555: available - Success amrecover: connect_portrange: Connect from 0.0.0.0:555 failed: Cannot assign requested address amrecover: connect_portrange: connect to 127.0.0.1:10080 failed: Cannot assign requested address amrecover: connect_port: Skip port 556: owned by remotefs. amrecover: make_socket opening socket with family 2 amrecover: make_socket opening socket with family 2: 964 The problem seems to be the following: For every vtape a new security_stream is initialized. The underlying driver is trying to find a free port. It tries different port numbers until it finds a free one and establishes a connection using sockets which leads eventually to the transfer of data piped into a restore program like amgtar. After the transfer the security stream is closed, but the underlying driver is for some reason not closing the sockets and the port becomes unusable. Now amrecover starts over with the next vtape blocking the next port. If the number of open sockets is limited (ulimit -n 1023) then amrecover crashes as soon as the number of open sockets hits this limit. Changing the kernel limit shifts the problem. More and more ports are blocked and eventually some internal buffer in amrecover overflows which lead to the final crash. The question is: Why isn't the driver closing the sockets when the security stream is closed? Three possible reasons: 1. The security stream layer does not inform the driver that he is done with the connection. 2. The security layer keeps the sockets open, because he wants to reuse them, but the the next security stream init does not reuse the old connection but creates a new one. 3. Just the closing statements in the driver of the connection are missing or the connection cannot be closed. The problem only surfaces if the setup uses a large number of tapes which is not the usual setup. By the way I am using Amanda 3.5.1 installed using apt on Ubuntu 18.4. Greetings Rüdiger
