You are viewing limited content. For full access, please sign in.

Question

Question

lfso briefcase export import

asked on November 6, 2018

I am trying to create a LFSO 10.2 program to export to briefcase from 1 repository and import that briefcase into another repository.  The program works if both repositories are on-prem systems, but if I try to import the briefcase into a cloud repository, my program throws an error "'System.Runtime.InteropServices.COMException' Unspecified error".

If I manually try to import the briefcase created by my program into a cloud repository using the Web browser, it fails, but if I import the same briefcase into the cloud repository using the Windows client, it imports without problems.  If I use the Windows client to create the briefcase, I can import it into the cloud repository without any errors.

Below is the code that I am using to create the briefcase.  Is there something that needs to change in my code to correctly export the briefcase?

    Private Function ExportEntryToBriefcase(ByVal iDocID As Integer, ByRef sWinPath As String, ByRef DB As LFDatabase) As Boolean
        Dim bReturn As Boolean = False
        Try
            Dim sEntryName As String = Nothing
            Dim CurrentEntry As ILFEntry = DB.GetEntryByID(iDocID)
            sEntryName = CurrentEntry.Name
            sEntryName = sEntryName.Replace("<", "_")
            sEntryName = sEntryName.Replace(">", "_")
            sEntryName = sEntryName.Replace(":", "_")
            sEntryName = sEntryName.Replace("""", "_")
            sEntryName = sEntryName.Replace("/", "_")
            sEntryName = sEntryName.Replace("\", "_")
            sEntryName = sEntryName.Replace("|", "_")
            sEntryName = sEntryName.Replace("?", "_")
            sEntryName = sEntryName.Replace("*", "_")
            Dim exporter As LFBriefcaseExporter = DB.GetBriefcaseExporter()
            exporter.AddEntry(CurrentEntry)
            sWinPath = System.IO.Path.Combine(sWinPath, sEntryName & ".lfb")
            exporter.Export(sWinPath)
            Dim iProgress As Integer = exporter.GetProgress()
            Console.WriteLine("Progress: " & iProgress.ToString())
            While iProgress <> 100 AndAlso iProgress <> -999
                iProgress = exporter.GetProgress()
                Console.WriteLine("Progress: " & iProgress.ToString())
            End While
            exporter.Close()
            exporter.Dispose()
            CurrentEntry.Dispose()
            bReturn = True
        Catch ex As Exception
            Console.WriteLine(ex.Message)
            MessageBox.Show(ex.Message)
            bReturn = False
        End Try
        Return bReturn
    End Function

 

0 0

Replies

replied on November 6, 2018

Try enabling LFSO tracing, the call stack for the exception might be more helpful. To do this, create an ILFApplication object and call EnableTracing with the path to the folder that the logs should be written to. Then search the logs for "Unspecified error" and paste the call stack here.

1 0
replied on November 6, 2018 Show version history

I have tried, but no trace file is created.  I first added the code at the top of my import function and when that did not work, I added it to my login function which was already creating the LFApplication object.

    Private Function ImportBriefcase(ByVal sDestinationFolderPath As String, ByVal sVolumeName As String, ByVal sLFBriefcase As String, ByRef DB As LFDatabase) As Boolean
        Dim bReturn As Boolean = False
        Dim app As ILFApplication = New LFApplication()
        app.EnableTracing("C:\Temp\LFSOTrace")

and then in the login function

Dim app As LFApplication = New LFApplication
app.EnableTracing("C:\Temp\LFSOTrace")
DB = app.ConnectToDatabase(MyCloudRepository, MyCloudRepository, CloudUserName, CloudUserPassword)

EDIT:

 

I found that since I had not ended my log path with a "\", it tacked the log name directly onto my path and the logs were 1 level up and started with LFSOTrace.

 

I do not know how much of the log you want, but here is a bit that ends with the error:

16:16:09.713 [10300] CLFDatabase::get_RootFolder
16:16:09.713 [10300]  LFSession::SendRequest (XREPORT /)
16:16:09.854 [10300]   LFSession::ProcessResponse
16:16:09.855 [10300]    ProcessResponseHeaders
16:16:09.855 [10300]    BinaryReader::BinaryReader
16:16:09.855 [10300]    EntryListReader::EntryListReader
16:16:09.855 [10300]    EntryListReader::Parse
16:16:09.855 [10300]     CLFLocale::ToLocalTime
16:16:09.855 [10300]      ConvertToLocalTime
16:16:09.855 [10300]       UDateToLocalOADate
16:16:09.855 [10300]     CLFLocale::ToLocalTime
16:16:09.855 [10300]      ConvertToLocalTime
16:16:09.855 [10300]       UDateToLocalOADate
16:16:09.855 [10300]    EntryListReader::~EntryListReader
16:16:09.855 [10300]    BinaryReader::~BinaryReader
16:16:09.855 [10300]  EntryCreator<class CLFFolder,struct ILFFolder>::CreateForDispatch
16:16:09.855 [10300]   ILFObjectImpl::ILFObjectImpl
16:16:09.855 [10300]   ILFHasEntryLock::ILFHasEntryLock
16:16:09.855 [10300]   ILFEntryImpl::ILFEntryImpl
16:16:09.855 [10300]   ILFHasTemplateImpl::ILFHasTemplateImpl
16:16:09.855 [10300]   CLFFolder::CLFFolder
16:16:09.855 [10300]   CLFLock::CreateEntryLock
16:16:09.855 [10300]    CLFLock::CLFLock
16:16:09.855 [10300]   ILFHasEntryLock::put_LFSOLock
16:16:09.855 [10300]   ILFObjectImpl::Read
16:16:09.855 [10300]    CLFLock::put_Etag
16:16:09.855 [10300]   CLFLock::put_Etag
16:16:09.855 [10300]   CLFLock::put_ID
16:16:09.855 [10300] ILFEntryImpl::Dispose
16:16:09.855 [10300]  CLFLock::Dispose
16:16:09.855 [10300] CLFBriefcaseRequest::get_DataAmount
16:16:09.855 [10300] CLFBriefcaseRequest::get_DataAmount
16:16:09.855 [10300] CLFBriefcaseRequest::get_DataAmount
16:16:09.855 [10300] CLFBriefcaseImporter::WriteData
16:16:09.855 [10300]  TestLastError error: 12032
16:16:09.855 [10300] HRESULT: 0x80004005 (LFSession::CompleteStreamedRequest, LFSession.cpp:4430)
16:16:09.855 [10300]  LFOException::GetErrorMessage
16:16:09.855 [10300]   Error: Unspecified error
16:16:09.856 [10300]  LFOException::GetErrorMessage
16:16:09.856 [10300]   Error: Unspecified error
16:16:11.384 [10300] CLFApplication::DisableTracing

 

0 0
replied on November 6, 2018

WinHTTP is returning "ERROR_WINHTTP_RESEND_REQUEST" which is an error I have never seen before in any LFSO trace. I suspect it could be an issue with the reverse proxy used by LF cloud. I think the best route is to open a support case so we can get a sample briefcase and try reproducing the problem.

1 0
replied on November 6, 2018

Thanks Robert.  I have opened a support case and supplied a briefcase that was generated by my code and failed to import into the cloud repository.

0 0
replied on November 7, 2018

A case has been opened with Laserfiche Support. We will update this thread when a resolution has been reached.

0 0
replied on November 7, 2018

It looks like the problem was with how I was logging into the Cloud repository.  After changing my LogIn function, my program was able to upload the Briefcase without problems.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.