File corruption after copying files via samba from Karmic to Karmic

Bug #491288 reported by Ernst
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
samba
Fix Released
Unknown
samba (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Binary package hint: samba

Yesterday, I tried to copy flac files from my laptop (Ubuntu Karmic, 32-bit, running ext4 but source files are on ntfs) to my desktop (Ubuntu Karmic, 32-bit, running ext4 but destination was on ntfs) via samba. I mounted the samba share of my desktop on my latop and started the copy process on the laptop.

After this, I tried to play the files on my desktop. However, I got errors from Exaile: the stream was not correct. So, I used foobar to test the File integrity of the files, and in almost all files, it found errors. I checked on my laptop, and those errors did not exist on the files on the laptop.

So, I tried to copy them again using samba, but with the same result. foobar's File Integrity test even give exactly the same errors for the files (see the attached error log).

Then, I copied the files using a USB stick and this time, foobar reported al was ok.

So, I think this is a bug in the samba package, as copying over samba did not work and an USB stick worked fine.
I think I should give more info, but I don't know what to report.

$ apt-cache policy samba
samba:
  Installed: 2:3.4.0-3ubuntu5.1
  Candidate: 2:3.4.0-3ubuntu5.2
  Version table:
     2:3.4.0-3ubuntu5.2 0
        500 http://nl.archive.ubuntu.com karmic-proposed/main Packages
 *** 2:3.4.0-3ubuntu5.1 0
        500 http://nl.archive.ubuntu.com karmic-updates/main Packages
        100 /var/lib/dpkg/status
     2:3.4.0-3ubuntu5 0
        500 http://nl.archive.ubuntu.com karmic/main Packages

$ apt-cache policy ntfs-3g
ntfs-3g:
  Installed: 1:2009.4.4-1ubuntu4
  Candidate: 1:2009.4.4-1ubuntu4
  Version table:
 *** 1:2009.4.4-1ubuntu4 0
        500 http://nl.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Ernst (ernst-blaauw) wrote :
Revision history for this message
Ernst (ernst-blaauw) wrote :

I have some more information:
- this does not happen if the desktop computer is running Windows 7 (So I'm copying from my latop with Karmic 2.6.31.15 to the Windows computer).

- Currently, the share is mounted via /etc/fstab. If I mount the share using the Gnome interface (Places > Connect to server), the corruption does not happen. (It doesn't matter if I run Win7 or Linux)

I mount the share with the following entry in /etc/fstab:

//172.19.3.4/Media /home/ernstblaauw/media cifs comment=sshfs,username=user,password=pass,noauto,nounix,users,exec,uid=1000,gid=1000,domain=domain,iocharset=utf8 0 0

The comment is used to unmount the share if the network goes down and remount it if the network comes up.

Do I have weird options in my fstab entry? I think this bug is quite severe, I hope it attracts some attention.

Revision history for this message
Chuck Short (zulcss) wrote :

This might be bug 6606 which is fixed upstream.

Regards
chuck

Changed in samba (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Changed in samba:
status: Unknown → Fix Released
Revision history for this message
Ernst (ernst-blaauw) wrote :

Does 'Fix Released' means this is fixed in an Ubuntu package (I would like to test!) or does it mean the bug is fixed upstream?
I don't know how to apply the patch of the upstream bug report, so with only that patch, I will not be able to test this.

Revision history for this message
Ernst (ernst-blaauw) wrote :

I think this bug deserves a higher priority, because it seems the copy process finishes successfully, but people end up in having corrupted files. I think this behavior is easily repeated by other people and could do a lot of harm.

So please, set the priority to 'critical' (or high). For example, bug #453579 which also involves data loss has status critical! So this bug deserves such priority too.

Revision history for this message
Thierry Carrez (ttx) wrote :

Agreed.

Changed in samba (Ubuntu):
importance: Medium → High
status: Confirmed → Triaged
Revision history for this message
Raptor 2101 (raptor2101) wrote :

Since "smbfs (2:3.4.0-3ubuntu5)" i experience same problems. I've mounted my homedirs via CIFS. All works fine (servernio to get KDE-apps working). After this update i noticed some "extrem" file errors while using Opera (HD-Cache enabled) and Firefox. Trying to download something always causes a damaged file. Every large file (> 500kb) results in a damaged file.

If i switch from servernio to directio. Firefox and Opera works fine, now javaws, skype and some other apps craches cause of file corruption.

But copying files from or to some "normal" mounts works perfectly.

smb.conf
>>[homes]
>> comment = Home Directories
>> browseable = yes
>> writeable = yes
>> available = yes
>> guest ok = no
>>
>> [Media]
>> path = /storage/Media
>> comment = Mediensammlung
>> nt acl support = yes
>> browsable = yes
>> writeable = yes
>> available = yes
>> guest ok = no
>> inherit permissions = yes
>> hide dot files = yes

mounting via pam_mount

>><volume user="*" fstype="cifs" server="<serverip>" path="%(USER)" mountpoint="/home/%(USER)" options="rw,hard,iocharset=utf8,serverino"/>
>><volume user="*" fstype="cifs" server="<serverip>" path="media" mountpoint="/mnt/Media" options="rw,hard,iocharset=utf8"/>

/proc/fs/cifs/DebugData
>>Display Internal CIFS Data Structures for Debugging
>>---------------------------------------------------
>>CIFS Version 1.60
>>Active VFS Requests: 790
>>Servers:
>>1) Name: 192.168.99.2 Domain: WORKGROUP Uses: 5 OS: Unix
>> NOS: Samba 3.4.0 Capability: 0x80f3fd
>> SMB session status: 1 TCP status: 1
>> Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
>> Shares:
>> 1) <Mount1> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f PathComponentMax: 255 Status: 0x1 type: 0
>> 2) <Mount2> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f PathComponentMax: 255 Status: 0x1 type: 0
>> 3) <Mount3> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f PathComponentMax: 255 Status: 0x1 type: 0
>> 4) <Mount4> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f PathComponentMax: 255 Status: 0x1 type: 0
>> 5) <Mount5> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f PathComponentMax: 255 Status: 0x1 type: 0
>>
>> MIDs:

dmesg and /var/log/syslog shows nothing interesting even with “echo 3 > /proc/fs/cifs/cifsFYI”

Revision history for this message
Ernst (ernst-blaauw) wrote : Re: [Bug 491288] Re: File corruption after copying files via samba from Karmic to Karmic

On Lucid Alpha 2, it looks like the bug is fixed: I cannot reproduce it like
I did it before.

$ apt-cache policy samba
samba:
  Installed: 2:3.4.3-2ubuntu2
  Candidate: 2:3.4.3-2ubuntu2
  Version table:
 *** 2:3.4.3-2ubuntu2 0
        500 http://nl.archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status

On Tue, Jan 12, 2010 at 23:25, Raptor 2101 <email address hidden> wrote:

> Since "smbfs (2:3.4.0-3ubuntu5)" i experience same problems. I've
> mounted my homedirs via CIFS. All works fine (servernio to get KDE-apps
> working). After this update i noticed some "extrem" file errors while
> using Opera (HD-Cache enabled) and Firefox. Trying to download something
> always causes a damaged file. Every large file (> 500kb) results in a
> damaged file.
>
> If i switch from servernio to directio. Firefox and Opera works fine,
> now javaws, skype and some other apps craches cause of file corruption.
>
> But copying files from or to some "normal" mounts works perfectly.
>
> smb.conf
> >>[homes]
> >> comment = Home Directories
> >> browseable = yes
> >> writeable = yes
> >> available = yes
> >> guest ok = no
> >>
> >> [Media]
> >> path = /storage/Media
> >> comment = Mediensammlung
> >> nt acl support = yes
> >> browsable = yes
> >> writeable = yes
> >> available = yes
> >> guest ok = no
> >> inherit permissions = yes
> >> hide dot files = yes
>
> mounting via pam_mount
>
> >><volume user="*" fstype="cifs" server="<serverip>" path="%(USER)"
> mountpoint="/home/%(USER)" options="rw,hard,iocharset=utf8,serverino"/>
> >><volume user="*" fstype="cifs" server="<serverip>" path="media"
> mountpoint="/mnt/Media" options="rw,hard,iocharset=utf8"/>
>
> /proc/fs/cifs/DebugData
> >>Display Internal CIFS Data Structures for Debugging
> >>---------------------------------------------------
> >>CIFS Version 1.60
> >>Active VFS Requests: 790
> >>Servers:
> >>1) Name: 192.168.99.2 Domain: WORKGROUP Uses: 5 OS: Unix
> >> NOS: Samba 3.4.0 Capability: 0x80f3fd
> >> SMB session status: 1 TCP status: 1
> >> Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
> >> Shares:
> >> 1) <Mount1> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f
> PathComponentMax: 255 Status: 0x1 type: 0
> >> 2) <Mount2> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f
> PathComponentMax: 255 Status: 0x1 type: 0
> >> 3) <Mount3> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f
> PathComponentMax: 255 Status: 0x1 type: 0
> >> 4) <Mount4> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f
> PathComponentMax: 255 Status: 0x1 type: 0
> >> 5) <Mount5> Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x1002f
> PathComponentMax: 255 Status: 0x1 type: 0
> >>
> >> MIDs:
>
> dmesg and /var/log/syslog shows nothing interesting even with “echo 3 >
> /proc/fs/cifs/cifsFYI”
>
> --
> File corruption after copying files via samba from Karmic to Karmic
> https://bugs.launchpad.net/bugs/491288
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Thierry Carrez (ttx)
Changed in samba (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
littlebat (dashing-meng) wrote :

I met the similar bug when I copy a file from Ubuntu 6.06 Server into Ubuntu 9.10 via samba server on Ubuntu 9.10.

Server end:
OS: Ubuntu 9.10 upgrade from Ubuntu 9.04 Netbook Remix
samba server version: Samba 3.4.0
the version result of "dpkg -s samba" is: Version: 2:3.4.0-3ubuntu5.6

the content in /etc/samba/smb.conf:
[global]
    workgroup = WORKGROUP
    security = share
    guest ok = yes
[test]
    comment = For testing only, please
    path = /var/sambatest
    browseable = yes
    writeable = yes

Client end:
OS: Ubuntu 6.06 Server
mount.cifs version: 1.10
mount commend line: sudo mount.cifs //192.168.1.100/test /media/tmp -o guest,rw

When copy a *.tar.gz file from Ubuntu 6.06 into Ubuntu 9.10, the file become corrupted.

execute "file" command in Ubuntu 6.06 on the initial good file:
file wpaudio.tar.gz
wpaudio.tar.gz: gzip compressed data, from Unix

execute "file" command in both Ubuntu 6.06 and Ubuntu 9.10 on the corrupted file:
file wpaudio.corrupted.tar.gz
wpaudio.corrupted.tar.gz: data

the corrupted file can't be extracted with "tar xfvz wpaudio.corrupted.tar.gz", it reports:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors

I attached these two files.

After read this reported bug, I also test copy a mp3 file through samba. Although the copied mp3 file on Ubuntu 9.10 can be played by smplayer, but when I execute "file" command on it, it says:
file *.mp3
test.mp3: data

When I execute "file" command on the good one in Ubuntu 6.06, it says:
file *.mp3
test.mp3: MPEG ADTS, layer III, v1, 192 kBits, 44.1 kHz, JntStereo

I think this mp3 is corrupted too.

I compile a samba 3.5.1 from source on Ubuntu 9.10, and repeat the copy process from Ubuntu 6.06 to Ubuntu 9.10 through samba 3.5.1 server on Ubuntu 9.10. And no error found.

Revision history for this message
littlebat (dashing-meng) wrote :

I met the similar bug when I copy a file from Ubuntu 6.06 Server into Ubuntu 9.10 via samba server on Ubuntu 9.10.

Server end:
OS: Ubuntu 9.10 upgrade from Ubuntu 9.04 Netbook Remix
samba server version: Samba 3.4.0
the version result of "dpkg -s samba" is: Version: 2:3.4.0-3ubuntu5.6

the content in /etc/samba/smb.conf:
[global]
    workgroup = WORKGROUP
    security = share
    guest ok = yes
[test]
    comment = For testing only, please
    path = /var/sambatest
    browseable = yes
    writeable = yes

Client end:
OS: Ubuntu 6.06 Server
mount.cifs version: 1.10
mount commend line: sudo mount.cifs //192.168.1.100/test /media/tmp -o guest,rw

When copy a *.tar.gz file from Ubuntu 6.06 into Ubuntu 9.10, the file become corrupted.

execute "file" command in Ubuntu 6.06 on the initial good file:
file wpaudio.tar.gz
wpaudio.tar.gz: gzip compressed data, from Unix

execute "file" command in both Ubuntu 6.06 and Ubuntu 9.10 on the corrupted file:
file wpaudio.corrupted.tar.gz
wpaudio.corrupted.tar.gz: data

the corrupted file can't be extracted with "tar xfvz wpaudio.corrupted.tar.gz", it reports:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors

I attached these two files.

After read this reported bug, I also test copy a mp3 file through samba. Although the copied mp3 file on Ubuntu 9.10 can be played by smplayer, but when I execute "file" command on it, it says:
file *.mp3
test.mp3: data

When I execute "file" command on the good one in Ubuntu 6.06, it says:
file *.mp3
test.mp3: MPEG ADTS, layer III, v1, 192 kBits, 44.1 kHz, JntStereo

I think this mp3 is corrupted too.

I compile a samba 3.5.1 from source on Ubuntu 9.10, and repeat the copy process from Ubuntu 6.06 to Ubuntu 9.10 through samba 3.5.1 server on Ubuntu 9.10. And no error found.

Revision history for this message
littlebat (dashing-meng) wrote :
Revision history for this message
littlebat (dashing-meng) wrote :

BTW: the little *.tar.gz file (e.g., only compressed from a text file include only one line text) has no error when copy through Ubuntu 9.10 samba server.

Chuck Short wrote on 2009-12-07:
 This might be bug 6606 which is fixed upstream. The link of "bug 6606: https://bugs.launchpad.net/bugs/6606 " is wrong.

Revision history for this message
littlebat (dashing-meng) wrote :

Copying file from Windows XP to my Ubuntu 9.10 via samba server on Ubuntu 9.10 has no errors.
Copying file from Ubuntu 9.10 to a client end via samba server on Ubuntu 9.10 has no errors too.

Changed in samba:
importance: Unknown → Critical
Changed in samba:
importance: Critical → Unknown
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.