Want to know The Truth About CPM?

21 January 2016

Stupid Programming Tricks No. 28 -- LCM, 7z, and Planning migrations

How long can Yr. Obt. Svt. be wrong?

The answer to that question is apparently indefinitely.  And the task so trivial.  Sigh.

The problem

This post was supposed to be one in my Compleat Idiot’s Guide to PBCS series and I will use some screenshots from a future post on on-premises to PBCS and back migration but I got hung up on making this work.

And then I realized I made the same mistake at a client.  Remember what consultants are supposed to do:  help customers.  I did, sort of, but I made my task much harder.  Sorry.

Let’s walk through this using PBCS although as you will see the issue is exactly the same in on-premises.  Sigh.

The Brotherhood of Man

I have to give credit to my younger, taller, smarter brother from a completely different set of parents, Celvin Kattookaran.  In my hour of need (I have many, too many) he came through for me and didn’t even make all that much fun of me when he explained the answer.

Breaking LCM

I want to migrate an on-premises application to  PBCS.  I have the old Planning sample application from (I think) 11.1.1.3.  I have it working in both 11.1.2.3.500 as well as 11.1.2.4.  It’s a simple application, really simple, and I find simple hard enough as will be shown.

Please leave the premises

Here I am on my on-premises install of 11.1.2.4.  I click on Application Management and…

Here I am in good old Shared Services:

I then export the application file objects:

I’ve moved it to another my Windows 7 VM (I try to keep my 11.1.2.4 VM local only):

Not a cloud in the sky

Here I am in PBCS’ Application Management.  It’s just about the same as Shared Services:

Upload the LCM zip file:

And, as expected, here are the artifacts in PBCS.  As Danny Kaye says, everything is tickety-boo.

So what’s the problem?

If I unzip the application download and then make a change, any change, or even no change at all, and then rezip the file I get this on reimport.

Here I am in 7-Zip, a really awesome WinZip open source clone.  Fwiw, I actually have WinZip (I even paid for it and don’t like violating licenses by installing it on more than one machine) on my bare-metal laptop but 7-Zip is free and has almost all of the functionality; in some ways it’s quite a bit more advanced.

Here’s the folder unzipped.  If I were migrating this to an on-premises install I could copy this entire folder without compression to the import_export Shared Services folder.

Now I’m going to zip this to SampApp1a.zip.  Note that not a blessed thing has changed to the contents.  Also note that the compression engine, be it 7-Zip or Windows’ own compression functionality, makes no difference.  
The below are defaults:

Zip-a-Dee-Doo-Dah indeed


Uh-oh.  There’s a difference in size of the compressed archive.  How can that be?  Nothing and I mean nothing has been changed.  Oh well, there couldn’t possibly be anything to worry about yr. obt. svt. blithely thinks.

The upload goes swimmingly, I think.

Oh how wrong I am despite this lovely message:

And what happens when I try to open the file?

¡Ay, caramba!

Is the service really not available?  That’s silly as it’s clearly there and thus we see Yet Another Confusing Error Message.  Perhaps Oracle never anticipated someone doing something as boneheaded as is described below?  Probably.

Here’s the problem.  I zipped an unzipped folder and that was the issue.  Wot?  It’s the same, right?  Nope.

Here’s the zip file from Planning.

And here’s the unzipped-to-zipped archive.  Do you see what I did?  I zipped the SampApp1 folder within the archive.  What?

It actually makes sense – I zipped c:\users\cameronl\downloads\SampleApp1 to c:\users\cameronl\downloads.  The SampApp1 folder is part of the overall path and thus it gets included in the zip file.  Ultimatel Fail.  Although to be fair that isn’t actually an intuitive result.  Regardless, I should have looked into the zip archive itself but alas did not.

Nothing’s Impossible

The solution is to go into the SampApp1 folder and zip from there.

And here we go, just as LCM defines the file structure.

Success! Boil in bag!

Upload it and all is well.  Despite the changed (or in this case not changed) zip file.

Ballin’ the Jack

And that’s it.  So trivial and so painful.

Oh yes, my poor unfortunate client.  Ugh.  I was tasked with splitting up a Planning application.  I downloaded the LCM xml files, did my modifications, zipped them back up and…failure.  Bugger.

As this was on-premises Planning, after a moderate amount of pain I was able to get access to the import_export folders and move the modified LCM files.  I understate the case:  getting that access was really painful.  If only I had begged on my knees asked for Celvin’s help back then.

May my errors not be yours.  

Great American Songbook

It’s difficult to tell if any of you ever click through on the hyperlinks I sprinkle throughout these posts.  Assuming that you do (or maybe assuming that you don’t) I thought I would give you a listing of the music (and one TV show and a few movies) so you can have some idea of my strange cultural tastes.  As I like to remind Natalie Delemar –  @EssbaseLady – popular culture pretty much doesn’t interest me much past 1965.  It shows.
 
In order:
  1. How to Succeed in Business Without Really Trying, The Brotherhood of Man, Robert Morse (The 1967 version is the OBC definitive version or as close as we can get save a time machine to get back to 1961.)
  2. The Honeymooners, Please Leave the Premises, Jackie Gleason aka The Great One, et. al.
  3. Merry Andrew, Everything is Tickety-Boo, Danny Kaye
  4. Song of the South, Zip-a-Dee-Doo-Dah, James Baskett
  5. Swing Time, Pick Yourself Up (medley), Andy Williams and Jack Jones
  6. That’s My Boy, Ballin’ The Jack, Dean Martin, Polly Bergen, and a guy who reminds me of me only with a lot more talent

I like to think that a hundred years from today The Great American Songbook will be what our descendants will view as the musical acme of the 20th century.  Jazz is America’s Classical Music, or at least it is on this blog.

Be seeing you.

1 comment:

Henri Vilminko said...

I admit having done the same mistake a few times. The error message is really misleading indeed. The behavior is same in 11.1.2.4 - this is what gets reported in the server-side log file:

... [SRC_METHOD: log] Invalid filesystem - D:\Oracle\Middleware\user_projects\epmsystem1\import_export\STAT7DIM_LCMcopy\STAT7DIM_LCMcopy in MDF
... [SRC_METHOD: log] Either the listing file is unavailable or the file system structure is incorrect for - D:\Oracle\Middleware\user_projects\epmsystem1\import_export\STAT7DIM_LCMcopy\STAT7DIM_LCMcopy.
... [SRC_METHOD: log] Service currently not available.

I think LCM should be enhanced to check the zip archive already during the upload process. Currently the process just happily accepts _any_ zip file and extracts it to the import_export folder and the user doesn't get an error until attempting to open the contents.