• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    2.7.8 Upgrade

    User help
    3
    18
    5.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JoelHaggarJ
      JoelHaggar
      last edited by

      Looks like an issue specifically to upgrading on MySQL and something we should be able to fix first thing this morning. I'm not sure putting the 2.7.6 zip files back in you might need to restore a backup of your MySQL database.

      When using MySQL as your database the best practice to follow is to first dump your database and then make a zip file of your Mango install folder this way you can always do a full roll back.

      1 Reply Last reply Reply Quote 0
      • BGB
        BG
        last edited by

        Hello Joel,
        I am not using the Mysql as the main database but I know that Mango uses some of the tables for things like events and users.

        I have a recent Mango back up to restore. We do an automatic back up each morning approx 5 am local time here.

        I am halfway through uploading the 2.7.6 core files so will continue with that.

        Thank you for your reply.

        Cheers

        Brian

        1 Reply Last reply Reply Quote 0
        • JoelHaggarJ
          JoelHaggar
          last edited by

          Hey Brian,

          I think you should receck your settings, this error seems to be clearly a MySQL error and we only saw this error happen if using a MySQL database. You can look at your env.properties file and also go to the system settings page in Mango and see what it says as the Database type at the top.

          ERROR 2016-03-16 12:58:49,644 (com.serotonin.m2m2.Main.main:120) - Error during initialization
          com.serotonin.ShouldNeverHappenException: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [CREATE TABLE jsonData (id int not null auto_increment,xid varchar(50) not null, name varchar(255) not null, readPermission varchar(255), editPermission varchar(255), data clob, primary key (id))engine=InnoDB; ]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

          1 Reply Last reply Reply Quote 0
          • BGB
            BG
            last edited by

            Hello Joel,
            I have expanded the 2.7.6 files over the existing files on the linux server. And restarted the service. I have also put the 5 module zip files for ver 2.7.6 into the home folder.

            After restarting the Mango service, it tries to start 2.7.8:

            [root@M-2-M ~]# ma-start: MA started with Process ID: 3547
            INFO 2016-03-16 16:04:11,233 (com.serotonin.m2m2.Main.main:82) -** Starting Mango 2.7.8** with Schema Version: 12

            And I can see the updated modules getting loaded as well.

            After the modules get loaded it looks like the same lines get put in.

            I take you point that it looks like a Mysql error but I did not specifically set up any MySQL tables. These must tables that Mango use natively and used without error in 2.7.6 or are new tables in ver 2.7.8

            bad SQL grammar [CREATE TABLE jsonData (id int not null auto_increment,xid varchar(50) not null, name varchar(255) not null, readPermission varchar(255), editPermission varchar(255), data clob, primary key (id))engine=InnoDB; ]

            I don't know what table is 'jsonData'
            It also looks like it is terminating something called Mango Lifecycle:

            INFO 2016-03-16 16:04:14,263 (com.serotonin.m2m2.Lifecycle.terminate:344) - Mango Lifecycle terminating...
            INFO 2016-03-16 16:04:14,279 (com.serotonin.m2m2.db.BasePooledProxy.terminateImpl:110) - Stopping database

            Now I cannot get back into my mango to check any settings in any event.

            Any advice would be greatly appreciated.

            Brian

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by

              Hi Brian,

              I put a new Core version, 2.7.10, out to fix this issue.

              1 Reply Last reply Reply Quote 0
              • BGB
                BG
                last edited by

                So do I now need to do a full re-install?

                I can't get back to our mango site to do an upgrade the normal way.

                Brian

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  Brian,

                  Please check your env.properties for your database setting. It would appear to me Mango is trying to create a new database on MySQL.

                  Yeah, you will need to drop the m2m2-core-2.7.10.zip into your Mango/ directory, then relaunch.

                  1 Reply Last reply Reply Quote 0
                  • phildunlapP
                    phildunlap
                    last edited by phildunlap

                    Should that not be sufficient to resolve it, you can manually set the database back to the 2.7.6 schema and let .10 do the upgrade again, properly.

                    Step 1) Gain contact with the database...
                    H2:

                    1. Navigate to Mango/bin/h2-web-console.sh
                    2. Edit the script and add -webAllowOthers if you are not browsing from the same machine Mango runs on, and remember the port at the top (8081 by default).
                    3. Launch the script. Navigate to http://[ip]:h2-port/ in your browser
                    4. Fill in the credentials, and /path/to/Mango/databases/mah2 then connect

                    MySQL:

                    1. command line, mysql --user=[env's db.user] --password=[env's db.password] [databaseName]

                    Run the commands...

                    1. select * from systemSettings where settingname='databaseSchemaVersion'; is 11, is 12?
                      if 11,
                      Please post error from trying to start 2.7.10
                      if 12,
                    2. update systemSettings set settingvalue='11' where settingname='databaseSchemaVersion'; drop table jsonData;

                    Disconnect from the database, and finally, start up with 2.7.10 in your Mango/ directory.

                    1 Reply Last reply Reply Quote 0
                    • BGB
                      BG
                      last edited by

                      Hello Phil,
                      My env.properties in in the overrides folder and i have the following lines for the MySQL:

                      #MySQL database settings. Your MySQL instance must already be running and configured before this can be used.
                      db.type=mysql
                      db.url=jdbc:mysql://localhost/Mango_M2M
                      db.username=[valid username]
                      db.password=[valid password]

                      username and password removed but the ones listed are valid.

                      Again though the MySQL tables that are in that database are the ones created and used by Mango.

                      dataPointHierarchy, dataPoints, dataSources, eventHandlers, events, excelReportTemplates, excelReports, globalScripts, graphicalViews, mailingListInactive, mailingListMembers, mailingLists, maintenanceEvents, pointEventDetectors, pointLinks, pointValueAnnotations, pointValues, publishers, reportInstanceData, reportInstanceDataAnnotations, reportInstanceEvents, reportInstancePoints, reportInstanceUserComments, reportInstances, reports, scheduledEvents, selectedWatchList, systemSettings, templates, userComments, userEvents, users, watchListPoints, watchLists.

                      All of the data points are being kept in the NoSQL database.

                      #Database settings for conversion. If the db.* settings point to a new database instance, and the convert type setting
                      #is set, Mango Automation will attempt to convert from the convert.db.* settings to the db.* settings
                      #Note that database conversions should not be performed in the same step as an upgrade. First upgrade, then convert.
                      convert.db.type=
                      convert.db.url=${convert.db.url}
                      convert.db.username=${convert.db.username}
                      convert.db.password=${convert.db.password}

                      #Set the base path for where the NoSQL data will be stored
                      db.nosql.location=${ma.home}/databases/
                      #Set the folder name of the point value store
                      db.nosql.pointValueStoreName=mangoTSDB

                      These are the same settings I have been using for a while now with no problem.

                      I will try to force my service on to 2.7.10 as you suggest

                      Brian

                      1 Reply Last reply Reply Quote 0
                      • phildunlapP
                        phildunlap
                        last edited by

                        Ah. I am sure you have it configured rightly. We would phrase that situation as using MySQL and the NoSQL module, since your system's configuration and even events will be in the MySQL database. Simply a misunderstanding.

                        1 Reply Last reply Reply Quote 0
                        • BGB
                          BG
                          last edited by

                          Hello Phil,
                          Due to our excrutiatingly slow broadband at times... I finally have 2.7.10 put into the mango home folder.

                          I have started your steps to correct this:

                          Step 1) Gain contact with the database...
                          H2:

                          Navigate to Mango/bin/h2-web-console.sh

                          • DONE
                            Edit the script and add -webAllowOthers if you are not browsing from the same machine Mango runs on, and remember the port at the top (8081 by default).
                          • DONE
                            Launch the script. Navigate to http://[ip]:h2-port/ in your browser
                          • DONE
                            Fill in the credentials, and /path/to/Mango/databases/mah2 then connect
                          • ?? the path says it should be "mango/databases/mah2 but there is no mah2 folder or file in my databases folder

                          What do you want me to do from here?

                          Thanks

                          Brian

                          1 Reply Last reply Reply Quote 0
                          • phildunlapP
                            phildunlap
                            last edited by

                            Use the MySQL instructions. You are on MySQL

                            1 Reply Last reply Reply Quote 0
                            • BGB
                              BG
                              last edited by

                              oops, yeah sorry, its been a long day.

                              1 Reply Last reply Reply Quote 0
                              • BGB
                                BG
                                last edited by

                                How much longer will you be available today?

                                1 Reply Last reply Reply Quote 0
                                • phildunlapP
                                  phildunlap
                                  last edited by

                                  I will be available for many more hours, and I am happy to work directly with you to fix this. I will send you a message with some contact options.

                                  1 Reply Last reply Reply Quote 0
                                  • BGB
                                    BG
                                    last edited by

                                    Hopefully we will have this finished soon. Thanks for your help.

                                    1 Reply Last reply Reply Quote 0
                                    • phildunlapP
                                      phildunlap
                                      last edited by

                                      I have sent you an email, let's conduct the rest there and I'll post anything insightful at the end if there is something to share.

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post