Hi,

I am sometimes experiencing an issue where a new container can't write to an existing volume after removing the old container. The containers are running rootless on RHEL8.

I tried resetting the permissions on the volume by running the "podman unshare" command again, but it seems to have no effect. If I create a new volume and mount it to the new container, the new container can write to the new volume.

Why is the new container unable to write to the existing volume, but able to write to a new volume with supposedly identical permissions?

Sequence of events:
1. create volume and container
podman volume create <volume_name>
podman unshare chown 1000:1000 -R <path_to_volume>
podman run -d --name <container_name> ... --volume <volume_name>:/var/log:Z ... <container_image>

2. Some point in the future I get a new container image
podman container stop <container_name>
podman container rm <container_name>
podman run -d --name <container_name> ... --volume <volume_name>:/var/log:Z ... <new_container_image>

3. The new container logs show it is unable to write to the volume


Regards,

--
Jeremy V.