Our Virtual Check-in System

Sunday, February 08, 2009 3:34 PM by nairdo

For the past few weeks, I was beginning to think our new Arena check-in module was only going to be a virtual system -- not a real, working application.  You see, we had to postpone the full rollout a few weeks ago when our first full scale pilot had a printing meltdown.  After about 20-40 people had successfully checked in, all remaining check-in labels (Zebra LP2824) would fail to print.

Zebra LP2824: my baneIn hindsight, the source of the problem now seems virtually clear... (hint hint)

Jason and I could see where the problem was, but we couldn't explain it.  In code, we check the PrintDocument's IsValid property, and while normally this should return true, after some unknown point it would always return false.   We also discovered just prior to this, our exception log had a System.AccessViolationException with the message 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

The only way to clear the system from this state was to perform an "iisreset".   The problem seemed to linger in the IIS application pool.  We reckoned that the memory Derek added to the VM host a few days earlier might be the issue so we removed it and tried again.  Same problem.

We did more digging and testing and were able to see this in the stack trace:

at System.Drawing.Internal.IntUnsafeNativeMethods.IntCreateDC(String lpszDriverName, String lpszDeviceName, String lpszOutput, HandleRef lpInitData) 
at System.Drawing.Internal.IntUnsafeNativeMethods.CreateDC(String lpszDriverName, String lpszDeviceName, String lpszOutput, HandleRef lpInitData) 
at System.Drawing.Internal.DeviceContext.CreateDC(String driverName, String deviceName, String fileName, HandleRef devMode) 
at System.Drawing.Printing.PrinterSettings.CreateDeviceContext(IntPtr hdevmode) 
at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) 
at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e) 
at System.Drawing.Printing.PrintController.Print(PrintDocument document) 
at System.Drawing.Printing.PrintDocument.Print() 
at Arena.Custom.Cccev.CheckIn.CheckinLabel.PrintAllLabels(String printerURL) in C:\Arena Trunk\trunk\Arena.Custom.Cccev\Arena.Custom.Cccev.CheckIn\Entity\CheckinLabel.cs:line 341 
at Arena.Custom.Cccev.CheckIn.Entity.CccevPrintLabel.Arena.Custom.Cccev.CheckIn.Entity.IPrintLabel.Print(FamilyMember attendee, IEnumerable`1 occurrences, OccurrenceAttendance attendance) in C:\Arena Trunk\trunk\Arena.Custom.Cccev\Arena.Custom.Cccev.CheckIn\Entity\CccevPrintLabel.cs:line 61 
at Arena.Custom.Cccev.CheckIn.Controller.PrintLabel(FamilyMember attendee, IEnumerable`1 occurrences, OccurrenceAttendance attendance) in C:\Arena Trunk\trunk\Arena.Custom.Cccev\Arena.Custom.Cccev.CheckIn\CheckInBLL.cs:line 500

Hmmm... IntUnsafeNativeMethods...This seemed to point us in the direction of a driver problem.  We removed the latest Seagull Scientific drivers (7.1.6) and put their older drivers (7.0.2) which we've been using in another environment with no issues.  The problem happened again, but the exception was slightly different:

at System.Drawing.SafeNativeMethods.DocumentProperties(HandleRef hwnd, HandleRef hPrinter, String pDeviceName, IntPtr pDevModeOutput, IntPtr pDevModeInput, Int32 fMode) 
at System.Drawing.Printing.PageSettings.CopyToHdevmode(IntPtr hdevmode) 
at System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings pageSettings) 
at System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) 
at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e) 
at System.Drawing.Printing.PrintController.Print(PrintDocument document) 
at System.Drawing.Printing.PrintDocument.Print() 
at Arena.Custom.Cccev.CheckIn.CheckinLabel.PrintAllLabels(String printerURL) in C:\Arena Trunk\trunk\Arena.Custom.Cccev\Arena.Custom.Cccev.CheckIn\Entity\CheckinLabel.cs:line 341 
at Arena.Custom.Cccev.CheckIn.Entity.CccevPrintLabel.Arena.Custom.Cccev.CheckIn.Entity.IPrintLabel.Print(FamilyMember attendee, IEnumerable`1 occurrences, OccurrenceAttendance attendance) in C:\Arena Trunk\trunk\Arena.Custom.Cccev\Arena.Custom.Cccev.CheckIn\Entity\CccevPrintLabel.cs:line 61 
at Arena.Custom.Cccev.CheckIn.Controller.PrintLabel(FamilyMember attendee, IEnumerable`1 occurrences, OccurrenceAttendance attendance) in C:\Arena Trunk\trunk\Arena.Custom.Cccev\Arena.Custom.Cccev.CheckIn\CheckInBLL.cs:line 500

Could the problem be with the Hyper-V which is running our virtualized server?  Phil recommended that we copy our environment to a non-virtualized host, and after several more hours of setup and testing -- presto -- problem gone.  We ran our Gilbert campus children's check-in all weekend long on this temporary, alternate system without a hitch.  Jason and I finally took a sigh of relief.

Our (Derek's) next step is to definitively isolate the problem by moving our server to Microsoft's Virtual Server to see if the problem is exclusively with Hyper-V, and if needed, possibly de-virtualize the system entirely back to reality.

I wonder if we're the only shop trying to serve Zebra printers with Seagull Scientific drivers on a Win2003 virtual environment.  Anyone?  (If you're out there, we feel your pain.)

Comments

  1. nairdo Says:

    UPDATE: When we did our non-virtualized test we used Windows 2003 R2 Enterprise SP2 and did not realize that our production box was only Windows 2003 Standard SP2.  After another series of VM and OS combination tests (best described on Derek's blog http://grinding-it-out.blogspot.com/2009/02/score-1-for-hyper-v.html) we discovered the problem was actually with Windows 2003 Standard SP2.  Everything works great virtualized as long as we're running the revamped R2 build of Windows 2003.

New Comments to this post are disabled

Powered by Community Server, by Telligent Systems