Skip to content
October 29, 2013 / kiranpatils

Error while Installing Package : An attempt was made to move the file pointer before the beginning of the file.

Challenge:

One fine morning, We copied a Package from our CM Environment, To reproduce one scenario in local. When we tried to install that package in local. We got following error:

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Web.UI.HtmlControls.Component.HandleMessage(Message message)
at Sitecore.Shell.Framework.Commands.ClientEventCommand.SendEventMessage()
at Sitecore.Shell.Framework.Commands.ClientEventCommand.Execute(CommandContext context)
at Sitecore.Web.UI.Sheer.ClientPage.RaiseEvent()
at Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Nested Exception
Exception: System.IO.IOException
Message: An attempt was made to move the file pointer before the beginning of the file.
Source: mscorlib
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin)
   at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
   at Sitecore.Zip.ZipReader.<get_Entries>d__0.MoveNext()
   at Sitecore.Zip.ZipReader.GetEntry(String entryName)
   at Sitecore.Install.Zip.PackageReader.Populate(ISink`1 sink)
   at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.LoadPackage()
   at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.ActivePageChanging(String page, String& newpage)
   at Sitecore.Web.UI.Pages.WizardForm.set_Active(String value)
   at Sitecore.Web.UI.HtmlControls.Button.DoClick(Message message)

Same for you? Don’t worry, We know why it happens. Eager to know why? Keep reading..

Solution:

We tried to install the same package in Plain Sitecore, And the behavior was same. Then we looked at package’s size, Which is 3 GB, It made us to think for a while. We did a quick search. But nothing came up. Then finally, we thought to raise a Support Case. And as always they have a solution and reason for it!

We have registered the bug regarding the big packages and will inform you when it’s fixed. The maximum size of the package should not be greater than 2047 Mb (1.9 Gb). This value is restricted by maximum value of the System.Int32 type that used in the Sitecore.IO.Stream.Read() method.

Basically, The Max. Size of Package should not be 1.9 GB! (Which is a MaxValue of Int32 — 2,147,483,647 == 2 GB) So, while creating package make sure you do it in chunks!

Happy Packaging! 🙂

Advertisements

2 Comments

Leave a Comment
  1. Pradeep Shukla / Oct 29 2013 4:11 pm

    Good Information!!

    • kiranpatils / Nov 7 2013 11:44 pm

      Pradeep — Thank you! Glad you liked it!

      Kiran

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: