Skip to content

FetchAsync() throws FileNotFoundException while trying to extract downloaded tor-expert-bundle #122

Description

@NotAPirate1

Every once in a while, after my application has been running for a while, and the TorSharpToolFetcher's CheckForUpdatesAsync() detects an update for Tor, my call to FetchAsync fails horribly with a FileNotFoundException-Exception:

Error message: The tool downloaded from 'https://dist.torproject.org/torbrowser/14.5.3/tor-expert-bundle-windows-x86_64-14.5.3.tar.gz' could not be read as a .tar.gz file.
Knapcode.TorSharp.TorSharpException: The tool downloaded from 'https://dist.torproject.org/torbrowser/14.5.3/tor-expert-bundle-windows-x86_64-14.5.3.tar.gz' could not be read as a .tar.gz file.
 ---> System.IO.FileNotFoundException: 
File name: 'SharpCompress, Version=0.32.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96'
   at Knapcode.TorSharp.Tools.ArchiveUtility.ReadTarAsync(Stream tarStream, String outputDir, Func`2 getEntryPath, Boolean shouldExtract)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Knapcode.TorSharp.Tools.ArchiveUtility.ReadTarAsync(Stream tarStream, String outputDir, Func`2 getEntryPath, Boolean shouldExtract)
   at Knapcode.TorSharp.Tools.ArchiveUtility.ReadTarGzAsync(FileStream fileStream, String outputDir, Func`2 getEntryPath, Boolean shouldExtract)
   at Knapcode.TorSharp.Tools.ArchiveUtility.ReadTarGzAsync(String tarGzPath, String outputDir, Func`2 getEntryPath, Boolean shouldExtract)
   at Knapcode.TorSharp.Tools.ArchiveUtility.TestTarGzAsync(String tarGzPath)
   at Knapcode.TorSharp.Tools.ArchiveUtility.TestAsync(ZippedToolFormat format, String path)
   at Knapcode.TorSharp.TorSharpToolFetcher.DownloadFileAsync(ToolUpdate update)
   --- End of inner exception stack trace ---
   at Knapcode.TorSharp.TorSharpToolFetcher.DownloadFileAsync(ToolUpdate update)
   at Knapcode.TorSharp.TorSharpToolFetcher.FetchAsync(ToolUpdates updates)
   at <<mycaller>>

Looks like the ReadTarAsync fails miserably trying to process the tor bundle:

private static async Task ReadTarAsync(

Any ideas folks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions