Lxc file push/pull - no such file or directory

Hi all,

i have problem with lxc file push/pull functionality. When try push/pull file i get below error:

lxc fiile push somefilename container/dir/
Error: open /tmp/lxd_forkputfile_244537034: no such file or directory

The problem is weird because:

  • when i restart whole machine pull/push work
  • after some weeks it stop work again.
  • i have this issue 3 weeks ago also, but i dont take it seriously … i upgrade lxd, os, restart machine and forgot.
  • but it appear again.

I cannot always restart whole node due lot of services running there.
So now i want to find root cause of this problem. I will be grateful for any suggestion how to take to bottom of it.

My actual setup is:

driver: lxc
driver_version: 4.0.4
kernel_architecture: x86_64
kernel_version: 5.8.14-1-default
os_name: openSUSE Tumbleweed
os_version: “20201019”
server_version: “4.7”
storage: btrfs
storage_version: 4.15.1

Does it work if you specify somefilename using its absolute path?

It doesnt work,
When i use absolute file path the result is with the same error.

And you’re running the LXD via snap package?

yes, its running via snap.

This happens when you run something on your host which cleans up /tmp deleting the /tmp/snap.lxd directory

This effectively breaks /tmp inside the snap for good until the entire namespace is re-created on reboot.

So look for some kind of /tmp cleaning logic on your system, that’ll be the culprit.

1 Like

You are right the directory /tmp/snap.lxd doesnt exists on the hosts.

Interesting is that its on 3 nodes, on one node is okay … all have identical configuration also uptime.

I will try findout if there is some cleaning job. Thank you for direction.

Yeah, i have configured automaticaly cleanup /tmp dir every 10d.

So solutions are:

  • disable cleanup /tmp by creating file /etc/tmpfiles.d/fs-tmp.conf with content:
    q /tmp 1777 root root

  • let enabled /tmp cleaunup but prevend remove snap.lxd dir creating file /etc/tmpfiles.d/fs-tmp.conf with content:
    q /tmp 1777 root root 10d
    r! /tmp/snap.lxd

Many thanks for help.

1 Like