Uploaded image for project: 'Apache Lens (Retired)'
  1. Apache Lens (Retired)
  2. LENS-776

Lens Server not Starting if there is a failure in creating "saved query" table

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      This is coming with the default config and i was using MySql db

      <property>
         <name>lens.server.savedquery.jdbc.dialectclass</name>
         <value>org.apache.lens.server.query.save.SavedQueryDao$HSQLDialect</value>
         <description>Dialect of the target DB, Default is HSQL. Override with the target DB used.</description>
       </property>
      

      Even with HSQL, saved_query table creation failure shouldnt stop lens server from coming up.

      Exception

      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] ERROR org.apache.lens.server.LensServer - Error while creating Lens server
      java.lang.RuntimeException: Cannot initialize saved query service
              at org.apache.lens.server.query.save.SavedQueryServiceImpl.init(SavedQueryServiceImpl.java:69) ~[classes/:na]
              at org.apache.hive.service.CompositeService.init(CompositeService.java:59) ~[hive-service-0.13.3-inm.jar:0.13.3-inm]
              at org.apache.lens.server.LensServices.init(LensServices.java:235) ~[classes/:na]
              at org.apache.lens.server.LensServer.startServices(LensServer.java:135) ~[classes/:na]
              at org.apache.lens.server.LensServer.<init>(LensServer.java:85) ~[classes/:na]
              at org.apache.lens.server.LensServer.createLensServer(LensServer.java:74) ~[classes/:na]
              at org.apache.lens.server.LensServer.main(LensServer.java:191) ~[classes/:na]
      Caused by: org.apache.lens.server.api.error.LensException: Error initializing saved query dao
              at org.apache.lens.server.query.save.SavedQueryDao.<init>(SavedQueryDao.java:72) ~[classes/:na]
              at org.apache.lens.server.query.save.SavedQueryServiceImpl.init(SavedQueryServiceImpl.java:64) ~[classes/:na]
              ... 6 common frames omitted
      Caused by: org.apache.lens.server.api.error.LensException: Cannot create saved query table!
              at org.apache.lens.server.query.save.SavedQueryDao.createSavedQueryTableIfNotExists(SavedQueryDao.java:85) ~[classes/:na]
              at org.apache.lens.server.query.save.SavedQueryDao.<init>(SavedQueryDao.java:70) ~[classes/:na]
              ... 7 common frames omitted
      Caused by: java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name varchar(255), description var' at line 1 Query: CREATE TABLE if not exists saved_query  (id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name varchar(255), description varchar(255), query varchar(255), params_json varchar(255), created_at timestamp, updated_at timestamp) Parameters: []
              at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:363) ~[commons-dbutils-1.5.jar:1.5]
              at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:490) ~[commons-dbutils-1.5.jar:1.5]
              at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:420) ~[commons-dbutils-1.5.jar:1.5]
              at org.apache.lens.server.query.save.SavedQueryDao.createSavedQueryTableIfNotExists(SavedQueryDao.java:83) ~[classes/:na]
              ... 8 common frames omitted
      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] INFO  org.apache.lens.server.LensServices - Stopping lens server
      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] INFO  org.apache.lens.server.LensServices - Server restart is not enabled. Not persisting the server state
      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] INFO  org.apache.hive.service.CompositeService - Error stopping query
      java.lang.NullPointerException: null
              at org.apache.lens.server.query.QueryExecutionServiceImpl.stop(QueryExecutionServiceImpl.java:1129) ~[classes/:na]
              at org.apache.hive.service.CompositeService.stop(CompositeService.java:102) [hive-service-0.13.3-inm.jar:0.13.3-inm]
              at org.apache.hive.service.CompositeService.stop(CompositeService.java:92) [hive-service-0.13.3-inm.jar:0.13.3-inm]
              at org.apache.lens.server.LensServices.stop(LensServices.java:402) [classes/:na]
              at org.apache.lens.server.LensServer.main(LensServer.java:201) [classes/:na]
      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] INFO  org.apache.lens.server.EventServiceImpl - Removed listener org.apache.lens.server.metrics.MetricsServiceImpl$AsyncQueryStatusListener@3ddc6915
      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] INFO  org.apache.lens.server.metrics.MetricsServiceImpl - Stopped metrics service
      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] INFO  org.apache.lens.server.EventServiceImpl - Event service stopped
      16 Sep 2015 08:17:34 [0bd00660-d2d0-42a6-bdc6-e8b31e895da6] [main] ERROR org.apache.lens.server.LensServer - Error stopping services
      java.lang.NullPointerException: null
              at org.apache.lens.server.LensServices.stop(LensServices.java:395) ~[classes/:na]
              at org.apache.lens.server.LensServer.main(LensServer.java:201) ~[classes/:na]
      

        Attachments

        1. LENS-776.patch
          1.0 kB
          Amruth Sampath

          Activity

            People

            • Assignee:
              amrk7 Amruth Sampath
              Reporter:
              arshadmatin20 Arshad Matin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: