babelfish-for-postgresql / babelfish_compass

Babelfish Compass: compatibility assessment tool for Babelfish for PostgreSQL
Apache License 2.0
108 stars 21 forks source link

Exception in thread "main" java.nio.file.NoSuchFileException: BabelfishCompassUser.Optimistic.cfg #102

Closed adnan79git closed 1 year ago

adnan79git commented 1 year ago

Unable to run BabelFish due to the following error:-

C:\BabelfishCompass>BabelfishCompass.bat MyReport hhscript.sql
Babelfish Compass v.2023-03, March 2023
Compatibility assessment tool for Babelfish for PostgreSQL
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

Reading BabelfishFeatures.cfg
Latest Babelfish version supported: 3.1.0: BabelfishFeatures.cfg
Exception in thread "main" java.nio.file.NoSuchFileException: BabelfishCompassUser.Optimistic.cfg -> C:\Users\xxxx\Documents\BabelfishCompass\BabelfishCompassUser.Optimistic.cfg
        at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at sun.nio.fs.WindowsFileCopy.copy(Unknown Source)
        at sun.nio.fs.WindowsFileSystemProvider.copy(Unknown Source)
        at java.nio.file.Files.copy(Unknown Source)
        at compass.CompassUtilities.installOptimisticCfgFile(CompassUtilities.java:6965)
        at compass.CompassConfig.validateCfgFile(CompassConfig.java:1624)
        at compass.Compass.main(Compass.java:843)
C:\BabelfishCompass>
robverschoor commented 1 year ago

That's weird. Could you please:

robverschoor commented 1 year ago

Can you please replace your compass.jar file with the one attached here, and retry? compass.zip

ITfromHell commented 1 year ago

Hi, I had same problem, testet the compass.jar from your ZIP and it works! Testet at OSX Catalina 10.15.7 and Windows Server 2019 1809 with JRE 1.8.0_361

Now I´m curios to the results of the tool ;-) Thanks a lot!

adnan79git commented 1 year ago

Thanks Rob. It worked after I replaced compass.jar with the one you provided.

robverschoor commented 1 year ago

Okay ... but I'd still like to understand what happened. 'cos I am unable to reproduce the scenario which matches your stack trace. The new .jar just doesn't exist when that condition occurs. Would you mind checking the following:

I'd really like to solve this so I'd greatly appreciate if you could shine a bit more light on it. Thanks in advance!

adnan79git commented 1 year ago

The contents of my Babelfish installation directory are as follows:- babelfish-installation

The contents of C:\Users\Documents\BabelfishCompass directory:- babelfish-doc

As we can see the contents are not identical. I think I downloaded the installation zip file and just unzipped in a folder and then started to use it on the command line. No other installation step was taken.

robverschoor commented 1 year ago

Thanks. When you run Compass, the first thing it does is copy BabelfishCompassUser.Optimistic.cfg from the installation directory to C:\Users\Documents\BabelfishCompass. This is the step that originally failed in your first post. It looks like it still fails, and Compass prints a message about it, but it doesn't stop you from proceeding. Would you mind checking your console output directly following the line Latest Babelfish version supported: 3.1.0: BabelfishFeatures.cfg

Thanks!

adnan79git commented 1 year ago

I deleted previously downloaded folder and did a fresh download and unzipped. Ran powershell as admin - and gave another go at generating the report. This time around it went without a glitch. Probably needed admin privileges or this latest download addresses the issue. I can see BabelfishCompassUser.cfgand BabelfishCompassUser.Optimistic.cfg under C:\Users\[user name]\Documents\BabelfishCompass now. Thank you for your support. Much appreciated!

robverschoor commented 1 year ago

Thanks for confirming. The next Compass release (v.2023-03-a) will contains this modification.