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

Question

Question

Laserfiche SDK issues -- Log in failed because the number of sessions has reached the licensed limit

asked on July 18, 2018 Show version history

Hi –

I’m working on a project that involves users being able to use a custom web interface to upload documents into Laserfiche. We keep running into some issues that I’m looking for some clarity on.

Background
The way we have our system set up is that a user can upload as many files as they want in our application. Those files get uploaded to a temporary store in Microsoft Azure where they wait to be imported to LaserFiche. For each file that is added to the temp store, we send a message to our importer service that the file needs to be imported. Now, the importer service is configured such that it can run multi-threaded. Each time a file is uploaded, it generates the necessary import XML file, creates a Session, imports the file, and closes the session. If there is an error in the process, the session is closed.

Due to an error message we kept getting, we reduced the number of concurrent sessions to 2. However, the message still persists…

Here is the message :
Log in failed because the number of sessions has reached the licensed limit, or the user account has reached its session limit, or no named user license has been allocated to the user account. [9030]

What I would like to know is

* Is there a different way to create a session such that it can be used multiple times without this happening?

* Is a Repository User limited to 4 sessions? Or is it some other number?

* There used to be a setting in LaserFiche United called CanShareLicense, but it appears that in LaserFiche Avante and Rio this flag is not used. Is there some other equivalent setting?

* Is there a way to see how many active sessions are connected for a given user?

* If we are only using 2 threads (sessions) at a time, why do we continue to get this error? Is there some lag in when we issue Session.LogOut()?

We are planning for more users to be able to use the application but are hesitant to do so until we can get these errors resolved.

Code Sample

Here is the relevant code in our application:

 


        private void UploadFile(string uploadFolder, string uploadPath, string importXmlPath)

        {

            try

            {

                using (var session = CreateSession())

                {

                    CreateUploadFolder(uploadFolder, uploadPath, session);

                    UploadFiles(importXmlPath, uploadFolder, uploadPath, session);

                    session.LogOut();

                }

            }

            catch (Exception ex)

            {

                Log.Error(ex.Message);

                throw ex;

            }

        }

        private void UploadFiles(string importXmlPath, string uploadFolder, string uploadPath, Session session)

        {

            //this is a laserfiche file path

            var lfImportEngine = CreateImportEngine(uploadPath + "\\" + uploadFolder, _config.Volume, session);

            var import = lfImportEngine.BeginProcess(importXmlPath);

            while (!import.IsCompleted)

            {

                // wait for 1/10 second, and then refresh the status

                Thread.Sleep(100);

                import.Refresh();

            }

            if (import.HasFailed)

            {

                session.LogOut();

                Log.Error(import.FailureReason.Message);

                throw new Exception(import.FailureReason.Message);

            }

            Log.Information("Import Complete.");

            if (import.AllLoggedExceptions != null && import.AllLoggedExceptions.Count > 0)

            {

                session.LogOut();

                string errors = "";

                foreach (ImportEngineException e in import.AllLoggedExceptions)

                {

                    errors += e.Message + "\\r\\n";

                }

                Log.Error(errors);

                throw new Exception(errors);

            }

        }

 

0 0

Answer

SELECTED ANSWER
replied on July 19, 2018

Have you assigned a named license to the _config.Username?

0 0

Replies

replied on July 18, 2018 Show version history

Just to confirm, are you creating a session with an application license/account and passing the correct application key? If so, how many application licenses have you assigned to the LF server?

I believe LF sessions are limited to 10 simultaneous activities/operations, but if you are using a new session for each request then the problem is likely a result of license allocation.

It would help to see how you are actually creating the session, just be sure to change/remove any sensitive information like server names and passwords.

To monitor connections, you can use the Activity Monitor in the Administration Console. From there, you can determine how many active sessions your application is creating and whether or not your sessions are actually getting closed after each request is processed.

 

 

1 0
replied on July 18, 2018

As Jason said, how is this connection licensed? 2 concurrent with non uniformity makes it sound like there is 0 licensing involved so far and you are using the administrative user.

1 0
replied on July 19, 2018

Hi Greg,

There are two ways to approach integrations like this in a Laserfiche Avante or Rio environment

The first approach is to set up the integration such that it will run as specific users - you get the user’s credentials in the integration and pass that along to the Laserfiche Server so it will use their named licenses.

For service integrations that do not run as specific users, you’ll want to talk with your VAR about Keyes application license options, which allows integrations to communicate using an application key.

1 0
replied on July 19, 2018 Show version history

Application license doesn't sound familiar to me - we have been using a username / password credential to create our session. Here is the relevant code that is being used :

        private Session CreateSession()
        {
            Session mySess = new Session();
            // Set IsSecure to true to use SSL.
            mySess.IsSecure = true;
            mySess.CanShareLicense = true;
            
            // Remember to use the FQDN for your Laserfiche Server.
            var repositoryRegistration = new RepositoryRegistration(_config.Uri, _config.Repository);
            // This code sample uses the default ports.
            mySess.Connect(repositoryRegistration);
            mySess.LogIn(_config.Username, _config.Password);

            return mySess;
        }

It sounds like we may need to assign a different type of license to the user accounts that are creating the session? And we also need to set an application key?

Thanks! 

0 0
replied on July 19, 2018

Okay, after assigning a user licence to the username we're using to connect, we're able to open multiple sessions without running into the login error. I'm not familiar with the Keyes application license, but will reach out to our VAR to see what options are for that licensing. 

Out of curiosity, how many connections should be allowed with the named license vs the Keyes license? Is that documented somewhere? I see in the documentation that 4 concurrent sessions are allowed for normal GUI users, but nothing about whether or not that limit is the same for SDK connections. 

0 0
replied on July 19, 2018

SDK connections that use a standard user license are subject to the same restrictions. The Keys licensing is a bit different because you instead have a license "pool" and each session takes one out of that pool.

For example, if you have 10 application licenses, you can have 10 sessions. They are not tied to a specific account so you could log in as multiple different users while still running under an application license through the SDK.

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

Sign in to reply to this post.