Sublime Forum

Save not reliable

#1

Hello there,

I’m experiencing a weird bug…

My setup :

  • OS X 10.9
  • Sublime Text 3 nightly (but tested on 2.0.2 and same thing)
  • VMWare Fusion 6.0.2 (with debian) with Shared Folder on a web project. PHP files are in OS X folder, web env is on virtual machine, accessing through HGFS shared folder.

The problem :

When I save a file, there is a lot of chance (95% maybe) that this file gets “corrupted” or not updated when read by the VM. Examples :
Most of time after save, PHP tells me “Parse error: syntax error, unexpected $end in …”.
Sometime i change a few characters in code, save, then refresh and the change made does not appear.

When it came :
I think this bug arrived with OS X 10.9 (update from 10.8). I do not remember this bug on 10.8.

What I tried :

  • Enabling or disabling atomic file saving. No change.

The workaround :
I need to multiply characters (like 3 semicolons at end of a line), save, then refresh page and problem solved. It’s like forcing the app to see that I changed something and forcing it to re-save the file correctly.

This problem is not present when editing the same files with another editor like Coda.

Thanks for you help, Sublime Text has many advantages over others editors (like file reading and color syntaxing speed!), it’s hard to not use it! :smile:

0 Likes

#2

It may be a VMWare Fusion bug but not confirmed : communities.vmware.com/thread/4 … 5&tstart=0
It seems that when adding bytes to the file, everything works correctly. But when removing bytes somewhere in the file, it removes it at the end of the file. That’s why I got “unexpected $end…” with PHP. When I read the file with vi from OS X, file is correct but when i read the same file from Linux VM, the end is missing.

Since using vi or TextEdit does not trigger the bug, maybe the method Sublime Text saves the file can trigger the bug.

Thanks!

0 Likes

#3

Is atomic_save enabled? Check your default prefs, then user prefs.

I’ve heard about some edge-case issues with it, though it’s never caused me problems. Try changing this setting; it’s explained in the default prefs comment.

0 Likes

#4

Interesting, I also see this behavior with atomic_save enabled and disabled, but not with TextEdit or BBEdit.

0 Likes

#5

Running into this same issue.

Tried atomic enabled and disabled and that doesn’t seem to fix it. Tried other editors and they don’t have any issues. Upgraded from VMWare Fusion 5 to 6. Same issue. Not sure where this is originating.

0 Likes

#6

I’m having the exact same problem… this is very frustrating. I’ve switched to using BBedit for now as I really don’t think this is a VM ware fusion issue… if it were than fusion would have the same issue reading a file that BBedit saved. I have to put //FOO or put a new linebreak at the end of every file in ST to get my files to save. Although I will note that I suppose now that I think of it this could have something to do with VM ware fusion because the very same issue is present in sublime text 2.

0 Likes

#7

Has anyone seen any correlation between the occurrence of this problem and the use of a solid-state drive (SSD)?

Last week I was just assisting a coworker who has this very issue. He has a MacBook Pro retina from 2013 (contains an SSD). This is a new setup and he’s always had the bug. On the other hand, in the many months that I’ve been working on the same project, same tools, I never had the issue… Until I decided to switch to SSD for performance reasons. So now I have the same problem.

(The SSH received a clone copy of the contents of the HDD that I was using prior to the switch.)

Setup: OS X 10.9 + VMWare Fusion 6.0.2 (running Fedora 12) + Sublime Text 3.

0 Likes

#8

I’ve been using ST 3 from some where around build 3015 till now on a SSD with no saving issues.

0 Likes

#9

[quote=“subhaze”]
I’ve been using ST 3 from some where around build 3015 till now on a SSD with no saving issues.[/quote]

Are we still talking about files found corrupted when accessed from within a virtual machine? (VMWare Fusion accessing the host’s files through shared folders)

0 Likes

#10

Sorry, I forgot to add “Not using a VM”.

If there is a trial version of VMWare fusion I could try and do some testing this week/weekend to try and help narrow this issue down.

0 Likes

#11

I, too, am having the exact issue. I run Ubuntu in a vm through vmware, and do my development in sublime on windows 7. I share a folder through VMWare to the vm to serve the content. It appears to be truncating the end of my files when I save in sublime text through windows, causing runtime errors when i run the source from the vm server in a windows browser.

I tried setting the sublime text file end setting to always be unix LF, but that didn’t seem to help. Currently, I’m doing my development in the vm through sublime text installed there to bypass this problem. I’d like to move away from this so I can just use the vm as a server and to run commands.

Has anyone made any headway on this issue? It’s baffling me.

0 Likes

#12

Apparently, switching to using an NFS share fixes this problem, so it looks like it’s an issue with VMWares folder share. Using NFS is not an option since it only comes with Windows 7 Ultimate, and I’m not upgrading.

0 Likes

#13

You might want to try an SMB share (which is Windows’ native file sharing, so it’s supported in all versions). In Linux it’s supported by the Samba packages.

0 Likes

#14

Was there ever a solution to this?

0 Likes

#15

I personally haven’t seen the problem, however there have been recent fixes to shared folders support in Workstation 10.0.2 (and Fusion 6.03 and probably Player 6.0.2). The following is from the release notes for Workstation 10.0.2:

  • Reading and writing to a file using two threads with a shared folder has been improved.
    Resolved an issue about shared folder when the user read and write file using two threads.

  • Linux virtual machines access updated contents when using shared folders.
    Resolved an issue that caused Linux virtual machines to see stale file contents when using shared folders.

VMware Player 6.0.2 was released at the same time – I expect that the fixes mentioned above would apply even though they aren’t mentioned in the release notes for Player (does Player support shared folders?).

And this community post, communities.vmware.com/thread/4 … 5&tstart=0, mentions that the fix is also in Fusion 6.0.3 even though the release notes don’t mention it.

0 Likes

#16

I’m having the same issue - using

OSX 10.10.4
Sublime Text 3083
VMWare Fusion 7.1.2

It is pretty much identical to the issue described above where I can save a file from any other editor except ST and the change persists to the VM. And I can add characters in ST and save the file and the changes persist. But the moment I remove a character from ST and save it seems to sever the link to the VM and any subsequent changes aren’t seen.

I’ve already tried changing atomic_save to no avail.

Has anyone been able to determine a resolution for this issue?

Thanks for your time and help

0 Likes

#17

Has anyone had any luck on resolving this issue?

I’m running VMWare 8 on OS X, and while I was originally using Atom and having this issue, the same thing happens with Sublime.

It’s driving me nuts and killing my productivity.

Anyone have instructions for mounting as NFS on OS X?

0 Likes