Planned
Last Updated: 13 Jan 2023 09:20 by ADMIN
Shaun
Created on: 10 Jan 2023 15:49
Type: Feature Request
0
Session objects contain error CS0103, unable to open SAZ generated in FiddlerClassic

HI,

We've been using FiddlerCore 5.0.0 for a while, but recently found that we can't open any SAZ files we generate. When we try to open any in Fiddler Classic we get a popup with the message: The selected file is not a Fiddler-generated .SAZ archive of Web Sessions.

Here are the things I've tried:

  • When renaming the saz to zip the contents look correct.
  • After using the repair option when opening the saz in FiddlerClassic the saz then opens.
  • Renaming the repaired saz to zip and comparing the contents the the original saz as zip - contents compare identical.
  • We use a custom saz writer that hasn't been changed since we originally integrated FiddlerCore, but I'm seeing the same error in each Session object we cache for list passed to Utilities.WriteSessionArchive : "Session #error CS0103: The name 'm_requestID' does not exist in the current context, error CS0103: The name 'm_state' does not exist in the current context". This is not coming from our code. 
  • I tried not using a custom writer, but just call Utilities.WriteSessionArchive, the call fails but I can't determine the reason why.
  • Attached is a sample saz file we generate that causes the issues described.

Thanks for any assistance.

3 comments
ADMIN
Nick Iliev
Posted on: 13 Jan 2023 09:20

Hi Shaun,

 

Our internal investigation of the issue showed that the problem is caused by an update in Fiddler Classic and Fiddler Everywhere. We've changed the ZIP library in our UI products to improve the performance and the ability to load more sessions at any moment, but that came with a change where both applications are now only reading SAZ files generated with UNIX-style paths. The above change means that we need to change the FiddlerCore utilities so that any automatically generated tracks should always use UNIX paths, not Windows ones.

We've logged this task up for implementation in a future release of FiddlerCore, but until then, please use a custom implementation where you explicitly pass the file name with UNIX-style paths.

 

Regards,
Nick Iliev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Shaun
Posted on: 12 Jan 2023 20:07

Thanks for your response. It does appear that the zip entries being created for each Session are using windows style paths with backwards slashes. Manually converting them to use forward slashes resolves the issue. But I have a follow up question. We are using the ISAZProvider and ISAZWriter interfaces to implement the custom saz writer. This means that FiddlerCore utilities are calling into our code using public void AddFile(string sFilename, SAZWriterDelegate oSWD) on the ISAZWriter interface. Thus, we are being passed file names like "raw\\1_s.txt" by FiddlerCore.Utilities. If Fiddler products expect unix-style paths why is FiddlerCore.Utilities passing a windows-style path? Is there any way to configure FiddlerCore to generate the unix-style paths?

 

Thank you again.

 

ADMIN
Nick Iliev
Posted on: 12 Jan 2023 07:21

Hello Shaun Becker,

 

Based on the provided information and the case description (especially 1st and 3rd points -  identical content while comparing both files), it seems that issue is related to how the SAZ files are saved through the custom SAZ writer. The Fiddler products (including Fiddler Classic and Fiddler Everywhere) are reading SAZ files that are using UNIX-style paths with a forward slash (for example, "raw/1_c.txt"). The custom SAZ writer probably uses Windows-style paths with a backslash (for example, "raw\1_c.txt"). That different path style will also explain why the repaired and the original files output the same content but are causing different behavior. I hope the above help you in solving the issue.

As a side note, you could test the WriteSessionArchive with the basic example below that utilizes the built-in options to create a directory.

private static void SaveSessionsToDesktop(IEnumerable<Session> sessions, string password)
{
    string filename = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) +
                                Path.DirectorySeparatorChar + DateTime.Now.ToString("hh-mm-ss") + ".saz";

    string response;
    try
    {
        if (sessions.Any())
        {
            bool success = Utilities.WriteSessionArchive(filename, sessions.ToArray(), password, false);
            response = $"{(success ? "Wrote" : "Failed to save")}: {filename}";
        }
        else
        {
            response = "No sessions have been captured.";
        }
    }
    catch (Exception ex)
    {
        response = $"Save failed: {ex.Message}";
    }
}

 

 

Regards,
Nick Iliev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.