Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipException: Cannot find central directory on check for updates #816

Closed
tom-james-watson opened this issue Sep 5, 2016 · 8 comments
Closed

Comments

@tom-james-watson
Copy link

I have an electron app and am using the inbuilt auto-updating which uses Squirrel. As far as I can tell this is a Squirrel.Windows issue and not an electron issue.

I am receiving the below error on launching my application, when normally it is trying to perform an update check (https://github.com/electron/electron/blob/master/docs/api/auto-updater.md#autoupdatercheckforupdates).

Any thoughts on what is causing this or how to fix? I have previously had auto-updating working and can't for the life of me work out what would have changed for it to now be throwing this error?

Uncaught Exception:
Error: Command failed: 4294967295
System.AggregateException: One or more errors occurred. ---> ICSharpCode.SharpZipLib.Zip.ZipException: Cannot find central directory
   at ICSharpCode.SharpZipLib.Zip.ZipFile.ReadEntries()
   at ICSharpCode.SharpZipLib.Zip.ZipFile..ctor(String name)
   at Squirrel.ReleasePackage.<ExtractZipForInstall>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass7_0.<<installPackageToAppDir>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__35`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<ApplyReleases>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.<ApplyReleases>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.Update.Program.<Update>d__5.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
   at Squirrel.Update.Program.Main(String[] args)
---> (Inner Exception #0) ICSharpCode.SharpZipLib.Zip.ZipException: Cannot find central directory
   at ICSharpCode.SharpZipLib.Zip.ZipFile.ReadEntries()
   at ICSharpCode.SharpZipLib.Zip.ZipFile..ctor(String name)
   at Squirrel.ReleasePackage.<ExtractZipForInstall>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass7_0.<<installPackageToAppDir>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__35`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.UpdateManage
@anaisbetts
Copy link
Contributor

Never seen that one before, if you rename the .nupkg file to .zip can you open it?

@tom-james-watson
Copy link
Author

Do you mean rename the file on my squirrel server?

@anaisbetts
Copy link
Contributor

No, on your computer

@tom-james-watson
Copy link
Author

tom-james-watson commented Sep 6, 2016

I wasn't sure exactly what it is even trying to open. My releases are ~50mb and I get this error immediately on startup, before it would have been possible to have downloaded the file.

I'm seeing a artpip-0.0.22-full.nupkg in C:\Users\tom\AppData\Local\artpip\packages that is 2.00KB. I presume this is what it is trying to open.

Turns out it's got the index.html of my squirrel server inside it..! Let me do some debugging around feed URLs etc and double check this isn't me badly configuring things!

@tom-james-watson
Copy link
Author

I actually wasn't using the correct feed URL on windows before, however I have corrected it and am still encountering this problem even with the updated version.

I am calling autoUpdater.setFeedURL with http://artpip.herokuapp.com/app/update/win32/0.0.24 and as you can see if you navigate to that URL, it's a valid feed URL.

I've tried wiping C:\Users\tom\AppData\Local\artpip and other associated app data, but same issue - a C:\Users\tom\AppData\Local\artpip\packages\artpip-0.0.22-full.nupkg with the index of http://artpip.herokuapp.com in it (which is what would get served if it is trying to access an invalid URL).

Is it possible to see the full logs of Squirrel somewhere to verify what URL is being fetched?

Any other ideas?

Thanks!

@anaisbetts
Copy link
Contributor

Yes, check %LocalAppData%\YOURAPP\SquirrelSetup.log

@tom-james-watson
Copy link
Author

tom-james-watson commented Sep 6, 2016

Ah - it is trying to download http://artpip.herokuapp.com/download/0.0.25/artpip-0.0.25-full.nupkg, instead of the url returned in https://artpip.herokuapp.com/app/update/win32/0.0.24, which is http://artpip.herokuapp.com/app/download/version/0.0.25/windows_32?filetype=zip

That looks like a bug? I assume I could work around this by not putting my nuts paths under /app/.

Also, I guess that we should check the headers of the file that is being downloaded to confirm it's what is expected, then raising an appropriate error instead of it exploding on the unzip.

Thanks for you help. Let me know if you need any more info.

@anaisbetts
Copy link
Contributor

I think you should probably take this to Nuts instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants