Well because of $path containing wrong values $id was -1 and $mtime and $etag have nit been updated.
To find the issue took me several debugging sessions - with this log statement it could have been resolved within minutes.