Mango Automation not starting after upgrade from 3.1.1 to 3.5.6
-
I recently upgraded Mango Automation 3.1.1 to 3.5.6 software in my Ubuntu box and encountered a error during start up. Here's what i did:
- Copy the whole MA_Home of existing working Mango 3.1.1.
- Make sure your /classes/env.properties file has been copied to /overrides/properties/env.properties (this will insure your changes will remain after upgrade)
- Delete the “lib” folder in your MA_HOME directory
- Download and unzip the Mango Automation 3.5.6 zip file into the MA_HOME folder overwriting the existing files.
- Start Mango and verify the upgrade.
- Then encountered the error in the image attached.
It looks like an H2 database issue but prior to the error, there was a warning error that Mango is shutting down due to Mango NoSQL is running in free mode (due to this is a test environment).
So my question is, do i need to be running a licensed core or NoSQL module in order for the upgrade to succeed?
-
Hi joeselbiyoyo, welcome to the forum!
So my question is, do i need to be running a licensed core or NoSQL module in order for the upgrade to succeed?
No.
I'm not sure why you're seeing that error. That constraint has existed on the eventDetectors since before the 3.x series, added in Upgrade12.
The easy way resolve it, if you do not have data you are trying to keep in a Mango/databases/mangoTSDB directory, is you rename the Mango/databases directory while Mango is not running, start on a clean database and import the JSON backup from the Mango/backup/ directory. Even if you did have data you wanted to keep, this would be easier (you would simple need to "Migrate NoSQL data" on the /mango_no_sql.shtm page after importing the JSON).
The slightly more difficult way, to maintain the existing H2 database, uses the
Mango/bin/h2-web-console.sh
script (edit the script to add the -webAllowOthers if you'll be accessing on another hostname). The credentials are found in the env.properties file. The image for login has the defaults: https://help.infiniteautomation.com/about-the-h2-databaseYou will need to run,
ALTER TABLE eventDetectors ADD CONSTRAINT eventDetectorsUn1 UNIQUE (xid, dataPointId);
And then stop the h2 web console and start Mango again. That's not guaranteed to resolve it, since whatever led your existing database to not have that constraint could manifest other ways, but it would at least get the boot farther.
-
Thank you for the response Phillip.
I have successfully upgraded to v3.5.6 using clean database and imported the JSON file from Configuration Import/Export. However, when performing the "Migrate NoSQL data", i have encountered the below error (see screenshots).It looks like the my existing database is having issue with the upgraded version since the migrate NoSQL data is getting its source from the old database?
And finally, we have created customized pages/dashboards. Apart from the JSON and Databases migration, what else do we need to import to the upgraded version? Say for example the licenses?
Appreciate the support.
-
That image suggests to me that the URL to the old database in the connection string is not correct. Wouldn't you have moved that to
/opt/mango_dev/databases_old
? H2 will automatically create an empty database at the location specified by the connection string unless the argumentIFEXISTS=TRUE
appears as one of the semicolon delimited connection string.And finally, we have created customized pages/dashboards. Apart from the JSON and Databases migration, what else do we need to import to the upgraded version?
Can you say more about how your dashboards were created, particularly the module they were built with? What version? Where on your old Mango's file structure were the files? What have you tried so far? There have been lots of more specific questions about this answered already.
Say for example the licenses?
Licensing shouldn't be an issue in getting your dashboards working.
-
Thank you Phillip for your response.
I am still stuck in Migrate NoSQL Data. I have renamed /opt/mango_dev/databases to /opt/mango_dev/databases_old and change the source path in the Migrate NoSQL data to the same. However, i still get the same error as the image above. Could it be because I removed some of the entries in the JSON file as the free license is only limited to 300 data points? -
No. If it says 'Table "DATAPOINTS" not found;' it means the connection string is not correctly pointed at your old Mango H2 database. It has nothing to do with the license. Add
;IFEXISTS=TRUE
to the end of your connection string so that you do not have new mah2.h2.db files appearing.