IPP ERROR: Application exception: System.IO.EndOfStreamException: Unable to beyond the end of the stream

Just trying to use remote compilation using c++, etc. Were had it compiling just fine months ago and now we are getting this and I’m not sure why: Seems to have issues reading a file…

MainFrameActions: Packaging (iOS): IPhonePackager: Executing command 'Clean' ...
MainFrameActions: Packaging (iOS): IPhonePackager: Cleaning temporary files from PC ... 
MainFrameActions: Packaging (iOS): IPhonePackager:  ... cleaning: D:\UE4\UnrealEngine\KeepinItWheel\Intermediate\IOS-Deploy\KeepinItWheel\Shipping\
MainFrameActions: Packaging (iOS): IPhonePackager: 
MainFrameActions: Packaging (iOS): IPhonePackager: Loaded stub IPA from 'D:\UE4\UnrealEngine\KeepinItWheel\Binaries\IOS\KeepinItWheel-IOS-Shipping.stub' ...
MainFrameActions: Packaging (iOS): IPhonePackager:  ... 'D:\UE4\UnrealEngine\KeepinItWheel\Binaries\IOS\KeepinItWheel-IOS-Shipping.stub' -> 'D:\UE4\UnrealEngine\KeepinItWheel\Binaries\IOS\KeepinItWheel-IOS-Shipping.ipa'
MainFrameActions: Packaging (iOS): IPhonePackager:       Copy: D:\UE4\UnrealEngine\KeepinItWheel\Binaries\IOS\KeepinItWheel-IOS-Shipping.stub -> D:\UE4\UnrealEngine\KeepinItWheel\Binaries\IOS\KeepinItWheel-IOS-Shipping.ipa, last modified at 2/25/2016 12:21:58 PM
MainFrameActions: Packaging (iOS): IPhonePackager: Found Info.plist (D:\UE4\UnrealEngine\KeepinItWheel\Saved\StagedBuilds\IOS\Info.plist) in stage, which will be merged in with stub plist contents
MainFrameActions: Packaging (iOS): IPhonePackager: Using mobile provision 'KeepinItWheel' to code sign
MainFrameActions: Packaging (iOS): IPhonePackager:  ... Writing updated embedded.mobileprovision
MainFrameActions: Packaging (iOS): IPhonePackager:   Looking for a certificate that matches the application identifier 'P6U576V3X6.com.ciinc.keepinitwheel'
MainFrameActions: Packaging (iOS): IPhonePackager:   .. Provision entry SN '35EC9569BBF12C49' matched 1 installed certificate(s)
MainFrameActions: Packaging (iOS): IPhonePackager:   .. .. Installed certificate 'iPhone Developer:  Allen (TEXKRJAPAK)' is valid (choosing it) (range '11/17/2015 10:49:19 AM' to '11/16/2016 10:49:19 AM')
MainFrameActions: Packaging (iOS): IPhonePackager: ... Found matching certificate 'iPhone Developer:  Allen (TEXKRJAPAK)' (valid from 11/17/2015 10:49:19 AM to 11/16/2016 10:49:19 AM)
MainFrameActions: Packaging (iOS): IPhonePackager: Found CFBundleVersion string '0.15' and updated it to '0.16'
MainFrameActions: Packaging (iOS): IPhonePackager: Saving IPA ...
MainFrameActions: Packaging (iOS): IPhonePackager:  ... Writing updated Info.plist
MainFrameActions: Packaging (iOS): IPhonePackager: Opening source executable...
MainFrameActions: Packaging (iOS): IPhonePackager: IPP ERROR: Application exception: System.IO.EndOfStreamException: Unable to  beyond the end of the stream.
MainFrameActions: Packaging (iOS): IPhonePackager:    at System.IO.BinaryReader.ReadByte()
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.ReadingContext.ReadASCIIZ() in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 196
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.CodeDirectoryBlob.UnpackageData(ReadingContext SR, UInt32 Length) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 1933
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.AbstractBlob.CreateFromStream(ReadingContext SR) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 1574
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.BlobTable.(ReadingContext SR) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 1773
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.AbstractBlob.CreateFromStream(ReadingContext SR) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 1574
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.MachLoadCommandCodeSignature.UnpackageData(ReadingContext SR, Int32 CommandSize) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 2127
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.MachLoadCommand.CreateFromStream(ReadingContext SR) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 741
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.MachObjectFile.(ReadingContext SR) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 1223
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.FatBinaryFile.(ReadingContext SR) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 2228
MainFrameActions: Packaging (iOS): IPhonePackager:    at MachObjectHandling.FatBinaryFile.LoadFromBytes(Byte[] Data) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\MachObjects.cs:line 2371
MainFrameActions: Packaging (iOS): IPhonePackager:    at iPhonePackager.CodeSignatureBuilder.PerformSigning() in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\CodeSigning.cs:line 756
MainFrameActions: Packaging (iOS): IPhonePackager:    at iPhonePackager.CookTime.RepackageIPAFromStub() in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\CookTime.cs:line 350
MainFrameActions: Packaging (iOS): IPhonePackager:    at iPhonePackager.Program.Main(String[] args) in d:\UE4\UnrealEngine\Engine\Source\Programs\IOS\iPhonePackager\iPhonePackager.cs:line 780
MainFrameActions: Packaging (iOS): CommandUtils.Run: Run: Took 1.3770958s to run IPhonePackager.exe, ExitCode=1
MainFrameActions: Packaging (iOS): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (iOS): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (iOS): Program.Main: ERROR: Exception in AutomationUtils.Automation: Command failed (Result:1): D:\UE4\UnrealEngine\Engine\Binaries\DotNET\IOS\IPhonePackager.exe RepackageFromStage "D:\UE4\UnrealEngine\KeepinItWheel\KeepinItWheel.uproject" -config Shipping -schemename KeepinItWheel -schemeconfig "Shipping" -compress=best -sign -stagedir "D:\UE4\UnrealEngine\KeepinItWheel\Saved\StagedBuilds\IOS" -project "D:\UE4\UnrealEngine\KeepinItWheel\KeepinItWheel.uproject" -provision "KeepinItWheel.mobileprovision" -certificate "iPhone Developer:  Allen (TEXKRJAPAK)". See logfile for details: 'IPhonePackager-2016.02.25-12.22.13.txt' 
MainFrameActions: Packaging (iOS): Stacktrace:    at AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary`2 EnvVars) in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ProcessUtils.cs:line 800
MainFrameActions: Packaging (iOS):    at IOSPlatform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL) in D:\UE4\UnrealEngine
MainFrameActions: Packaging (iOS): \Engine\Source\Programs\AutomationTool\IOS\IOSPlatform.Automation.cs:line 368
MainFrameActions: Packaging (iOS):    at Project.Package(ProjectParams Params, Int32 WorkingCL) in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\PackageCommand.Automation.cs:line 30
MainFrameActions: Packaging (iOS):    at BuildCookRun.DoBuildCookRun(ProjectParams Params) in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 212
MainFrameActions: Packaging (iOS):    at BuildCommand.Execute() in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:line 35
MainFrameActions: Packaging (iOS):    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands) in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 395
MainFrameActions: Packaging (iOS):    at AutomationTool.Automation.Process(String[] CommandLine) in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 369
MainFrameActions: Packaging (iOS):    at AutomationTool.Program.MainProc(Object Param) in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 134
MainFrameActions: Packaging (iOS):    at AutomationTool.InternalUtils.RunSingleInstance(Action`1 Main, Object Param) in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 708
MainFrameActions: Packaging (iOS):    at AutomationTool.Program.Main() in D:\UE4\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 53
MainFrameActions: Packaging (iOS): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (iOS): Program.Main: AutomationTool exiting with ExitCode=Error_Unknown
MainFrameActions: Packaging (iOS): Domain_ProcessExit
MainFrameActions: Packaging (iOS): AutomationToolLauncher exiting with ExitCode=1
MainFrameActions: Packaging (iOS): copying UAT log files...
MainFrameActions: Packaging (iOS): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (iOS): BUILD FAILED

Hey -

You mentioned building a couple months ago, have you changed the engine version since then or are you getting this error with the same engine that previously build successfully? Have there been any changes to the project since it build successfully?

It’s been a while (since 4.8 or 4.9). We have since downloaded a new mobile provision and rebuilt the project configurations / uproject from scratch.

It is complaining about line 1933 seen below. Unfortunately, I can’t debug it but I’m trying to figure out if it is having a problem reading the Identifier or Team and from what file exactly??

Here is the entire log file. Is the xcode sdk I’m using correct as well?

link text

Any update as to what I should do. We were planning on going live in the next 2 weeks.

If you can point me where to find the file it is trying to I can update it for you all to replicate.

What exact version are you on? I suspect this started happening after you updated to 4.10.3 or 4.10.4. Is this correct? If so, I’m not sure why this would be happening as that particular field should have been added as part of the Xcode 7 update when it does a code sign. However, it probably will work if you change the code to the following:

if (Version == 0x20200)
{
			UInt32 TeamStringOffset = SR.ReadUInt32();

			//  the identifier string
			SR.PushPositionAndJump(StartOfBlob + IdentifierStringOffset);
			Identifier = SR.ReadASCIIZ();
			SR.PopPosition();

			//  the team string
			SR.PushPositionAndJump(StartOfBlob + TeamStringOffset);
			Team = SR.ReadASCIIZ();
			SR.PopPosition();
}
else
{
			//  the identifier string
			SR.PushPositionAndJump(StartOfBlob + IdentifierStringOffset);
			Identifier = SR.ReadASCIIZ();
			SR.PopPosition();
}

Replace starting at the line uint32 TeamStringOffset all the way to the SR.PopPosition of the team string. Rebuild IPhonePackager.exe and that should resolve the issue. If so, let me know and I will add it to the 4.11 release.

-Pete

Well, it got further this time but still threw another exception. Please let me know how I can assist to get this cleared up ASAP. (Added Code and Exception Log).[link text][1]

XCode 7.2 (updating to 7.2.1 now).

I’m not sure my stub has been rebuilt. All I do is a Package → IOS (Shipping Build). I’m not sure how I can verify this for you.

I will update you as soon as the update finishes and the new code is put in.

Thanks,

So this is all of the new code to properly code sign on when using Xcode 7. Are you building with Xcode 7? If so, are you sure your stub has been rebuilt with Xcode 7 or is it the stock one provided with UE 4.10?

To get around this for now, put all of the code in that function in the following:

if (Length > 0)
{
  /* function code here*/
}

-Pete

Apparently, this will not fix it either. Same error. The length is 80 so it still blows up. What else can be done. How can I verify the (stub has been rebuilt with Xcode 7)? I did a full rebuild against Xcode 7.2.1. Is there a file I can send you that you can run through the codepath?

FYI, Built another game for testing purposes using a different provision / same valid cert. Same issue. This doesn’t appear to be a single project issue.

Well, 80 is what around what I would expect for a stub built with the latest Xcode, so I am now at a loss. Can you send me the failing stub? I can try to sign it with our certificate here and run through the process in the debugger to see what is going on. I’ll have one of our support guys get a hold of you so he/she can get the stub.

-Pete

Actually, it just occurred to me if the first error is being gotten around with the code I recommended, then this section being might not match what I am expecting for the new code signing. It may be ok to just the 80 bytes of data and not try to interpret it. The if statement should probably be changed to see check the version number from the other fix, so you might have to set it in a common area for them both to look at it.If it is versionb 0x20200 then do the code as it stands otherwise, just it opaquely (i.e. all of the data in to a byte array). On write out, we’ll write the data the new way, which should be fine.

Before trying this tho, store off one of the failed IPAs, so that you can send it to me and I can take a look at it.

-Pete

Please let me know how I can send you the ipa. It is about 84MB.

Hi . I’ve sent you an email to transfer your IPA, please be on the lookout for that. Thanks

I’ll have one of our support members contact you. Also, one of our developers here got this error last night. He was able to work around it by clearing off the build directory on his Mac and upgrading to Xcode 7.2.1. That may work for you. I still want to make sure we have fixes in place to handle this behavior, but it might get you unstuck.

-Pete

I’ll clear my build directory and let you know. I’m already on 7.2.1.

Yes! I’ll share it on OneDrive and reply back w/the link via your email.

Deleting the build directory on the mac did not appear to resolve it. Please just let me know the code fixes for it when you are able to resolve it. Thanks, - jv