I have not explicitly found the issue in terms of a sure fire way to reproduce it and then solve it.
However, I have apparently been running the IPFS daemon on my local machine for over a week and I haven’t noticed.
One thing that I can think of that has changed is that I’m now using systemctl to manage the daemon instead of running it in a background tmux session.
I did write up notes on how to install the deamon as a service:
# https://gist.github.com/pstehlik/9efffa800bd1ddec26f48d37ce67a59f
# https://www.maxlaumeister.com/u/run-ipfs-on-boot-ubuntu-debian/
# https://linuxconfig.org/how-to-create-systemd-service-unit-in-linux#:~:text=There%20are%20basically%20two%20places,%2Fetc%2Fsystemd%2Fsystem%20.
SERVICE_DPATH=/etc/systemd/system
SERVICE_FPATH=$SERVICE_DPATH/ipfs.service
IPFS_EXE=$(which ipfs)
# TODO: This will depend on how you initialized IPFS
#IPFS_PATH=/data/ipfs
#IPFS_PATH=$HOME/.ipfs
echo "IPFS_EXE = $IPFS_EXE"
echo "SERVICE_FPATH = $SERVICE_FPATH"
echo "IPFS_PATH = $IPFS_PATH"
sudo_writeto $SERVICE_FPATH "
[Unit]
Description=IPFS daemon
After=network.target
[Service]
Environment=\"IPFS_PATH=$IPFS_PATH\"
User=$USER
ExecStart=${IPFS_EXE} daemon
[Install]
WantedBy=multiuser.target
"
#sudo systemctl daemon-reload
sudo systemctl start ipfs
sudo systemctl status ipfs
as part of my setup ipfs script: local/setup_ipfs.sh at main · Erotemic/local · GitHub