The cryptic "Unexpected end of file (-39)" error...

For seeking technical help with Digital Performer and/or plug-ins on MacOS.

Moderator: James Steele

Forum rules
This forum is for seeking solutions to technical problems involving Digital Performer and/or plug-ins on MacOS, as well as feature requests, criticisms, comparison to other DAWs.
Post Reply
mesayre
Posts: 223
Joined: Sun Aug 18, 2013 7:04 am
Primary DAW OS: Windows
Location: New York, NY
Contact:

The cryptic "Unexpected end of file (-39)" error...

Post by mesayre »

Hi guys,
I've seen a few posts about this over the years, but haven't seen a conclusive solution. My particular situation actually might be useful for troubleshooting this for others, as I'm in a multi-computer environment where the problem only happens sometimes. Read on if you like mysteries...

I have 3 DP rigs. Let's call them
Rig A: Monster Mac Pro running DP and all samples on one machine. DP 8.07, Mac 10.9.5
Rig B: Older Mac Pro with second mac pro as VEPro slave, DP 8.07, (Recent upgrade to) Mac 10.9.5
Rig C: iMac with mac pro as VEPro slave, DP 8.07, Mac 10.8.5

Here's what happens. I sometimes need to transfer a project from Rig A (the main rig) to another of the computers so another team member can work on it. The way I've always done this in the past is to open the file in MIDI-only mode from the destination computer (Rig B), remove all unused soundbites, and then Save As on Rig B. However, I found that after upgrading Rig B from 10.8 to 10.9, I now get the infamous "Unexpected end of file (-39)" error, and the operation fails. The full text of the "Additional information" is this:
/Volumes/Projects 2-1/The Affair/Audio/Cues/110/Analysis Files/TA 110 Finale 01_54_56_16_ MZ Files/analysis
Where "Projects 2-1" is the name of the remote drive. Unfortunately the message doesn't

Saving in any location on Rig B generates the same error. Changing the file name, as suggested, makes no difference. Interestingly, the following wrinkles are present:

[*] The file opens, saves, closes normally on Rig A
[*]I can perform this operation on Rig C with no issues.
[*] I can copy freely with the finder from any computer to any other computer
[*] I can perform the exact same operation in "reverse", which is to say, if I open the computer on Rig A, then Save As to Rig B via network, it works.

I tried deleting and rebuilding the Analysis Files folder, since it's mentioned in the error. But it's also just the first folder in the hierarchy, so it probably just chokes on the first file it tries to write. I suspected a permissions issue but there doesn't seem to be anything obviously wrong with the permissions. Maybe BSD file attribute flags, which sometimes get changed? That's approaching the limits of my knowledge.

One thing that's strange, is that when I upgraded Rig B to 10.9, I was no longer able to log into Rig A using its full username - I have to use its account short name instead. I've seen this on another computer as well, but haven't seen any explanation for why that behavior changed. It occurs to me that this might be causing some kind of permissions/file access problem?

It's a real head-scratcher, and one that I can only imagine has some kind of low-level thing at its core. Any ideas?

Thanks
DP 10 - Win 10 - Ultralite AVB
User avatar
MIDI Life Crisis
Posts: 26254
Joined: Wed May 18, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by MIDI Life Crisis »

Well, end of file may not be the DP file but a soundbite file. I recall one workaround was to move/remove ALL the soundbite files from the project folder and let the project load MIDI only or wait for DP to ask for the location, then point to the folder that was moved or continue w/o the soundbites to make sure it wasn't the DP project file and was, indeed, a soundbite that was the problem.

At that point I'd rebuild the soundbites in Quicktime or Audiofinder, etc. You might have the option (luxury?) or re-exporting them from the original project on the other machine (I'd go with project format/Do not import) and place them in the target project audio folder.

If the DP project file is corrupted there was often no workaround. I NEVER delete unused from soundbites lists as it has caused more of these kinds of problems than I care to remember. I'd rather have to buy a new hard drive a few months earlier than planned than to loose a project because DP messed up the consolidation process.
2013 Mac Pro 32GB RAM

OSX 10.14.6; DP 10; Track 16; Finale 26, iPad Pro, et al

MIDI LIFE CRISIS
User avatar
mikehalloran
Posts: 15134
Joined: Sun Jan 25, 2009 5:08 pm
Primary DAW OS: MacOS
Location: Sillie Con Valley

Re: The cryptic "Unexpected end of file (-39)" error...

Post by mikehalloran »

This error never seems to occur if your project files are on the same drive as DP. It can also occur if remote drives are not formatted for intel Macs or if you don't have enough privileges on those drives.

If you moved a project to someone else without zipping it and that person didn't zip it before sending it back to you...

Mavericks isn't the reason it happened. This error has been around a long time. It is usually fixable.

Like MLC advises, don't delete unused sound bites.

Zip your project folder. Move it to a server or Drop Box. Have the other person pull it and, when the other person is done, have him/her do the same.
DP 11.31; 828mkII FW, micro lite, M4, MTP/AV USB Firmware 2.0.1
2023 Mac Studio M2 8TB, 192GB RAM, OS Sonoma 14.4, USB4 8TB external, M-Audio AIR 192|14, Mackie ProFxv3 6/10/12; 2012 MBPs Catalina, Mojave
IK-NI-Izotope-PSP-Garritan-Antares, LogicPro X, Finale 27.4, Dorico 5.2, Notion 6, Overture 5, TwistedWave, DSP-Q 5, SmartScore64 Pro, Toast 20 Pro
mesayre
Posts: 223
Joined: Sun Aug 18, 2013 7:04 am
Primary DAW OS: Windows
Location: New York, NY
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by mesayre »

Hey guys,
Thanks for the responses. I would like to point out that this case seems different from the others I've read on this forum - those are usually about a file that can't be opened by the machine that created it. But that isn't what's happening here - the file remains in perfect working order on the original machine. It's just when trying to save it on the new machine - the recently upgraded one - that I get the error.

The other thing is - and I'm not trying to be difficult here - this method worked very well for the last year that we were doing it, and it stopped working after the upgrade. This was a clean install of Mavericks, so while it may not be Mavericks, exactly, I think it likely could be a default that was set during the clean install, or some cruft that got brought through by the migration assistant - like a permission or file flag.

We'd have to change a lot of our workflow if we can't figure this out. We go through drives fast enough as it is - transferring dialog tracks every time, or every take of whatever we recorded would just cause the project folders to balloon unreasonably. I'd prefer to go further in the troubleshooting and see if I can preserve the process since, as I mentioned, it was working until now without issue.

Any thoughts on how I might track down the problem? I assume it's got something to do with permissions, access control lists, or file flag, just cause those are things that've bitten me before.
DP 10 - Win 10 - Ultralite AVB
User avatar
Phil O
Posts: 7231
Joined: Thu Jul 28, 2005 10:01 pm
Primary DAW OS: MacOS
Location: Scituate, MA

Re: The cryptic "Unexpected end of file (-39)" error...

Post by Phil O »

mikehalloran wrote:This error never seems to occur if your project files are on the same drive as DP.
I've seen this problem before and my project files are always on a separate drive. So I think you're on to something here, Mike.

In my case, I think it was a permissions problem, because I was having problems with other applications saving files to that drive as well. Choosing "Ignore ownership on this volume" solved the problems with the other apps, but I was still getting (-39) errors in DP. I never did find a fix. I re-formatted the drive as a last resort and the problem went away, so I know SOMETHING was messed up on that drive.

Sorry if that doesn't help. Just relating my experience. :?

Phil
DP 11.23, 2020 M1 Mac Mini [9,1] (16 Gig RAM), Mac Pro 3GHz 8 core [6,1] (16 Gig RAM), OS 14.3.1/11.6.2, Lynx Aurora (n) 8tb, MOTU 8pre-es, MOTU M6, MOTU 828, Apogee Rosetta 800, UAD-2 Satellite, a truckload of outboard gear and plug-ins, and a partridge in a pear tree.
User avatar
Shooshie
Posts: 19820
Joined: Sat Oct 16, 2004 10:01 pm
Primary DAW OS: MacOS
Location: Dallas
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by Shooshie »

Interesting assessment of your corruption problem, so far.
Below are three possible problems and solutions. None is guaranteed to work!

• Incorrect Disk Format
  • Open Disk Utility in Rig B. Click on the names of any hard drives associated with DP, containing your DP files, virtual instruments and libraries, plugins, or DP itself, and see if the drive format is "Mac OS Extended (Journaled)" for each of them. If you find one formatted for MS-DOS (FAT 16) or other formats, it may be desirable to reformat the drive after copying your files somewhere safe. However, the damage that may be done (losing headers in audio files, for example) will already be done. To fix it, you would have to find uncorrupted files from a Mac OS drive and copy them to the reformatted drive. If you see this problem, you probably ought to talk to some folks about it before proceeding. Someone here or at MOTU may have a solution for you.
• Duplicate Preference Folder
  • Check your Preferences folder (User / Library / Preferences) and search for "Digital Performer." See if you get two full Digital Performer preference folders with seemingly identical contents (the actual files in the folder will probably have different sizes and dates). If so, the "real" one, that is, the one that DP will be using from this point onward, is com.motu.DigitalPerformer, so drag the other one onto your desktop. Once you determine if your Command Bindings, Click Patterns, Color Schemes, New File Templates, and other preferences are the correct ones, you may throw that folder out. But you may need to replace the contents of com.motu.DigitalPerformer with those of the other folder, depending on the last one that DP used. (be VERY SURE before discarding prefs that took you years to develop!)
• DP not perfectly installed.
  • If neither of those things seems out of order, try reinstalling DP on Rig B.
These are three of the things that seem to have the potential to corrupt DP files. I'd be very interested to know if any of those three things were problematic, and if fixing them changed your Rig B problem.

Shooshie
|l| OS X 10.12.6 |l| DP 10.0 |l| 2.4 GHz 12-Core MacPro Mid-2012 |l| 40GB RAM |l| Mach5.3 |l| Waves 9.x |l| Altiverb |l| Ivory 2 New York Steinway |l| Wallander WIVI 2.30 Winds, Brass, Saxes |l| Garritan Aria |l| VSL 5.3.1 and VSL Pro 2.3.1 |l| Yamaha WX-5 MIDI Wind Controller |l| Roland FC-300 |l|
User avatar
Shooshie
Posts: 19820
Joined: Sat Oct 16, 2004 10:01 pm
Primary DAW OS: MacOS
Location: Dallas
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by Shooshie »

mesayre wrote:One thing that's strange, is that when I upgraded Rig B to 10.9, I was no longer able to log into Rig A using its full username - I have to use its account short name instead. I've seen this on another computer as well, but haven't seen any explanation for why that behavior changed. It occurs to me that this might be causing some kind of permissions/file access problem?
This one makes me suspect that your drive is formatted MS-DOS (Fat 16). Not a diagnosis, but a suspicion at this point. Check ALL your drives on ALL rigs.

Shooshie
|l| OS X 10.12.6 |l| DP 10.0 |l| 2.4 GHz 12-Core MacPro Mid-2012 |l| 40GB RAM |l| Mach5.3 |l| Waves 9.x |l| Altiverb |l| Ivory 2 New York Steinway |l| Wallander WIVI 2.30 Winds, Brass, Saxes |l| Garritan Aria |l| VSL 5.3.1 and VSL Pro 2.3.1 |l| Yamaha WX-5 MIDI Wind Controller |l| Roland FC-300 |l|
mesayre
Posts: 223
Joined: Sun Aug 18, 2013 7:04 am
Primary DAW OS: Windows
Location: New York, NY
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by mesayre »

Hey all,
Thanks for the ideas and suggestions thus far. Unfortunately I'm still having this issue.

All drives involved, on both rigs, are formatted Mac OS Extended.

I tried repairing permissions on B, since I thought it might be an applications permission issue. No love. That did, however, fix the problem I mentioned

I searched for a duplicate preferences folder, and did find one from an older version of DP, but removing it had no effect.

I tried reinstalling DP, no change.

I'm a little hesitant to do something as drastic as a complete system rebuild, as that (coupled with the OS upgrade) is what led to this issue in the first place. Any other ideas?

Thanks again,
Mike
DP 10 - Win 10 - Ultralite AVB
User avatar
mikehalloran
Posts: 15134
Joined: Sun Jan 25, 2009 5:08 pm
Primary DAW OS: MacOS
Location: Sillie Con Valley

Re: The cryptic "Unexpected end of file (-39)" error...

Post by mikehalloran »

mesayre wrote:Hey all,
I tried repairing permissions on B, since I thought it might be an applications permission issue. No love...
How? Disk Utility or through Get Info?

If you didn't do it through Get Info, that may be the problem. Make certain that you have Read and Write privileges and you check the box to Apply to enclosed items
DP 11.31; 828mkII FW, micro lite, M4, MTP/AV USB Firmware 2.0.1
2023 Mac Studio M2 8TB, 192GB RAM, OS Sonoma 14.4, USB4 8TB external, M-Audio AIR 192|14, Mackie ProFxv3 6/10/12; 2012 MBPs Catalina, Mojave
IK-NI-Izotope-PSP-Garritan-Antares, LogicPro X, Finale 27.4, Dorico 5.2, Notion 6, Overture 5, TwistedWave, DSP-Q 5, SmartScore64 Pro, Toast 20 Pro
mesayre
Posts: 223
Joined: Sun Aug 18, 2013 7:04 am
Primary DAW OS: Windows
Location: New York, NY
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by mesayre »

Hey Mike,
Thanks for that suggestion. It turns out that using the Get Info method to change the permissions on the disk in Rig B (the rig I was transferring TO) made no difference, but changing them on Rig A (the one I'm transferring FROM), did resolve the problem.

What I find odd about that is that Rig C had been accessing the exact same files without any of those errors/access problems. The only real difference between them is that one is running 10.8.5 and the other is running 10.9.5. Wonder if something changed under the hood. Ah well, problem appears to be gone.

Thanks again, everyone!
DP 10 - Win 10 - Ultralite AVB
mesayre
Posts: 223
Joined: Sun Aug 18, 2013 7:04 am
Primary DAW OS: Windows
Location: New York, NY
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by mesayre »

Hey guys,
An update on this, because I finally chased down the cause.

The problem came back after a couple of weeks, and this time no amount of repairing permissions or volumes would fix it. But after fiddling with file sharing settings, I found the culprit: SMB sharing.

Specifically, Windows Sharing was enabled for the user in question on Rig A (the computer I was copying from). I saw (see link below) that from Mavericks on, the Apple folks are deprecating AFP sharing in favor of SMB, so it looks like two computers running 10.9 will default to connecting via SMB. But my computer running 10.8 was still connecting via AFP, which is why it didn't experience the problem.

When you turn on Windows sharing, it gives you that message about "storing your password in a less secure manner", suggesting that something changes with the way it authenticates, which might be leading some I/O weirdness. That's my best theory.

Disabling Windows Sharing on Rig A has resolved the problem. Permanently, I hope.

Link on AFP deprecation
https://www.afp548.com/2013/06/11/smb2- ... mavericks/
DP 10 - Win 10 - Ultralite AVB
User avatar
MIDI Life Crisis
Posts: 26254
Joined: Wed May 18, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: The cryptic "Unexpected end of file (-39)" error...

Post by MIDI Life Crisis »

Thanks. I don't get that but have in the past. I'll see what my system setting are in terms of sharing.


Sent from my iPhone using Tapatalk
2013 Mac Pro 32GB RAM

OSX 10.14.6; DP 10; Track 16; Finale 26, iPad Pro, et al

MIDI LIFE CRISIS
Post Reply