6 Replies Latest reply on Mar 24, 2015 1:12 PM by Jeff Geller

    Invalid length parameter

    Sarah Benkendorf Wayfarer

      Hey guys --

       

      We had a user who received this message while trying to release a job from a print station: "Invalid length parameter passed to the LEFT or SUBSTRING function."  Anyone have an idea of what might be causing this?

       

      Thanks,

      Sarah

        • Re: Invalid length parameter
          Timothy Grzeczka Pioneer

          Not sure which device brand you're working with, but I had similar issues with Secure Release and HP a while back. It had to do with PDFs from the web and odd / long file names (especially if it had wildcard characters in the file name). Make sure you're running the latest firmware on the device and the latest version of the iMFP software on the device from Pharos.

           

          I recall doing this helped our issue.

            • Re: Invalid length parameter
              Sarah Benkendorf Wayfarer

              Hi Timothy --

               

              We're experiencing a similiar issue -- Secure Release Services and HP Printers.  I checked out the user's job name and sure enough it was a pretty long file name.  I'll check to see if we're running the latest firmware on the printer when I get the chance.

               

              Thanks for the suggestion!

               

              Sarah

                • Re: Invalid length parameter
                  Timothy Grzeczka Pioneer

                  Hope that helps! A good workaround until you can do the update is have the users save down the file and then print it. If they directly print PDFs or other files from the web you get that odd file name from some websites. If they save the file down and change the file name (and take out the wildcard characters) that should fix it too.

              • Re: Invalid length parameter
                Steven English Guide

                Sarah,

                 

                Do you have any scripts attached to your print server?

                 

                Regards,

                Steven

                  • Re: Invalid length parameter
                    Sarah Benkendorf Wayfarer

                    Hi Steven --

                     

                    Just checked.  We have two -- one that I wrote in order to do direct printing and another that I don't recognize called "GetMFdStatusUsingLPD," which looks like this:

                     

                    // GetMfdStatus plug-in for XeroxAble MFDs

                    //

                    // Note:

                    //

                    // The LPD client "lpq.exe" is required to run this script.

                    // If typing "lpq" from a command prompt does not run LPQ

                    // (and print usage instructions for it) then install the

                    // Microsoft TCP/IP Printing Services.

                    //

                    // Change the values below to customise

                    //

                    // Timeout in seconds for LPQ

                    //

                    new timeout = 20;

                     

                     

                    // Status string returned by LPQ for idle MFD

                    //

                    new idle_string = "no entries";

                     

                     

                    // Prefix of error string returned by LPQ

                    //

                    new error_string = "Error";

                     

                     

                    // Name of queue on MFD that holds print jobs

                    //

                    new queue_name = "lp";

                     

                     

                    // The start of the actual script

                    //

                    PlugIn.Status = -1; // Default status is error

                     

                     

                    // LPQ the MFD to get its status

                    //

                    import "Win32";

                    import "IO";

                    new results = "";

                    new command = "lpq -S" + PlugIn.MfdIp +

                        " -P\"" + queue_name + "\"";

                    new result = Win32.ExecProcess(command, timeout * 1000, results);

                     

                     

                    // Did LPQ run ok?

                    //

                    if (result != -1)

                    {

                        // Yes, so is the MFD idle?

                        //

                        String.TrimLeft(results);

                        String.TrimRight(results);

                        IO.PrintLine(results);          // debugging output

                        if (results == idle_string)

                        {

                            // Yes, so return status of idle

                            //

                            PlugIn.Status = 0;

                        }

                        else if (String.Find(results, error_string) == 0)

                        {

                            // No, we have an error

                            //

                            PlugIn.Result = false;

                            PlugIn.Error = results;

                        }

                        else

                        {

                            // No, probably busy, so log the status to

                            // the console and return status of busy

                            //

                            IO.PrintLine("MFD \'" + PlugIn.Mfd +

                                "\' status is " + results);

                            PlugIn.Status = 1;

                        }

                    }

                    else

                    {

                        // No, so log an error message to the console, and fail

                        // with an error suggesting that LPQ was not found

                        //

                        IO.PrintLine("MFD \'" + PlugIn.Mfd +

                            "\' status could not be checked");

                        PlugIn.Result = false;

                        PlugIn.Error = "Error executing 'lpq.exe' - ensure that " +

                            "Microsoft TCP/IP Printing Services are installed";

                    }

                  • Re: Invalid length parameter
                    Jeff Geller Guide

                    Hi Sarah,

                     

                    This has been seen before and found to be related to an improper set of "print job attributes" for the print job that were detected by the page counter.  It is an error in the stored procedure that processes this information.

                     

                    If you could open a support incident with Pharos Support we can provide an updated set of stored procedures to help with this edge case that was found.

                     

                    Let me know if you have any questions.

                     

                    Regards,

                    Jeff Geller

                    Pharos Support