EBMS Tickets

Issue Number 176
Summary [Printing] Problems reprinting old print jobs
Created 2014-04-02 10:20:19
Issue Type Inquiry
Submitted By Juthe, Robin (NIH/NCI) [E]
Assigned To alan
Status Closed
Resolved 2015-12-15 23:05:12
Resolution Won't Fix
Path /home/bkline/backups/jira/oceebms/issue.121856
Description

Bonnie is having some problems reprinting old print jobs. This was most recently an issue with job 93. The problem may have to do with the files not being saved properly. Here are a few questions:

1. When reprinting an old print job, does the job id correspond with the number on the download printing outputs page? If so, do leading zeros need to be added? e.g., job 93 = job 00093.

2. Bonnie is usually presented with a pop-up box asking her to save the files. Do the files go anywhere if she doesn't click "save"? She couldn't find the files in her downloads folder. Is it possible to retrieve those files if they weren't saved to her downloads folder?

In this example, Bonnie printed the packets for Don Abrams individually as a work-around. I'm not sure if there's a bug or if additional instructions could solve the problem. Thanks in advance for your help!

Comment entered 2014-08-22 00:17:45 by alan
When a print job is initiated in "Live mode" here is what happens:

  1. The documents are assembled in a tar archive and stored in the /tmp
     directory on the server.

  2. The packets are marked in the database as printed for the users
     identified in the job.  This prevents them from being printed again
     the next time a job is run - which is normally what we want.

     This is the big difference between "Live" mode and "Test" mode.  In
     test mode the packets are not marked as printed and the job
     parameters can be re-entered to run again.

  3. An entry is made in the database detailing the parameters of the
     job and that it was successful.

  4. The tar archive is sent to the user's web browser.

     The server has now done it's job and does no more.

  5. The browser asks the user what to do with the tar file.

  6. If, and only if, the user says to save it, it will be saved in the
     default download directory.

     If the user doesn't say to save it, for example if the user says to
     open it with WinRAR or WinZip or some similar package, then it is
     not explicitly saved, though it's possible that the WinRAR or
     WinZip or whatever package squirreled it away somewhere in a cache.

Sometime later, the amount of time determined by CBIIT:

  7. Old data in the /tmp directory gets erased on the server.

                        Current Recovery Methods
                        ------------------------

Right now the methods below are our only choices for recovery:

  1. If the physical printing fails or the data is lost then, if the
     data has been saved on the user's file systems it can be recovered
     there.

     There are two ways to search for files to see if the tar file went
     somewhere unexpected:

     a. Click the Windows Start button, then enter all or part of a
        filename in the "Search programs and files" box.  I think that
        will only work for the user's own hard drive, not a network
        mapped drive.

     b. Open a command windows.  Go to the root of the file system.
        Search for the file.  For example, to find all files that begin
        with "PrintJob00" and end with "tar".

            h:
            cd \
            dir PrintJob00*tar /s

        The "/s" at the end says to look in all subdirectories too.

        This can take a while time but will find things even if they are
        in hidden files or directories and should work on a network
        mapped drive as well as on the user's hard disk.

        If the file is found it can be moved or copied to where it
        should permanently reside and reprinted from there.

  2. If it's not in the user's file systems, then if it hasn't yet been
     erased from the /tmp directory on the server, we can re-download it
     from there using the "Reprint successful print job" option on the
     Print Packets page.

  3. If it's not there either, then we can try asking CBIIT if they can
     search old backups or "snapshots" to see if they still have it.

                          New Recovery Method?
                          --------------------

There are various ways to improve on this for the future.  One that I
like, and that may not be too hard (but may not be trivially easy) is to
override the restrictions currently set for live mode, look at the
database record of packets printed for a print job and regenerate the
tar files for those packets.  I _think_ we're saving enough information
to do that, but I'd have to do some research to be sure.

The data may not always exactly match what was in the actual print job,
but I'm guessing it would exactly match in the majority of cases.

To do this I would:

    First try to find an existing tar file for the job.

    If that failed, I'd try to regenerate the tar file.  I'd want to
    tell the user if the data was re-generated so there would be a
    warning about possible discrepancies.

I'd have to study this to be sure it would work but, on the surface of
it, it looks like it would.  We'd have to add this as a new task for the
backlog.
Comment entered 2014-08-26 16:26:04 by Kline, Bob (NIH/NCI) [C]

I've moved this to the backlog, following discussion with Heather this morning.

Comment entered 2014-10-14 22:08:45 by alan
Here's a bit more info about this.

Bonnie's configuration file (that I copied from her machine today) sends
the downloaded PrintJob00123.tar files to this directory:

    c:\Users\fergusonbc\Downloads

Within that directory, they will be unpacked into a subdirectories named
as follows:

    PrintJobs\PrintJob00123
    PrintJobs\PrintJob00124

    etc.

So, if the files were saved, and not just discarded or opened with
WinZip or some other archiver program, and not subsequently erased, the
.tar files will be in:

    c:\Users\fergusonbc\Downloads

and the individual pdf and doc files will be in files with names like:

    c:\Users\fergusonbc\Downloads\PrintJobs\PrintJob00123\Goldman NEJM 2012 23190226.pdf

The print jobs on the EBMS server can be referenced without the leading
zeros.  The zeros are only in the file name to make the sort orders be
right.

If we decide that we should save the PrintJobs on the server in a more
permanent place, I don't think that will be too hard to do, though it
will require updating server files that can only be deployed in a
release or patch.
Comment entered 2015-12-15 23:05:13 by alan

Bonnie and I discussed this last week and agreed (Bonnie: please correct me if I'm wrong) that we don't need this change at this time.

When the printing process was new it wasn't as clear how to use it but, with experience, the fact that old print jobs aren't saved forever on the server has not been a problem

Comment entered 2016-02-01 16:36:43 by Juthe, Robin (NIH/NCI) [E]

Bonnie verified this on QA SG.

Comment entered 2016-04-26 12:51:10 by Juthe, Robin (NIH/NCI) [E]

Bonnie said she is not having problems reprinting old jobs on PROD.

Elapsed: 0:00:00.000816