tar complains about changed directory which hasn't changed

Bug #1243367 reported by Removed by request
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tar (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm using Ubuntu 14.04 dev with tar 1.26+dfsg-8 and sometimes I'm seeing the message "tar: .: file changed as we read it" which seems to not be true. This bugs seems to be very difficult to reproduce and even the reproducing behavior is really annoying. As I got today on testing the chance for easy reproducing I have made a look with inotifywait what is happening:

sworddragon@ubuntu:~$ mkdir tmp
sworddragon@ubuntu:~$ inotifywait -mr tmp &
[1] 12445
sworddragon@ubuntu:~$ Setting up watches. Beware: since -r was given, this may take a while!
Watches established.
^C
sworddragon@ubuntu:~$ cd tmp
sworddragon@ubuntu:~/tmp$ tar --exclude "*\.tar" -zcf test.tar .
tmp/ OPEN,ISDIR
tmp/ CREATE test.tar
tmp/ OPEN test.tar
tar: .: file changed as we read it
tmp/ CLOSE_NOWRITE,CLOSE,ISDIR
tmp/ MODIFY test.tar
tmp/ CLOSE_WRITE,CLOSE test.tar
sworddragon@ubuntu:~/tmp$ rm test.tar
tmp/ DELETE test.tar
sworddragon@ubuntu:~/tmp$ tar --exclude "*\.tar" -cf test.tar .
tmp/ CREATE test.tar
tmp/ OPEN test.tar
tmp/ OPEN,ISDIR
tmp/ CLOSE_NOWRITE,CLOSE,ISDIR
tmp/ MODIFY test.tar
tmp/ CLOSE_WRITE,CLOSE test.tar
sworddragon@ubuntu:~/tmp$ rm test.tar
tmp/ DELETE test.tar
sworddragon@ubuntu:~/tmp$ tar --exclude "*\.tar" -zcf test.tar .
tmp/ OPEN,ISDIR
tmp/ CREATE test.tar
tmp/ OPEN test.tar
tar: .: file changed as we read it
tmp/ CLOSE_NOWRITE,CLOSE,ISDIR
tmp/ MODIFY test.tar
tmp/ CLOSE_WRITE,CLOSE test.tar
sworddragon@ubuntu:~/tmp$ tar --exclude "*\.tar" -zcf test.tar .
tmp/ OPEN,ISDIR
tmp/ MODIFY test.tar
tmp/ OPEN test.tar
tmp/ CLOSE_NOWRITE,CLOSE,ISDIR
tmp/ MODIFY test.tar
tmp/ CLOSE_WRITE,CLOSE test.tar

The bug only appears if a compression is activated (even with -J) and the tar archive doesn't already exist (tested both multiple times). The curious is if I'm closing the terminal and open it again I'm not able to reproduce this anymore. The bug will then randomly appear whenever I'm using tar.

Revision history for this message
RVS (rvsp) wrote :

I have the same problem with tar version 1.27.1 on ubuntu server 14.04.1. Error "tar: .: file changed as we read it" and no files are being changed.
I made this research:
If I repeat the tar operation the errors appear on the same files.
I deleted a folder with some error files and then the error appeared in other files. If I repeat the operation then the errors keep on the same new files.
After undeleting the recently deleted folder then the errors come back to the initial group of files.
Each day, as the users work on their files (this is a backup procedure) the error files chage, but if I repeat the tar procedure the same night (without source file changes) the error remains in the same files.
It seems to be a random error affected by the files and folders being "tarred", but I couldn't find a failure pattern.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in tar (Ubuntu):
status: New → Confirmed
Revision history for this message
Titus Hochgreve (thochgreve) wrote :

same behaviour here: TAR 1.27.1 Ubuntu 14.04.4 LTS 64 bit
incremental archive, both with --gzip and without

tar complains about one file in one attempt, exits after archiving it. After copying the snapshot and creating the next increment, it may fail on the same file or another one.

One file it just doesn´t get past is a 1.4 GB Log File, 69 MB compressed. The incremental tar has a size of 336 MB or so. (I deleted them all and can only roughly remember.)

The files that tar complains about haven´t been touched in ages.

Revision history for this message
Don Hirst (dvhirst865) wrote :

It is now going on 5 years and this bug is still alive and well. I'm trying to migrate off of 14.04.5, and need to use tar for creating backups of folders and files to analyze for migration purposes. This bug is getting in the way of my work. I copied the live folder / files to an intermediate folder / files, and tried to use tar on that, no luck; it errors out almost immediately.

I am running as root and trying to create an archive of /etc.
The error says: tar: ./.: file changed as we read it

My instance is running as a VM in VBox

SCP: Ubuntu 14.04.5, up-to-date
TAR: tar --version says: tar (GNU tar) 1.27.1

Suggestions welcomed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.