Ubuntu

gedit fails to save files over smbfs/cifs

Reported by Dhonn Lushine on 2006-03-13
296
This bug affects 35 people
Affects Status Importance Assigned to Milestone
SSHFS Mounter
Undecided
Unassigned
gedit
Confirmed
Medium
gedit (CentOS)
New
Unknown
gedit (Ubuntu)
Low
Ubuntu Desktop Bugs

Bug Description

Saving files over a cifs/smbfs server doesnt work. You can open file, edit then save perfectly. But repeated saves after give you this error:

"The file /home/dhonn/website/arrays.php has been modified since reading it. If you save it, all the external changes could be lost. Save it anyway?"

The think is lying to me because I havent made any external changes.

When I click "Save Anyway", i get this error:

"Could not save the file /home/dhonn/website/arrays.php."

But on the third try it works just fine.

Here are the error messages, btw there are also GUI glitches too:
http://dhonn.com/images/gedit-0.jpg
http://dhonn.com/images/gedit-1.jpg

Phil Bull (philbull) wrote :

Thanks for the report.

What versions of the following packages do you have installed?

gedit
libgnome-vfs0
libgnome-vfs-common
libsmbclient

If you run gedit in the terminal and reproduce this issue, are there any useful error messages?

Thanks

Changed in gedit:
status: Unconfirmed → Needs Info
Dhonn Lushine (dhonn) wrote :

This happens to all my installations and only with gedit. Other editors are all fine.

I ran gedit in terminal and theres no error output.

Also the weird thing is that the permissions on the file change from the default setting that it was.

Its like gedit is renaming the file to a back up file, then creating a new file and dumping text to it.

Here are the versions that im running:

gedit 2.13.93-0ubuntu1
gnome-vfs 1.0.5-5.3
libgnome-vfs 1.0.5-5.3
libsmbclient 3.0.21b-1ubuntu2

Phil Bull (philbull) wrote :

gedit does save a file called 'filename.ext~' when you edit a document, so it could be this which is causing the problem.

Can you update to the latest, 2.14.0-0ubuntu1, gedit version please?

Dhonn Lushine (dhonn) wrote :

I've upgraded to 2.14.0-0ubuntu1. Nothing new I still get the same problem.

Phil Bull (philbull) wrote :

Thanks.

Can anyone else confirm this issue?

Sebastien Bacher (seb128) wrote :

Do you have the issue if you don't use the automatic backup file option? How does smbfs/cifs work, could you describe a simple way to set up it to figure if that happens for somebody else too?

Dhonn Lushine (dhonn) wrote :

Automatic backup has been off the whole time. I turned it off because of this and still it has the problem.

I simply made a folder website
I then have an init.d script that executes this code
mount -t cifs -o password= //192.168.1.100/website /home/dhonn/website

I now can edit any file in the website folder with any program other than gedit just fine.

Here is my simple smb.conf file:

I've omitted all but the changes Ive personally made

security = share

[website]
        comment = Website
        guest ok = yes
        read only = no
        path = /home/dhonn/website
        force user = dhonn
        force group = dhonn
        case sensitive = yes
        public = yes
        browseable = no

this smb.conf file is on my server

I have no clue what gedit is doing but its not acting right. And yes its just gedit. No other program has this problem.

I'll give you a run down of what im doing:

Create a new text file in gedit.
Save it in the website folder.
Click save again and its giving me an error like I've shown you before and I click Save Anyway.

Now if i start to edit the file then save. It gives me the same error again and at the same time changing the file to excutable.

Here is the error again:

"The file /home/dhonn/website/Unsaved Document 1 has been modified since reading it.

If you save it, all the external changes could be lost. Save it anyway?"

There is nothing externally making changes to my file.

So could the problem be samba altering the file after Ive made ive saved the file?

Dhonn Lushine (dhonn) wrote :

I think the problem is how gedit detects changes.

Phil Bull (philbull) on 2006-03-27
Changed in gedit:
assignee: nobody → desktop-bugs
status: Needs Info → Unconfirmed
Sebastien Bacher (seb128) wrote :

Thank you for the details on that, it does open the dialog about external changes on my box but does open the "Could not save the file ..." one, I've forwarded it upstream: http://bugzilla.gnome.org/show_bug.cgi?id=336738

Changed in gedit:
status: Unconfirmed → Confirmed
Matt Zimmerman (mdz) wrote :

This bug has an invalid bug watch. Please check it, and either correct or
remove it as appropriate.

04:18:11 WARNING Didn't find bug u'38091' on http://bugzilla.gnome.org

Matt Zimmerman (mdz) wrote :

Sorry, that error message should have been:

04:18:11 WARNING Didn't find bug u'34813' on http://bugzilla.gnome.org

Changed in gedit:
status: Unconfirmed → Confirmed
Glutexo (glutexo) wrote :

I use gedit-2.16.1-0ubuntu2 and I can confirm this issue: any attempt to save a file placed on cifs fails with an error message.

I would personally mark this bug with high or even critical priority as the text-editor (in this case the default text-editor in Ubuntu) and its capability to save files is an essential function on every system.

Kuropka (d2) wrote :

I second the proposal from Glutexo to mark this as a critical bug.

Daniel Holbach (dholbach) wrote :

From: https://wiki.ubuntu.com/Bugs/Importance

Critical: A bug which has a severe impact on a large portion of Ubuntu users
Medium: A functionality bug of the standard variety. Most bugs are of Medium severity, for example:
    * Has moderate impact on a core application
    * Has a severe impact on a non-core application

It's a bug causing problems, but it's not a critical bug as it won't stop Ubuntu from being released.

Sebastien Bacher (seb128) wrote :

That bug is not high priority because only few people use a mount like that

Peter Würtz (pwuertz) wrote :

I disagree, this bug renders Ubuntu/Gnome useless in situations when working with other workstations in a domain.

Having a central file server for user and group data is very common, like pam-mounting a users home when logging in or just using a common cifs share for a group of workers.

From: https://wiki.ubuntu.com/Bugs/Importance
High - Has a severe impact on a small portion of Ubuntu users

In my opinion, being unable to save textfiles is a severe impact, this bug should be marked as high.
This bug is pending long over one year now and we are talking about a text editors vital function!

Peter Würtz (pwuertz) wrote :

this is what happens when saving a file in gedit

[-1179854107.516901 (0.000281)] gedit-document-saver.c:1444 (gedit_document_saver_save)
[-1179854107.516884 (0.000017)] gedit-prefs-manager.c:528 (gedit_prefs_manager_get_backup_extension)
[-1179854107.516873 (0.000011)] gedit-prefs-manager.c:232 (gedit_prefs_manager_get_string)
[-1179854107.516859 (0.000015)] gedit-prefs-manager.c:522 (gedit_prefs_manager_get_create_backup_copy)
[-1179854107.516845 (0.000013)] gedit-prefs-manager.c:204 (gedit_prefs_manager_get_bool)
[-1179854107.516824 (0.000021)] gedit-document-saver.c:976 (save_local_file)
[-1179854107.516811 (0.000014)] gedit-document.c:1094 (document_saver_saving)
[-1179854107.516793 (0.000018)] gedit-document.c:1141 (document_saver_saving) save progress: 0 of 0
[-1179854107.516776 (0.000017)] gedit-tab.c:1084 (document_saving) 0/0
[-1179854107.509657 (0.007119)] gedit-document-saver.c:501 (save_existing_local_file)
[-1179854107.508032 (0.001625)] gedit-document-saver.c:598 (save_existing_local_file) tmp file moving strategy
[-1179854107.499098 (0.008934)] gedit-document-saver.c:197 (write_document_contents)
[-1179854106.405315 (1.093783)] gedit-document-saver.c:670 (save_existing_local_file) could not rename original -> backup

Peter Würtz (pwuertz) wrote :

in line 670, gedit tries to rename the file to a backup file... like moving "testfile" to "testfile~"

if (rename (saver->priv->local_path, backup_filename) != 0)

I checked "local_path" and "backup_filename", they are correct. I also wrote a small test application using "rename()" from stdio.h and renamed the same files on the mounted cifs filesystem, which works.

I'm not a gnome developer, could someone help me out here please? I assume the rename() function is not the rename function from stdio.h, does gnome implement its own rename?

Peter Würtz (pwuertz) wrote :

Ok, this is the problem:

Gedit opens a file, moves the original file to a backup file while keeping the file open, and finally deletes the backup file if you choose not to keep backups.
The rename method sets errno = ETXTBSY, so moving the original file fails.

I don't think moving/deleting open files on purpose is a good idea, although it works for most linux file systems. But its definitely a bad idea for network file systems like sshfs and cifs, which of course fails.

Sebastien Bacher (seb128) wrote :

Discussing the bug setting will not make the bug fixed faster there is thousand of desktop bugs open at the moment and the desktop team are limited ressources, thank you for working on it though

Tim Butler (timbutler) wrote :

Sebastien: From reading the comments Peter has added some useful information to the bug report to assist in fixing the bug.

The importance is a hard one to gauge, but it certainly heavily affects corporate / business users (including myself).

Sebastien Bacher (seb128) wrote :

Tim, I didn't say the comments were not useful, discussing the settings is not really though. Maybe somebody could discuss that upstream, they know the code better since they write it, we mainly distribute it and fix bugs when there is one we want to get fixed for next Ubuntu version

darko (darko2) wrote :

I have the major problem with this bug too. It is very disturbing since gedit is default text editor. I believe there is many people affected by this bug.

It's NOT a Gedit bug. It's a Samba (cifs-protocol) bug. The same result using Geany, Vim and Eclipse working with files over CIFS (Windows 2003 Server). All of them applications with file-changes detection.

The issue is reported in several forums and lists:
http://www.nabble.com/multiple-problems-moving-up-from-smbfs-to-cifs-t3884792.html
https://bugzilla.samba.org/show_bug.cgi?id=3551
https://bugzilla.samba.org/show_bug.cgi?id=4076

For people working in a mixed net (linux & windows machines) over a Windows 2003 file-server it's a BIG issue. Very very annoying. I work as app/web developer using Eclipse, everytime I save a file I have an alert when I write something "The file has been changed on the filsesystem, do you want to overwrite the changes?", then I choose "Yes/No", then another alert "The file has been changed on the filesystem. do you want to load the changes?". If reload latest changes (after save) will be lost.

Everytime you save, everytime you see the alerts (even if you only change to another application and back after save). Think about it working in a project, saving and testing every code change.

Severe impact on professionals/developers working with Ubuntu over Smb/Cifs file server.

Sebastien Bacher (seb128) wrote :

Does anybody still get the bug with the cifs version from gutsy?

jaroslav (mojzis) wrote :

I still have that kind of problem. I am able to edit text files with vim on a windows fileserver mounted like
/sbin/mount.cifs //serverName ./localFolderName iocharset=utf8, username=myUserName
but while trying to edit them with Gedit I get the error Can not save file xxx.

Massimo32 (massimo-modica) wrote :

I have the same problem in Feisty using gedit and eclipse, but not with vi and nano.
The file server is Debian Sarge.

I also get the same problem (warning that someone else modified file after save) in Feisty with Eclipse. Somehow I guess that it migth be cause with server/client time sync, because after running ntpdate on both, it happens only occasionally. Maybe when part or the second differs. But that's just my guess.

I see a note about someone fixing this compiling latest cifs module:
https://bugzilla.samba.org/show_bug.cgi?id=4076#c14

also, I guess this could be related with:

from 'man smb.conf'
--------------
 dos filetimes (S)
          Under DOS and Windows, if a user can write to a file they can change the timestamp on it. Under POSIX semantics, only the owner of the file or
          root may change the timestamp. By default, Samba runs with POSIX semantics and refuses to change the timestamp on a file if the user smbd is
          acting on behalf of is not the file owner. Setting this option to
           yes allows DOS semantics and smbd(8) will change the file timestamp as DOS requires. Due to changes in Microsoft Office 2000 and beyond, the
          default for this parameter has been changed from "no" to "yes" in Samba 3.0.14 and above. Microsoft Excel will display dialog box warnings
          about the file being changed by another user if this parameter is not set to "yes" and files are being shared between users.

          Default: dos filetimes = yes
--------------

but changing dos filetimes option does not solve the problem

Changed in gedit:
importance: Medium → Low
status: Confirmed → Triaged
acabre (acabre-eli) wrote :

I also get the same problem in Fiesty w/ gedit. As a couple of the duplicate bugs indicate, the same problem exists with sshfs, which i believe is based on fuse, for what its worth.

acabre (acabre-eli) wrote :

Above I meant to say that the problem exists in Gutsy... it is broken in fiesty though :)

unclebob (ralfhedenhos) wrote :

I have got this same problem also .... very irritating :(

Two things:

1. The problem is not in gedit, it's in SAMBA (smbfs) over CIFS
2. Priority Low? There is no way to have an hybrid network with this
problem. A windows 2003 as server with CIFS is more than usual in many
companies nowadays. It's a very big syncronization/data loss problem for
desktop users, administrators and automatic applications/scripts.

A fix is a must IMO.

Sebastien Bacher (seb128) wrote :

This bug should have an another task or be reassigned if that's not a gedit bug or the corresponding maintainer will not receive the bug and comments. What is lacking there is somebody with a setup to trigger the issue wanting to debug it, not a settings change.

Crashmaxx (crashmaxx) wrote :

I don't think this is a samba bug, as I can confirm the bug, but with sshfs instead. It may be a fuse bug, though since it seems to effect only gedit, I still would think that gedit has the bug. I can repeat this one all day long, so let me know if you need some debugging logs.

acabre (acabre-eli) wrote :

I just want to bump what Crashmaxx says. All that is necessary to reproduce this error is to mount a remote share to a folder with sshfs, and try to save with a modified file with Gedit. I just checked Emacs, KDevelop, and even OpenOffice Writer. All can open, read, and write a file over sshfs. Gedit cannot. I'm with Crashmaxx too, if there is anything I can do to make debugging this easier, I'm all for it!

I was experiencing this problem with Eclipse. File was saved, but there were occasional alerts about file being modified. I guess it has something to do with file timestams handling.

As Laurynas Batkus said it's present in Eclipse too. At work I've reproduced
the error everyday. I can reproduce the error with Gedit, Geany and Eclipse.

At work I'm using Gutsy, the server is a Windows 2003 Server with all the
employees folders and a shared space. In my case a total of 4 mounted
(smbfs) CIFS filesystems with authentication. No sshfs at all.

Peter Würtz (pwuertz) wrote :

Guys, please actually read the stuff others wrote before...

As I said, the problem with gedit is the "save" routine. It relies on moving the file that is being edited while the filehandle is kept open. This works for most filesystems, but it fails on cifs and sshfs (by the way, it works with smbfs). There are 2 ways to fix this:
1. do not move open files
2. fix support for moving open files in cifs and sshfs

I would just change the save procedure and go with the first solution, but the gedit devs don't like the idea of changing their way of saving files because any other solution would require a full copy of the text file (for backup) or open up racing conditions if someone else tries to edit the same file.

Hugh Hyatt (hughhyatt) wrote :

This problem started occurring for me on Ubuntu 7.04. With my upgrade to Ubuntu 7.10, the problem disappeared. Hopefully this will be some kind of clue as to what's going on, though I don't know enough to figure it out myself.

Jon Estlander (jon-estlander) wrote :

Folks,
I'm seeing this also on Ubuntu 7.04 using a local vfat mount...

# mount | grep work
/dev/hda3 on /work type vfat (rw,sync,utf8,umask=007,gid=46,uid=1000)

Gedit version is 2.18.1-0ubuntu1.

High_Yield (wolf-bill) wrote :

A similar but worse bug here: https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/177710

The gedit saving process IMO needs a full review - not a "run around" - this thread is eerily familiar to some of my old M$ support chains.

- There is(are multiple) a problem
- It is a commonly used, not kernel but critical, piece of software tagged as the "default" text editor for all things ubuntu.
- And, it's deleting files in my case.

I'm sure to get flamed but, hopefully this will help someone else trying to get away from M$ into something that may be a viable alternative.

- B

acabre (acabre-eli) wrote :

Sorry to hear about the very serious deletion bug. As far as I can see, it is still open and set to high importance. I also understand your disaffection with gedit after such a problem, and sympathize with you. However, I wouldn't issue such a sweeping condemnation of gedit based so little information. If you read Peter's earlier comments, this bug is largely related to gedit's extremely conservative saving procedure, and its resolution has been delayed by a general desire to maintain the robustness of the saving protocol by not introducing race conditions. I have a hunch (which, by all rights, could easily be wrong) that 177710 is probably somewhat unrelated to the issues here. The dev's are usually good about fixing critical bugs like this.

High_Yield (wolf-bill) wrote :

Bro - first and foremost a text editor needs to "correctly save" files after editing them. If it cannot do that properly then perhaps a "sweeping assessment" is in order don't you think?

If your new hard disk supported SATA4/UDMA8, quintuple buffering, had a 2 gig cache but when you tried to use it, it deleted rather than saving bytes - what would you do? Maybe look for and plug in an old IDE drive?

Plus,
- the first post on this bug was in early 2006 (2006-03-14) and it's almost 2008 now...
- not "fixing" to retain "robustness"? What? I don't consider "accidental file deletion" robustness my man.
- this is not a trivial "bell and whistle" piece of functionality, this is saving files - a.k.a. critical.
- yadda yadda...

Take care.

Gianni Moschini (gianni.net) wrote :

I confirm, here in Gutsy, gedit fails to save existing file when the share is mounted with cifs, but works fine when the same share is mounted with smbfs.

geany work with both (smbfs and cifs)

Note: creating a file over cifs with gedit works fine. It's just the edition that cause problem.
Note²: the share is on a windows 2003 r2

High_Yield (wolf-bill) wrote :

This is not low priority guys...

ReWrite your "save" code.
OpenOffice saves to my Samba drive fine, so does Kate, etc...

The problem is not w/ Samba - it is your code. Please own up to that, drop the attitude, and fix the software.

Sadly I can hear you chuckle as you read this - but, the sad reality is that your software is buggy and needs attention.
Either the present crew will fix it or hopefully a competent new crew will be put in place.

- B

Lilian ROBERT (lilian-robert) wrote :

Hi,

Same problem for me. I use Ubuntu Gutsy in a mixed environment (Windows Server shares, linux samba shares). Gedit can't save modifications on an existing file located on a remote cifs share. Eclipse can save but often fires errors like "out of sync".

This is very annoying.

Thanks

Rik Meijer (rikmeijer) wrote :

Hello,

Here problems mentioned earlier are occuring in my Gutsy Installation (gedit not able to save/eclipse failes to keep files in sync). I'm seriously considering trying another distribution.

Rik

Matvei Fisenko (2matvei) wrote :

Confirmed, same message from gedit when editing file on cifs mounted partition.
Editing this file in other editors (openoffice) for example is fine.

Ubuntu 7.10, all updates installed.

Rik Meijer (rikmeijer) wrote :

I discovered that kate doesn't seem to have any problem saving files. Perhaps that is something to dive into...

André Pirard (a.pirard) wrote :

 Would bug 125887 be worth the trip?
Please warn them over there if any similarity found.
André.

amazing, the bug report is 2 years old!
I'm still experiencing this problem in fedora core 8. When saving cifs mounted files through vi, nano or kate, i don't see any problem. Only with gedit.

MountainX (dave-mountain) wrote :

I'm seeing what looks like the same bug in Hardy beta.

Lilian ROBERT (lilian-robert) wrote :

Maybe a developer will come here one day and run gedit in debug mode to tell us what is the cause of this error... I am suspecting a bug in smbfs, the same that makes Eclipse always telling me "out of sync" when I try to host my projects on a samba share.

This problem is one of the biggest that prevent me using Ubuntu in my enterprise :/

acabre (acabre-eli) wrote :

Peter Würtz has already diagnosed the issue (in https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/34813/comments/20 and again in https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/34813/comments/40), so its not a mystery.

A patch that would probably fix the issue has even been posted at http://bugzilla.gnome.org/show_bug.cgi?id=336738#c5 . There is just a lack of consensus as to whether the solution is better than the problem.

MountainX (dave-mountain) wrote :

I can confirm that only only is the problem present in Hardy beta, the workaround I used under Gutsy no longer solves the issue under Hardy. This is limited to gedit and the links acabre posted above clearly explain the situation.

For people who do a lot of work over network shares, it appears that the only solution is to not use gedit!

MountainX (dave-mountain) wrote :

CORRECTION for typo. I meant to type:

I can confirm that not only is the problem present in Hardy beta, the workaround I used under Gutsy no longer solves the issue under Hardy.

André Pirard (a.pirard) wrote :

Please note the similarities with bug #125887.
Same message. Happens only on alien filesystems.
125887 does not prevent saving files, though.
Would this problem happen on FAT32 too?
Wouldn't it be a time saver to analyze both problems at the same time.

MountainX (dave-mountain) wrote :

This particular bug, at least on Ubuntu Hardy beta, does prevent saving files. Under cifs on Gutsy, it was reported that files could be save after clearing the error message and retrying (maybe more than once). Under Hardy I can't make that work.

MountainX (dave-mountain) wrote :

Peter Wuertz has made some good suggestions. Why haven't they been considered?

Peter said:
(a) if backup enabled:
- copy, not move the original file to a backup file
- reset file pointer, overwrite the original file in-place

(b) if backup disabled:
- reset file pointer, overwrite the original file in-place

or just tell the user that gedit is not able to backup the file and proceed
with method (b) anyways if the user agrees

My opinion is that the developers don't like the idea of copying the complete file as a backup because copying isn't "efficient." However, that is a poor reason for not resolving this bug. Just do as Peter suggests and make a copy of the file! Many, many editors do that already and the performance hit is not noticeable at all. (Other editors give the user config options, as Peter also suggests.)

Please fix this! Like many people have said, ALL my documents are on Windows shares. So this is a big deal for me and a lot of people like me.

MountainX (dave-mountain) wrote :

See proposal here:
http://ubuntuforums.org/showthread.php?t=738168

(Peter Würtz, let's get in touch with each other. Please contact me through my profile at ubuntuforums.org.)

acabre (acabre-eli) wrote :

I think forking gedit is a little overboard. I am sure that a simple patch is all that is needed, and could be provided for those of us who need a resolution before the gedit dev's get around to fixing this.

I even think that a gedit plugin could probably be written to provide the same functionality. The great thing about open source software is where there is a manifest need, and people determined to fix it, patching or adapting an existing application is really easy. And if the patch is good enough, it gets merged.

MountainX (dave-mountain) wrote :

Unfortunately I am getting a lot more experience with this bug. I think the following points summarize the factors the combine to produce this bug:

1. the network share must reside on a Windows file server (or maybe another non-Unix-type file system).
2. the network file sharing protocol is cifs (and/or sshfs according to other related bugs).
3. the Linux clients run gedit, Geany, Vim, Eclipse or any other Linux app that attempts to move/rename an open file.

And in Ubuntu Hardy, smbfs also seems to cause the same problem that cifs does.

I think the prior comments make it clear that the gedit devs don't plan to fix this bug. Neither do the cifs devs. So anyone waiting for the devs to get around to fixing it may have a long wait. (Also, if you read the above comments you'll see that at least one patch has been submitted but it isn't favored by the devs.)

Henri Cook (ph8) wrote :

This is stopping me working properly on Hardy Beta! Someone fix the bug already!

boris (boriscosic) wrote :

I am sure this is not a proper way to fix it but I don't know enough about gedit to trace this all the way. From what I can tell though the error spawns in gedit-local-document-saver.c and it doesn't occur in vi:

 if (lsaver->priv->doc_mtime > 0 &&
            statbuf.st_mtime != lsaver->priv->doc_mtime &&
            ((saver->flags & GEDIT_DOCUMENT_SAVE_IGNORE_MTIME) == 0))
        {
                g_set_error (&lsaver->priv->error,
                             GEDIT_DOCUMENT_ERROR,
                             GEDIT_DOCUMENT_ERROR_EXTERNALLY_MODIFIED,
                             "Externally modified");

                goto out;
        }

I've tried setting ahead and behind times on both server but I still keep getting the error. Finally I commented out the entire if statement and rebuild gedit. Works fine now but I am definitely missing out on time stamp changes. Right now it's so frustrating though and I love the editor so until gedit team has an official fix this will do.

High_Yield (wolf-bill) wrote :

I'm back... I've posted my latest related Hardy results here: https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/177710

The issue STILL exists in Hardy - just like it occured in Gutsy.

- B

I think there are two different bugs overlapping in this ticket.
Over sshfs, gedit and anjuta (on gutsy and hardy), fail to save and display a message with something like 'You cannot save ...'. The problem and the message go away if the remote filesystem is mounted with sshfs -o uid=$UID. This seems to indicate that gedit and anjuta are checking the owner and permission bits of the file before trying to write instead of actually trying to save the file.
The issue on smbfs with file modified times might be a different issue altogether.

Alexander Blomen (ablomen) wrote :

I found a work-around that works for me (for files on a mounted smb share, with gedit 2.22.1)
Its a plugin that can be found here: http://chrisnicholls.ca/code/gedit-plugins/

It moves the original file to a temp directory and then saves the file.

DISCLAIMER:
I did not write the plugin, just found it on google.
Use the plugin at your own risk, it may not work in your case or damage your files or whatever.

Alejando Dubrovsky's fix for sshfs solved the gedit problem for me. It seems pretty silly that the gedit devs would place a restriction on you that the filesystem/os should handle.

Riccardo Cossu (riccardocossu) wrote :

Alejandro's fix doesn't work for me; I use Ubuntu 7.10 and have the problem with sshfs. I switched to another editor for that purpose... :-(

Sebastien Bacher (seb128) wrote :

those comment are not really useful there, there is enough users who confirmed the bug now what is required is somebody working on the issue rather

Sebastien Bacher (seb128) wrote :

closing the upstream samba task there since it doesn't watch any bug

Changed in sambaserver:
status: New → Invalid

On 2008-08-12 12:07, Sebastien Bacher wrote :
> the issue seems to be trigger only on some special setups and it should
> be sent to the people who write the software on bugzilla.gnome.org,
> nobody having the issue seems to be interested in doing that though
> that's why the bug has been closed
>
> (fat32) Unexpected "file modified by another process" warning
> https://bugs.launchpad.net/bugs/125887
>
The so-special setup you speak of is editing files on any FAT(32) disk
(eg USB Ramdrive) !!!
Is that really to be advertised as beyond the capabilities of Ubuntu?

Please note that some people even dare try to edit files on SMBFS !!!
And they're having the same kind of problem, described in Bug #34813.
On FAT32, the message is issued only if the file has been open in gedit
for quite a time, though.
I dropped Bug #34813 a note drawing the attention on the similarities
between the two bugs.
But they continue to mention SMBFS/CIFS exclusively.

Bug #125887 might at least be set to be a duplicate of Bug #34813
instead of "Invalid".
If only Bug #34813's title was changed to include FAT(32) too.
> Your comments, bug reports, patches and suggestions will help fix bugs
> and improve future releases.
By closing bugs?

Brent Farrell (farrelbj) wrote :

I just noticed this bug still exists on Ubuntu 8.04 with the most recent updates as of the time of posting. I did a bunch of digging around on Google to see if there was any fix or workaround and came up empty. I did notice that Red Hat seems to have fixed the problem in RHEL 5 (http://rhn.redhat.com/errata/RHBA-2008-0019.html).

Since it seems that this is solvable when can we expect Ubuntu to have a solution?

Zelda (z3ldaf0x) wrote :

I am also having this bug on SSHFS filesystem. So it surely not a samba bug. It IS a gedit bug. If I delete the file that I want to save, it saves. If it exists - aka: I save it again - It fails. No matter if there is a backup or not.

mbsmooth (mbsmooth) wrote :

I had this issue as well, I found this workaround,
http://chrisnicholls.ca/2008/03/22/using-gedit-over-sshfs-or-smbcifs-without-being-annoyed/

Just disable the 'Create backup of files before saving' feature. Fixed for me on 8.04.

I too am experiencing this problem -- am not going to report versions etc. since the cause and solution are already known. Unfortunately, disabling backups did not work for me.

Are there any custom DEBs out there that have a patch applied for this?

-Scott

Or, alternatively, a GEdit plugin that I can install? This is greatly hindering my work right now and I have several end-of-semester reports due in the near future =/

-Scott

Scott Armitage wrote:
> Or, alternatively, a GEdit plugin that I can install? This is greatly
> hindering my work right now and I have several end-of-semester reports
> due in the near future =/
>
> -Scott
>
>
Hi Scott!

I had the same problem you have. Because all this bug fix take too long
I found the alternate solution which is maybe even better than bug fix
for Gedit. I'm using different default editor Geany which in my opinion
is better than Gedit. You could of course use any other in many
available editors. As I understand only Gedit have problem with saving
over cifs.

I forgot how I've changed default editor but I believe you have to
change line in "~/.local/share/applications/defaults.list" to
"text/plain=geany-usercustom.desktop". I'm sure you'll find solution on
the internet if that is not enough.

Darko

Thanks Darko, but this isn't a solution, it's a work-around. I am using
GEdit because a) I am very familiar with it and b) I have LaTeX setup with
it exactly the way I like. At this point in time, switching to another text
editor (regardless of whether I would ultimately think it was better than
GEdit or not) is not an option.

From what I gather, the problem seems to be that the GEdit devs have chosen
their way of saving files because they are convinced it is more efficient.
Maybe this is the case. I know that GEdit prides itself on having few
options and many sensible defaults, but maybe this issue is large enough
that it would warrant a checkbox in the preferences dialog so that the user
can choose which method of saving they prefer.

The code bloat due to adding an option like this would be minimal; the
biggest hit would be in the user-interface, which I do understand is an
issue with the devs, but sometimes defaults just aren't enough.

-Scott

On Fri, Dec 5, 2008 at 3:19 AM, Darko Vrsic <email address hidden> wrote:

> Scott Armitage wrote:
>
>> Or, alternatively, a GEdit plugin that I can install? This is greatly
>> hindering my work right now and I have several end-of-semester reports
>> due in the near future =/
>>
>> -Scott
>>
>>
>>
> Hi Scott!
>
> I had the same problem you have. Because all this bug fix take too long I
> found the alternate solution which is maybe even better than bug fix for
> Gedit. I'm using different default editor Geany which in my opinion is
> better than Gedit. You could of course use any other in many available
> editors. As I understand only Gedit have problem with saving over cifs.
>
> I forgot how I've changed default editor but I believe you have to change
> line in "~/.local/share/applications/defaults.list" to
> "text/plain=geany-usercustom.desktop". I'm sure you'll find solution on the
> internet if that is not enough.
>
>
>
> Darko
>

--
Scott Armitage, B.A.Sc., M.A.Sc. candidate
Space Flight Laboratory
University of Toronto Institute for Aerospace Studies
4925 Dufferin Street, Toronto, Ontario, Canada, M3H 5T6

Daevid Vincent (dae51d) wrote :

I have just slammed into this myself and wasted several hours trying to debug 'sshfs' thinking that was gone haywire. I usually use Eclipse PDT and my files saved fine. Then I was starting a new project, but didn't want the bloat of Eclipse just yet while I copied files into directories and modified basic template parameters. My files would save the very first time, but subsequent saves weren't working. I tried setting them to "666" and the upstream dirs to "777" and still it failed. I noticed that if I deleted the files from an ssh terminal, then clicked save in gedit they worked every time. The only other thing I noticed was there was a ~ (backup) file. I then turned that option off in gedit's preferences and now it saves all the time.

I can also edit and save from my desktop to the sshfs files with VIM no problemo (although I don't use ~ backup files on there either, so this may be a red-herring)

So this is certainly a strange bug with gedit and NOT sshfs.

I use Ubuntu 8.10 with all current updates.

Robie Basak (racb) wrote :

Unable to reproduce with gedit 2.24.2-0ubuntu1 and sshfs to an rsync.net account. Saving seems to work fine, regardless of whether the backup before saving option is selected or not.

The fix that Brent mentions appears to be for a previous version of gedit from comment #5 in the gnome bug, which modifies how files are saved. gedit 2.42 has two mechanisms to save files - local and gio (ie. sshfs/cifs) - presumably to address this issue - so that patch will no longer work (it would apply to local saves, not remote saves).

Carey Underwood (cwillu) wrote :

@Robie

Iirc, the gio pathway is unrelated to this bug: an sshfs mount is a
'local' mount (which is the root of the problem). Saving files to
gnome sftp:// and smb:// file urls works fine (which is why some of us
users stopped caring about this bug years ago :p).

If that's correct, then it's completely appropriate to not treat gio
urls differently, to do otherwise would just introduce a bug in _that_
system.

On Wed, Dec 24, 2008 at 9:38 AM, Robie Basak <email address hidden> wrote:
> Unable to reproduce with gedit 2.24.2-0ubuntu1 and sshfs to an rsync.net
> account. Saving seems to work fine, regardless of whether the backup
> before saving option is selected or not.
>
> The fix that Brent mentions appears to be for a previous version of
> gedit from comment #5 in the gnome bug, which modifies how files are
> saved. gedit 2.42 has two mechanisms to save files - local and gio (ie.
> sshfs/cifs) - presumably to address this issue - so that patch will no
> longer work (it would apply to local saves, not remote saves).

Robie Basak (racb) wrote :

Thanks cwillu, I understand now. I was confusing gio with native kernel-based mounts.

I was able to replicate the first part of the original bug as reported, but clicking "Save Anyway" always works for me.

I have patched gedit with an updated version of the patch that Brent mentioned above. The error goes away.

Please try:
  amd64 https://launchpad.net/%7Eracb/+archive/+files/gedit_2.24.2-0ubuntu2~basak1_amd64.deb
  i386 https://launchpad.net/%7Eracb/+archive/+files/gedit_2.24.2-0ubuntu2~basak1_i386.deb

Sebastien Bacher (seb128) wrote :

does anybody still get the issue in intrepid or jaunty?

Changed in gedit:
status: Triaged → Incomplete
Robie Basak (racb) wrote :

I got the issue in intrepid without my patch.

Changed in gedit:
milestone: none → ubuntu-9.04-beta
status: Incomplete → Confirmed

I still have the issue in intrepid with gedit over sshfs.
It works allright when I switch off 'Create a backup copy before saving'.

phredduk (eddienewitt) wrote :

Robie - Thanks for the patched version, works a treat!
Let's hope the Gedit team merge this fix, even if they have to implement it as an 'checkbox option' as someone suggested above

This bug's been bugging me since 7.10, 8.04 it was intermittent, and when I moved to 8.10 I was disappointed to see it was still there.

Cheers ;)

Justin Martin (frozenfire89) wrote :

This is purely speculation, but I think I know the reason why this bug occurs.

I've been getting this problem constantly over the past few days. I'm using SSHFS to mount my remote web server, which has of late been a fairly high-latency connection.

I have a feeling that this has something to do with the way gedit handles modified stamps.

I think that the modified stamp on files aren't set until they are finished saving, and because it's a high-latency mount, saving takes a few moments. When I start trying to edit the file again, gedit checks to see if the file has been modified by checking stamps, but since I "saved" a few moments ago, and the modified stamp says that it happened once the file finished saving on the remote end, it thinks there was an edit.

The only way I could conceive of this being fixable is if gedit has a configuration option to disable checking the modified stamp, or ignores what it perceives to be recent "modifications."

Robie Basak (racb) wrote :

Justin,

Does my package fix the problem for you?

My patch is just adapted from Red Hat's patch. This removes the assumption that a file can be renamed while it is open by closing files first before renaming them during the save process. On a normal Unix filesystem this is permitted. On Windows, for example, it isn't.

If my package does not solve your problem, then I think we are talking about two different bugs.

Robie

Justin Martin (frozenfire89) wrote :

I installed the patch, and it seems to have remedied the issue.

Thanks a bunch.

Robie,

Sorry for the late reply, it's been a while since I've had my laptop at work. Yes, your patch fixed the problem for me. Too bad they can't include this as an option in the default source =/

Thanks for your help!

-Scott

Justin Martin (frozenfire89) wrote :

Robie,

I'm trying to patch gedit on my work computer, but the link to your patch package is broken.

Could you re-upload this?

Thanks

Yuzem (yuzem) wrote :

Does anyone knows if there is a fix for hardy?
When I try to install it says:
Error: Dependency is not satisfiable: libglib2.0-0

Staten O. (toon0) wrote :

I get the same dependency error, but when I check synaptic package manager, it says it's installed.

ZAP (michaelzap) wrote :

@Robie: I tried your latest package, but it doesn't change this (buggy) behavior for me. I am running Ibex and editing files on a Buffalo NAS drive mounted in fstab with cifs (and my used id). Any idea what the reason might be?

Changed in gedit (Ubuntu):
milestone: ubuntu-9.04-beta → ubuntu-9.04

We're also seeing this issue on Eclipse, Geany, and Emacs, and gVim.

https://bugs.launchpad.net/gedit/+bug/34813/comments/39 also noticed this on other applications.

How can this bug be confirmed to gvim only?

elatllat (elatllat) wrote :

how is this Importance="Low"?
It affects anyone who works or plays on servers.
90% of linux users IMO

Changed in sshfs-mounter:
status: New → Confirmed
Alexander Menk (alex-menk) wrote :

Some days ago I thought it is a good idea to use cifs/smbmount instead of the gnome VFS to access our Debian based Samba shares (samba version is 3.0.24-6etch4). I am using Ubuntu 9.04.

- Cannot save files with gedit
- When opening .odt with Open Office, the seem to be opened readonly.
- The same operations work fine, when accessing the share using gnome-vfs

Sebastien Bacher (seb128) wrote :

> It affects anyone who works or plays on servers.

it's not a security issue nor a crasher and only an issue for people not using GNOME to access vfs locations but rather doing mounts using fstab there

DLCBurggraaff (burdi) wrote :

> only ... for people ... doing mounts using fstab

In other words: a lot of people.

Sean G (sean-gilbertson) wrote :

Note that there is a preference in Gedit that fixes this issue (Edit > Preferences > Editor > Create a backup copy of files before saving).

Solution documented here: http://blog.linuxtoday.com/blog/2009/05/gedit-wont-save.html

tim pezarro (tim-pezarro) wrote :

Hello,

I believe the fix below does not work in all cases. I continue to get
this error:

"Could not save the file
/media/directory_name/pezarro/t...save_error_workaround.txt
Unexpected error: Text file busy"

Here are the details for the cifs mount:
//filer_name/filer_folder /media/directory_name cifs
credentials=/root/.smbcredentials,workgroup=MyWorkGroup,uid=1000,gid=100
1,file_mode=0777,dir_mode=0777,rw

I am running Ubuntu 8.10. If migrating to Ubuntu 9.4 was thought to
remedy my trouble, I would certainly try it.

I quite like gedit and it would be nice to be able to use it error free
with my cifs mount. Another workaround is to use a different text editor
such as Gvim.

Cheers,

> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On
> Behalf Of Sean G
> Sent: Wednesday, July 22, 2009 1:50 PM
> To: Tim Pezarro
> Subject: [Bug 34813] Re: gedit fails to save files over smbfs/cifs
>
> Note that there is a preference in Gedit that fixes this
> issue (Edit > Preferences > Editor > Create a backup copy of
> files before saving).
>
> Solution documented here:
> http://blog.linuxtoday.com/blog/2009/05/gedit-
> wont-save.html
>
> --
> gedit fails to save files over smbfs/cifs
> https://bugs.launchpad.net/bugs/34813
> You received this bug notification because you are a direct
> subscriber of the bug.
>

tim pezarro (tim-pezarro) wrote :

I believe the fix below does not work in all cases. I continue to get this error:

"Could not save the file /media/directory_name/pezarro/t…save_error_workaround.txt
Unexpected error: Text file busy"

Here are the details for the cifs mount:
//filer_name/filer_folder /media/directory_name cifs credentials=/root/.smbcredentials,workgroup=MyWorkGroup,uid=1000,gid=1001,file_mode=0777,dir_mode=0777,rw

I am running Ubuntu 8.10. If migrating to Ubuntu 9.4 was thought to remedy my trouble, I would certainly try it.

I quite like gedit and it would be nice to be able to use it error free with my cifs mount. Another workaround is to use a different text editor such as Gvim.

    So, in summary:

- Affects the default text editor
- Open for 3.5 years now (!!!)
- Over 100 comments...
- Gedit blames CIFS. CIFS (and VirtualBox) blames Gedit. From virtualbox.org:

    Q: I get an error "Unexpected error: Text file busy." when trying to edit a file.
    A: When using gedit, this can happen on shared folders. This is a bug in gedit, not VB. Use a different editor.

    I'm working in a Big Organization with a CIO who's a Windows Lover. I've used virtualization to get around SafeBoot and other Windows-only garbage. I now have access to all the tools I know and love... *except* the text editor. Ye gods!

   Don't you want Ubuntu to integrate smoothly into a Windows-centric environment? See Bug #1.

   I agree with the many others who are stuck with this problem. This bug needs to be upgraded to Importance: High.

Sebastien Bacher (seb128) wrote :

The issue is not the bug settings but the lacks of person having the issue and wanting to look at the bug rather

Sebastien Bacher (seb128) wrote :

Changing to triaged

Changed in gedit (Ubuntu):
milestone: ubuntu-9.04 → none
status: Confirmed → Triaged
Sebastien Bacher (seb128) wrote :

Changing to triaged

Alex Meakins (alex-meakins) wrote :

I'm seeing this behavior with a fresh install of 9.10 (64bit) . It is incredibly irritating. That fact it has been >three years is stunning.

Sebastien Bacher (seb128) wrote :

> That fact it has been >three years is stunning.

There is thousands of bugs opened every months and limited ressources to work on those and smbfs is a power user thing and not something most users will experience with when using ubuntu you are welcome to work on the change though there

MountainX (dave-mountain) wrote :

> There is thousands of bugs opened every months and limited ressources to work on those and smbfs is a power user thing and not something most users will experience with when using ubuntu

See comment #108:
Don't you want Ubuntu to integrate smoothly into a Windows-centric environment? See Bug #1.

Daevid Vincent (dae51d) wrote :

Sebastien, your comment made me laugh. Linux *is* for power users. My grandmother or parents or even sister (who is on myspace all day long) would not use Linux. Anyone using gedit is most likely a power user as well because if they were just a "dumb user" typing a paper for school or a letter to a friend, they would be using Open Office write or some email front end or website front end to enter the text. Next, SAMBA is hardly a power user thing. If you're on ANY kind of network/LAN, you are no doubt using samba or the Microsoft equivalent of it. Lastly, the damn bug is THREE years old and NO other program has this problem. This is just typical of Linux developers. They always want to claim it's a desktop replacement and how great it is over Windows or OS-X, but then refuse to fix things as it's much sexier to implement new features than work on bugs. Or my other favorite is how they throw back the "why don't YOU fix it and submit a patch".

Robie Basak (racb) wrote :

I did post a patched version a long time ago that worked for some people but it was for Intrepid so is now out of date. I'm still running Intrepid so that makes it difficult for me to help.

It appears to me that there is more than one bug if a fix works for some but not for all. This makes the issue very confusing to a developer to fix.

Can I suggest that anyone who still has the bug does the following;

Install strace if it isn't already installed
Close all gedits
From a terminal, run: "strace gedit 2>&1|grep -v strace > /tmp/strace.log"
In the gedit that runs, do as little as possible to reproduce the fault
As soon as the fault occurs, go back to the terminal and press Ctrl-C to stop the logging immediately

Then post the files /tmp/strace.log and /proc/mounts making sure that they don't contain any confidential information you don't want to reveal, as well as the filename and location that you were saving to so the logs can be searched easily. strace.log will be quite large.

This information is essential for a developer to figure out what is going on without just guessing. I can't promise anything though - the amount of effort required all depends on the results.

acabre (acabre-eli) wrote :

I've attached two strace logs in case anybody is interested.

strace_first.log contains a strace of launching GEdit, opening a file over sshfs that had not been opened previously, making a change, successfully saving it, making another change, and being unable to save.

strace_second.log contains a strace of launching GEdit, opening this file that had been opened over sshfs before, and getting an error on trying to save

I'm on 9.04. In both tests, the "Create a backup copy of files before saving" as in the Editor preferences was checked. Unchecking this box solves this problem for me.

The file I'm opening is /home/straceuser/stracedir/stracemnt/test.txt , where stracemnt is a sshfs fuse mount.

I'm sure there are several people here, myself included, who would be willing to help troubleshoot this problem, if a dev was interested in un-triaging it.

elatllat (elatllat) wrote :

Thanks for that I was about to reboot to do just that;
because of this problem I use OS X for my laptop ATM

On Tue, Nov 10, 2009 at 10:25 PM, acabre <email address hidden> wrote:

> I've attached two strace logs in case anybody is interested.
>
> strace_first.log contains a strace of launching GEdit, opening a file
> over sshfs that had not been opened previously, making a change,
> successfully saving it, making another change, and being unable to save.
>
> strace_second.log contains a strace of launching GEdit, opening this
> file that had been opened over sshfs before, and getting an error on
> trying to save
>
> I'm on 9.04. In both tests, the "Create a backup copy of files before
> saving" as in the Editor preferences was checked. Unchecking this box
> solves this problem for me.
>
> The file I'm opening is /home/straceuser/stracedir/stracemnt/test.txt ,
> where stracemnt is a sshfs fuse mount.
>
> I'm sure there are several people here, myself included, who would be
> willing to help troubleshoot this problem, if a dev was interested in
> un-triaging it.
>
> ** Attachment added: "strace.tar.gz"
> http://launchpadlibrarian.net/35512943/strace.tar.gz
>
> --
> gedit fails to save files over smbfs/cifs
> https://bugs.launchpad.net/bugs/34813
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Light-Weight Text Editor for Gnome: Confirmed
> Status in SambaServer: Invalid
> Status in SSHFS Mounter: Confirmed
> Status in “gedit” package in Ubuntu: Triaged
>
> Bug description:
> Saving files over a cifs/smbfs server doesnt work. You can open file, edit
> then save perfectly. But repeated saves after give you this error:
>
> "The file /home/dhonn/website/arrays.php has been modified since reading
> it. If you save it, all the external changes could be lost. Save it
> anyway?"
>
> The think is lying to me because I havent made any external changes.
>
> When I click "Save Anyway", i get this error:
>
> "Could not save the file /home/dhonn/website/arrays.php."
>
> But on the third try it works just fine.
>
> Here are the error messages, btw there are also GUI glitches too:
> http://dhonn.com/images/gedit-0.jpg
> http://dhonn.com/images/gedit-1.jpg
>
>

Sebastien Bacher (seb128) wrote :

> Don't you want Ubuntu to integrate smoothly into a Windows-centric environment?

using GNOME to edit smb document over gvfs mount works fine which is the recommended desktop way, the issue is with fstab command line mounts there

> Linux *is* for power users.

Good, so power users should know how to use an another editor or workaround the issue

> Next, SAMBA is hardly a power user thing. If you're on ANY kind of network/LAN, you are no doubt using samba or the Microsoft equivalent of it.

Right, that's why GNOME can mount smb shares in an easy way and editing txt using gedit works just fine there, the issue is when you use command line to mount samba mounts in a system specific way

> but then refuse to fix things as it's much sexier to implement new features than work on bugs. Or my other favorite is how they throw back the "why don't YOU fix it and submit a patch".

the comment is not very useful when you comment on a distribution bug tracker and not to the software writer and the issue is a lack of manpower one

Sean G (sean-gilbertson) wrote :

Unless there are issues I'm not aware of, we could fix this by always
enabling the behavior triggered when enabling the "Create a backup copy of
files before saving" option, and then removing the capability for the user
to disable that functionality. (Note that this is a workaround that works
the last time I tried it, and is documented.)

It'd be an easy fix.

Sean

On Tue, Nov 10, 2009 at 11:41 PM, Sebastien Bacher <email address hidden>wrote:

> > Don't you want Ubuntu to integrate smoothly into a Windows-centric
> environment?
>
> using GNOME to edit smb document over gvfs mount works fine which is the
> recommended desktop way, the issue is with fstab command line mounts
> there
>
> > Linux *is* for power users.
>
> Good, so power users should know how to use an another editor or
> workaround the issue
>
> > Next, SAMBA is hardly a power user thing. If you're on ANY kind of
> network/LAN, you are no doubt using samba or the Microsoft equivalent of
> it.
>
> Right, that's why GNOME can mount smb shares in an easy way and editing
> txt using gedit works just fine there, the issue is when you use command
> line to mount samba mounts in a system specific way
>
> > but then refuse to fix things as it's much sexier to implement new
> features than work on bugs. Or my other favorite is how they throw back
> the "why don't YOU fix it and submit a patch".
>
> the comment is not very useful when you comment on a distribution bug
> tracker and not to the software writer and the issue is a lack of
> manpower one
>
> --
> gedit fails to save files over smbfs/cifs
> https://bugs.launchpad.net/bugs/34813
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Light-Weight Text Editor for Gnome: Confirmed
> Status in SambaServer: Invalid
> Status in SSHFS Mounter: Confirmed
> Status in “gedit” package in Ubuntu: Triaged
>
> Bug description:
> Saving files over a cifs/smbfs server doesnt work. You can open file, edit
> then save perfectly. But repeated saves after give you this error:
>
> "The file /home/dhonn/website/arrays.php has been modified since reading
> it. If you save it, all the external changes could be lost. Save it
> anyway?"
>
> The think is lying to me because I havent made any external changes.
>
> When I click "Save Anyway", i get this error:
>
> "Could not save the file /home/dhonn/website/arrays.php."
>
> But on the third try it works just fine.
>
> Here are the error messages, btw there are also GUI glitches too:
> http://dhonn.com/images/gedit-0.jpg
> http://dhonn.com/images/gedit-1.jpg
>
>

Robie Basak (racb) wrote :

@acabre:

Thanks for the strace file.

This is exactly what is needed but unfortunately there's a small issue. Because gedit seems to be aware of the file the strace output was being redirected to, my instructions included filtering out all mentions of the word "strace" from the log. Except that you called your mountpoint and directories strace too which I wasn't expecting. So the messages that I actually needed got filtered out too.

Could you please do it again, but this time use a command like this:

strace gedit 2>&1|grep -v filterthisaway > /tmp/filterthisaway.log

...and make sure that you don't mention the word filterthisaway anywhere else.

Thanks

Robie

acabre (acabre-eli) wrote :

@robie:

Sorry for complicating things. I've run a new test on an installation of 9.10 following your directions. After creating the tar, I realized that I should have called my user something other than tmp. Let me know if this causes problems and I can re-run the tests, since the box is already set up.

And thanks for looking at this!!!

tim pezarro (tim-pezarro) wrote :

Hello,

I have also added a strace file for the error I experience.

This is the error message for the file "samba_error.txt"

"Could not save the file /media/webteam
pezarro/tmp/samba_error.txt.
Unexpected error: Text file busy"

The attached zip file "gedit-error.zip" has strace log called "filterthisaway.log" and mount listing called "mounts.txt"

I hope this helps correct the gedit bug.

Cheers,

Robie Basak (racb) wrote :

@acabre and @tim pezarro:

Both of your strace files suggest the the problem is the same as the one that I fixed in a patch for the Intrepid package in 2008. Please try these packages for 9.10:

i386: https://launchpad.net/~racb/+archive/fixes/+files/gedit_2.28.0-0ubuntu2~basak1_i386.deb
amd64: https://launchpad.net/~racb/+archive/fixes/+files/gedit_2.28.0-0ubuntu2~basak1_amd64.deb

tim pezarro (tim-pezarro) wrote :

Robie,
Thanks for taking the time to review my log files. I believe i am guilty of not reading the details and understang that you have already created a patch for this problem.

I shall give your patch a try.

Cheers,
Tim Pezarro
Manager, Web Services
<email address hidden>
Phone: +1-604-415-6044
Cell: +1-604-762-1000
Fax: +1-604-415-6602
PMC-Sierra, Inc.
8555 Baxter @lace
Burnaby, BC, Canada
V5A 4V7

----- Original Message -----
From: <email address hidden> <email address hidden>
To: Tim Pezarro
Sent: Wed Nov 18 14:48:24 2009
Subject: [Bug 34813] Re: gedit fails to save files over smbfs/cifs

@acabre and @tim pezarro:

Both of your strace files suggest the the problem is the same as the one
that I fixed in a patch for the Intrepid package in 2008. Please try
these packages for 9.10:

i386: https://launchpad.net/~racb/+archive/fixes/+files/gedit_2.28.0-0ubuntu2~basak1_i386.deb
amd64: https://launchpad.net/~racb/+archive/fixes/+files/gedit_2.28.0-0ubuntu2~basak1_amd64.deb

--
gedit fails to save files over smbfs/cifs
https://bugs.launchpad.net/bugs/34813
You received this bug notification because you are a direct subscriber
of the bug.

Vito Botta (vito-botta) wrote :

Robie,

would love to have you here so that I could give you a big hug :D
After spending some time on this, I found your comments here and can confirm that your package fixes the issue for me on 9.10.

I am using the same user folders (Documents, Pictures, Music, etc) between Ubuntu and Windows (through Virtualbox's shared folders) and that was a pain.

Thanks!

Ronoaldo Pereira (ronoaldo) wrote :

Robie,

I can confirm that this package also fixed the problem for me on 9.10.

Thanks for the fix!!!

Gustaf (g-rantila) wrote :

There seems to be a regression issue here. I have never had issues with gedit and sshfs, until I recently upgraded from 9.10 to Lucid Alpha 3. Now my gedit will not save any file over sshfs, although any other editor does just fine.

Teoh Han Hui (teohhanhui) wrote :

This happens with vboxsf mounts as well. Affects Nautilus too as mentioned in bug 323091.

Id2ndR (id2ndr) wrote :

It appears that this bug is fix for cifs mount in 2.30 (according to https://bugzilla.gnome.org/show_bug.cgi?id=336738#c35).
I still encountered this bug using sshfs with 2.30 (Ubuntu 10.04).

So I'm not sure that the sshfs and cifs/smbfs trouble is the same one and maybe there should be 2 separate bugs.

I also would like to know if the patch applied in Robie Basak's package can still be use for gedit 2.30 ?
The patch isn't attached to this bug, so where can I grab it ?

Robie Basak (racb) wrote :

@Id2ndR

From a quick look, I think this is the patch I used. I've not checked it.

tags: added: patch
papukaija (papukaija) on 2010-08-22
tags: added: metabug
Changed in gedit:
importance: Unknown → Medium
Vide (vide80) wrote :

I'm using Ubunto 10.10 and the bug, with gedit and a fstab mounted CIFS share, is still there.
Steps to reproduce (the usuals):
- create a new file with gedit in the remote share
- type something
- Ctrl+S to save
- type something
- Ctrl+S to save: bug happens!

And to all the people/developers saying we should use gvfs+cifs... well, I'll do it when I'll get the same performances as with kernel mode CIFS (50MB/s (fifty) against 6MB/s (six))

Brad Richards (bradley-kri) wrote :

Please note that this bug affects more than just gedit - similar bugs have been reported against other applications, including eclipse: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=137011

Because of this, I think the priority should be increased!

fabioxxxx (fabioxxxx) wrote :

2006-2011 ... oh crap

yaztromo (tromo) wrote :

This bug also effects the geany editor when saving over cifs.

1. Open a file and modify it
2. Save it
3. Modify it some more
4. Save
5. BAM! File has been modified dialog. Usually the time difference between local and remote is 1 second.

My cifs server is Ubuntu 10.04 and my client machine is 10.10. Anyone know of a workaround? Is this a server problem or a client problem?

yaztromo (tromo) wrote :

update: Solved my own problem.

Simply changing the fstab entry from type cifs to smbfs fixed the problem for me.

Not ideal but it works.

Crates (typing) wrote :

My fstab already has this set as "smbfs" (not cifs), I already have the backup option unchecked, and this is still a problem for me (and has been on every Ubuntu installation I've ever had for the past five years). It ONLY happens with gedit, and ONLY when saving to a Samba filesystem.

The NAS (network attached storage device) that I use is a Data Robotics DroboFS Pro. I use it to store files collaboratively across five or six computers. On all other programs in Linux, as well as every program I use on Mac OSX and any version of Windows, my files are stored and retrieved just fscking fine. No problems.

So, when I hear people complaining about how this is a bug with Samba, CIFS, NFS, Windows architecture, NetBIOS protocols, the Linux kernel, underpants gnomes, whatever... I have to laugh, because this is clearly a gedit bug. One that has been active for OVER FIVE YEARS.

I'm going to implement my own solution going forward: I'll simply use a text editor that isn't total bullshit. But at any rate, maybe you guys might consider fixing the problem rather than trying to defer blame onto everyone else.

Here are some details. Hope they help.

Gedit version: 2.30.3

Ubuntu version: 10.04

Kernel version: 2.6.32-34-generic

Architecture: amd64

elatllat (elatllat) wrote :

well said Crates,
I also opted to use a different editor (vim) as a solution a long long time ago.

fabioxxxx (fabioxxxx) wrote :

switched to kate ...

Peter Würtz (pwuertz) wrote :

Ok this is getting nasty. The latest experience with this bug (Ubuntu 11.10) when trying to edit/save a textfile is a dialog popping up, telling me that gedit is unable to save the file. If you decide to close the editor for some reason now, the file is completely gone. You didn't just loose your changes, you lost the complete text file. There might be an invisible ~backup file around, but from a users point of view, the file is gone.

Can we please make that bug critical?

Peter Würtz (pwuertz) wrote :

Still happening on 12.10.
Users can loose whole text files when trying to save changes with gedit!

Changed in gedit (CentOS):
status: Unknown → New

I have the same problem in Oracle Linux 5 and 6; CentOS 5 and 6 and in RedHat 5

Here is how to reporoduce the error

/etc/fstab
//192.168.1.100/Oracle /mnt/Oracle cifs username=orcl,password=orcl 0 0
/dev/sda1 /mnt/sda1 ntfs defaults 0 0

When you save a file to /mnt/Oracle or /mnt/sda1, gedit immediately wants you to reload it. If you reload, you lost your ability of undo any changes prior to the save, if you don't do what gedit wants, you may end up with an empty file "Save Anyway"

But if you save the file to any Linux partition such /u01/app/oracle... gedit works fine

Daniel (hackie) wrote :

The problem still exists in Ubuntu 13.10 (Linux 3.11.0-20-generic x86_64) with gedit 3.8.3-0ubuntu3

My fstab:
//ourserver.local/myshare /mnt/mymount cifs uid=1001,file_mode=0600,dir_mode=0700,credentials=/myhome/.smbcredentials,iocharset=utf8,sec=ntlm,nounix 0 0

I found an interesting link which assumes that the reason is a time-synchronization problem: https://forums.gentoo.org/viewtopic-t-495454-start-0.html#3567475. This makes sense since our NAS is a Netgear ReadyNAS with a time drift of ~20s per day and NTP doesn't seem to work on it. Latter means that I cannot do any serious tests on it.

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

Other bug subscribers

Remote bug watches

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