Every bug in the world can be solved with just 15 new lines!

May, 26, 2009 | Programming | 4 responses

Customers of Digital Pacific will be happy to know that in a few months time, we will be moving to a new; more feature complete billing system that will provide many benefits to users. With our new billing system, Parallels Business Automation, users will be able to see all their invoices (past, present and future) and will be able to literally click one button and switch between all of their hosting control panels.

This move, however, has not been without quite a number of funny mishaps while moving from our current billing system (ModernBill) to Parallels Business Automation (“PBA”). The following text is going to go into quite a bit of technical information, so if you don’t know what XML is, well, you might just want to close this window go to Wikipedia’s article on XML and look it up!

Observe this image very closely:

strange-behavior

So what I have done, is I have made a set of files with 100 customers each. Every separate file gets imported by running the command on the PBA server ‘hspc-import.pl’. Here, I am running the 59th file (the files start at 00). hspc-import.pl is complaining that the email for person “Becky A. Douglas” is not defined, however, when I go to edit the file, the email is infact correct, and it is definitely defined. Just like it is for the clients before her.

This issue has had me baffled for weeks trying to solve this issue. Sometimes it works, sometimes it does not. Sometimes changing the name in the XML file will just magically solve the issue, as if it was not there to begin with.

So what I do, is I get on Skype and call our Sales Engineer at Parallels, and tell him what the issue is. He points out a few issues with the XML file (which is fair enough, but why did all the clients before these “just” import without any issues?).

I take into account the issues that he pointed out, and go and create a new set of import documents to get our clients into our new billing system. I run all the commands again to start the process rolling, and now the issue is coming up again!

But now something very, very bad is going on! The import is actually failing faster then it was before the fixes that were suggested by our Sales Engineer. So I back track and change a few lines in the XML file. Instead of the top of the file saying this:

<?xml version="1.0" encoding="UTF-8"?>
<data>
<account>
<type>CUSTOMER</type>
<status>active</status>
<is_corporate>0</is_corporate>
<name>Bob Smith</name>

It now says this:

<?xml version="1.0" encoding="UTF-8"?>
<data>

.
.
.
.
.
.
.
.
.
.
.
.
.
.


<account>
<type>CUSTOMER</type>
<status>active</status>
<is_corporate>0</is_corporate>
<name>Bob Smith</name>

After adding exactly 15 new lines after the <data> child in the failing XML file in the import batch, you wouldn’t believe it. The import actually succeeded.

So now my new motto is, “Every bug in the world can be solved with just fifteen newlines!“.

Comments

Comment Posted By: Tim Post

That which can not be cured with EXACTLY fifteen newlines should be re-written in LISP. I really think you’re onto something here!

Comment Posted By: Mr_LeE

will this solve the ever recurring problem of people using windows over os x :P?

Comment Posted By: Stephen Rowley

You didn’t say what caused you to try the 15 new lines. Why did you do this? Steve

Comment Posted By: Tim G (Digital Pacific)

Stephen, first, love your website. What caused me to try the 15 lines was our sales manager at Parallels told me that a particular section of the export file that I generated should not be there. When I removed it, it actually worked. However, when I removed it on all the exported files the export once again started failing (this time earlier). So what I did is I added about 10 new lines, clicked in the middle and pasted back in the section that should not be there.

Once it worked, it got me thinking whether it was the blank lines, or the section that was (supposedly) not needed. Well, we both know which one it was 😉

Leave Your Comment








x AU Domains

Secure your brand name with Australia's newest domain.

Browse The Full Site On Your Desktop