Non-removeable file in EOS

Hello,

somehow we got a non-removeable file in EOS.

eos ls /eos/.../dir/<file>

show it, but

eos ls -l /eos/.../dir/<file>

doesn’t.
The file is missing in QDB but present in the directory /eos/…/dir/.
Also, eos file info /eos/…/dir/
show:

error: cannot stat '/eos/.../dir/<file>'
 (errc=2) (No such file or directory)

To prevent the risk of losing other files, we move all other files to another place.
But the directory is still not empty:

eos file info /eos/.../dir

show:

  Directory: '/eos/.../dir'  Treesize: 0
  Container: 0  Files: 1  Flags: 42755
Modify: Wed Nov 10 11:13:29 2021 Timestamp: 1636532009.542134950
Change: Wed Nov 10 11:12:28 2021 Timestamp: 1636531948.961985049
Sync  : Wed Nov 10 11:13:29 2021 Timestamp: 1636532009.542134950
Birth : Thu Oct 28 10:52:59 2021 Timestamp: 1635407579.046592306
  CUid: 0 CGid: 667 Fxid: 004bbd11 Fid: 4963601 Pid: 4963599 Pxid: 004bbd0f
  ETAG: 4bbd11:1636532009.542
eos rm -Fr /eos/.../dir

complayin:

error: unable to remove directory ...
reason: Unable to rmdir - Directory not empty ...

So, we can try deleting 004bbd11 as cxid, but is it safe to do this?
Or is there another way out of this situation?

We are working on the EOS version:
EOS_SERVER_VERSION=4.8.65 EOS_SERVER_RELEASE=1
EOS_CLIENT_VERSION=4.8.65 EOS_CLIENT_RELEASE=1

Hi Ivan,

The only way of getting out of this situation is to delete the file entry directly in QuarkDB. For this you use the following set of commands:

# Show the files that the directory thinks it contains
redis-cli -p 7777 hgetall 4963601:map_files
# At this point you should have only one entry. This is a map from file name to file id.
# Futhermore you should doublecheck that the file really does not exist anymore by
# doing a "eos fileinfo fxid:<value>" which should fail.
# Now you can actually clean up this map by doing
redis-cli -p 7777 del 4963601:map_files

Then you just need to trigger a refresh of the cache at the MGM by doing:

eos ns cache drop-single-container 4963601

Then try again to list the container and it should be empty at this point. Then you can use the usuall delete command to remove completely the directory.

Let me know if you have any issues.

Cheers,
Elvin

Ok. Thank you for your help.