Protection Engine for Network Attached Storage

 View Only

ERR_INITIALIZING_STREAM_REQUEST error in Com.symantec.scanengine.api.StreamScanRequestImpl.Start

  • 1.  ERR_INITIALIZING_STREAM_REQUEST error in Com.symantec.scanengine.api.StreamScanRequestImpl.Start

    Posted Nov 08, 2022 05:24 PM

    We have a WCF service which uses com.symantec.scanengine.api.ScanRequestManager and i try to run it locally for the first time on my computer( i inherited the code)

    in WCF Service
    We have the below code which scans the file and returns the result false or true if there is not or there is a virus.

    List<ScanEngineInfo> ScanEnginesForScanning=new List<ScanEngineInfo>();
    string scanHost = 1344;
    string scanPort = 127.0.0.1;
    ScanEnginesForScanning.Add(new ScanEngineInfo(scanHost, Int32.Parse(scanPort)));

    var scanManager = new ScanRequestManager();

    int readTimeout = 20000;
    scanManager.PrepareForScan(ScanEnginesForScanning, 20000, 20);
    var virusScanner = scanManager.CreateStreamScanRequest(Policy.SCAN);
    virusScanner.Start(file.Name, file.Name);
    virusScanner.Send(file.File);
    var resultStream = new MemoryStream();
    var scanResult = virusScanner.Finish(resultStream);

    I get the below error on virusScanner.Start(file.Name, file.Name) line (which is calling com.symantec.scanengine.api.ScanRequestManager + CreateStreamScanRequest +Start)


    StackTrace " at com.symantec.scanengine.api.StreamScanRequestImpl.Start a
    Message "ERR_INITIALIZING_STREAM_REQUEST" string
    ScanRequestManager
    Object reference not set to an instance of an object System.Exception {System.NullReferenceException}


    in one of the treads it is suggested to have inbound and out bound created in firewall which I did it for port 1344. How ever there is still no luck.

    Also Below is how the host application create the file and pass it to the above WCB Service
    var file= new myFile
    {
    File = ASCIIEncoding.Default.GetBytes(strFileString1),
    Name ="3467737_3328218-1.pdf",
    UserId = "TestUser",
    IpAddress = "MyIp",
    SessionId = "TestSessionId",
    GlobalConnectorId = Guid.NewGuid().ToString()

    };


    Any suggestion would be highly appreciated! I wonder if i have do any other set up on my local computer to make this work or there is another issue.

    Thanks,

    Maryam