Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

hst-server stopped

Highlighted

hst-server stopped

I am restarting hst-server but it is getting down :

Booting Derby version The Apache Software Foundation - Apache Derby - 10.9.1.0 - (1344872): instance a816c00e-0162-70fc-47fb-00001ce68b88
on database directory /var/lib/smartsense/hst-server/hstDB  with class loader sun.misc.Launcher$AppClassLoader@421faab1
Loaded from file:/usr/hdp/share/hst/hst-common/lib/derby-10.9.1.0.jar
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_111-b14
user.dir=/var/lib/ambari-agent
derby.system.home=null
Database Class Loader started - derby.database.classpath=''
[EL Warning]: metadata: 2018-03-29 11:00:05.203--ServerSession(1241480588)--Reverting the lazy setting on the OneToOne or ManyToOne attribute [agent] for the entity class [class com.hortonworks.support.tools.server.entity.RequestEntity] since weaving was not enabled or did not occur.
[EL Info]: connection: 2018-03-29 11:00:05.282--ServerSession(1241480588)--file:/usr/hdp/share/hst/hst-common/lib/smartsense-hst-1.3.0.0-22.jar_hst login successful
[EL Warning]: 2018-03-29 11:00:05.65--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'HST_AGENT' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE HST_AGENT (ID VARCHAR(255) NOT NULL, CONFIGUPDATEDTIME DATE, IPADDRESS VARCHAR(255), LASTMODIFIEDTIME DATE, STATUS VARCHAR(255), VERSION VARCHAR(255), PRIMARY KEY (ID))
Query: DataModifyQuery(sql="CREATE TABLE HST_AGENT (ID VARCHAR(255) NOT NULL, CONFIGUPDATEDTIME DATE, IPADDRESS VARCHAR(255), LASTMODIFIEDTIME DATE, STATUS VARCHAR(255), VERSION VARCHAR(255), PRIMARY KEY (ID))")
[EL Warning]: 2018-03-29 11:00:05.79--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'HST_REQUEST' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE HST_REQUEST (ID VARCHAR(255) NOT NULL, ANONYMIZED SMALLINT DEFAULT 0, CASENUMBER VARCHAR(255) NOT NULL, COMMAND VARCHAR(255) NOT NULL, CREATEDTIME TIMESTAMP, DIAGNOSTICSSERVICES VARCHAR(255), EXTRACOMMANDS VARCHAR(1024), LASTMODIFIEDTIME TIMESTAMP, LEVEL VARCHAR(255), PATH VARCHAR(255), REQUESTKEY VARCHAR(255) NOT NULL, SERVICE VARCHAR(255) NOT NULL, STATUS VARCHAR(255), agent_id VARCHAR(255) NOT NULL, PRIMARY KEY (ID))
Query: DataModifyQuery(sql="CREATE TABLE HST_REQUEST (ID VARCHAR(255) NOT NULL, ANONYMIZED SMALLINT DEFAULT 0, CASENUMBER VARCHAR(255) NOT NULL, COMMAND VARCHAR(255) NOT NULL, CREATEDTIME TIMESTAMP, DIAGNOSTICSSERVICES VARCHAR(255), EXTRACOMMANDS VARCHAR(1024), LASTMODIFIEDTIME TIMESTAMP, LEVEL VARCHAR(255), PATH VARCHAR(255), REQUESTKEY VARCHAR(255) NOT NULL, SERVICE VARCHAR(255) NOT NULL, STATUS VARCHAR(255), agent_id VARCHAR(255) NOT NULL, PRIMARY KEY (ID))")
[EL Warning]: 2018-03-29 11:00:05.861--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'HST_BUNDLE' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE HST_BUNDLE (ID VARCHAR(255) NOT NULL, ANONYMIZED SMALLINT DEFAULT 0, CASENUMBER VARCHAR(255), CREATEDTIME TIMESTAMP, LASTMODIFIEDTIME TIMESTAMP, LEVEL VARCHAR(255), OWNER VARCHAR(255), PATH VARCHAR(255), SCRIPTSPROCESSED SMALLINT DEFAULT 0, SERVICE VARCHAR(255), STATE VARCHAR(255), PRIMARY KEY (ID))
Query: DataModifyQuery(sql="CREATE TABLE HST_BUNDLE (ID VARCHAR(255) NOT NULL, ANONYMIZED SMALLINT DEFAULT 0, CASENUMBER VARCHAR(255), CREATEDTIME TIMESTAMP, LASTMODIFIEDTIME TIMESTAMP, LEVEL VARCHAR(255), OWNER VARCHAR(255), PATH VARCHAR(255), SCRIPTSPROCESSED SMALLINT DEFAULT 0, SERVICE VARCHAR(255), STATE VARCHAR(255), PRIMARY KEY (ID))")
[EL Warning]: 2018-03-29 11:00:05.933--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'HST_BUNDLE_SERVICE' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE HST_BUNDLE_SERVICE (ID VARCHAR(255) NOT NULL, CREATEDTIME TIMESTAMP, NAME VARCHAR(255), BUNDLE_ID VARCHAR(255), PRIMARY KEY (ID))
Query: DataModifyQuery(sql="CREATE TABLE HST_BUNDLE_SERVICE (ID VARCHAR(255) NOT NULL, CREATEDTIME TIMESTAMP, NAME VARCHAR(255), BUNDLE_ID VARCHAR(255), PRIMARY KEY (ID))")
[EL Warning]: 2018-03-29 11:00:06.001--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'HST_USER' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE HST_USER (user_id VARCHAR(255) NOT NULL, ACTIVE SMALLINT DEFAULT 0, CREATEDTIME DATE, LASTMODIFIEDTIME DATE, user_name VARCHAR(255), user_password VARCHAR(255), PRIMARY KEY (user_id))
Query: DataModifyQuery(sql="CREATE TABLE HST_USER (user_id VARCHAR(255) NOT NULL, ACTIVE SMALLINT DEFAULT 0, CREATEDTIME DATE, LASTMODIFIEDTIME DATE, user_name VARCHAR(255), user_password VARCHAR(255), PRIMARY KEY (user_id))")
[EL Warning]: 2018-03-29 11:00:06.097--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'HST_JOB' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE HST_JOB (ID VARCHAR(255) NOT NULL, COMMAND VARCHAR(1024) NOT NULL, CREATEDTIME DATE, EXITCODE INTEGER, requestKey VARCHAR(255) NOT NULL, LASTMODIFIEDTIME DATE, STATUS INTEGER, STDERR VARCHAR(5000), STDOUT VARCHAR(5000), PRIMARY KEY (ID))
Query: DataModifyQuery(sql="CREATE TABLE HST_JOB (ID VARCHAR(255) NOT NULL, COMMAND VARCHAR(1024) NOT NULL, CREATEDTIME DATE, EXITCODE INTEGER, requestKey VARCHAR(255) NOT NULL, LASTMODIFIEDTIME DATE, STATUS INTEGER, STDERR VARCHAR(5000), STDOUT VARCHAR(5000), PRIMARY KEY (ID))")
[EL Warning]: 2018-03-29 11:00:06.161--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'HST_SCHEDULE' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE HST_SCHEDULE (ID VARCHAR(255) NOT NULL, COMMAND VARCHAR(255), CUSTOM SMALLINT DEFAULT 0, LASTMODIFIEDTIME DATE, SCHEDULE VARCHAR(255), STATUS VARCHAR(255), username VARCHAR(255), PRIMARY KEY (ID))
Query: DataModifyQuery(sql="CREATE TABLE HST_SCHEDULE (ID VARCHAR(255) NOT NULL, COMMAND VARCHAR(255), CUSTOM SMALLINT DEFAULT 0, LASTMODIFIEDTIME DATE, SCHEDULE VARCHAR(255), STATUS VARCHAR(255), username VARCHAR(255), PRIMARY KEY (ID))")
[EL Warning]: 2018-03-29 11:00:06.232--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'BUNDLEAGENTS' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE BundleAgents (bundle_id VARCHAR(255) NOT NULL, agent_id VARCHAR(255) NOT NULL, PRIMARY KEY (bundle_id, agent_id))
Query: DataModifyQuery(sql="CREATE TABLE BundleAgents (bundle_id VARCHAR(255) NOT NULL, agent_id VARCHAR(255) NOT NULL, PRIMARY KEY (bundle_id, agent_id))")
[EL Warning]: 2018-03-29 11:00:06.3--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Table/View 'SERVICEAGENTS' already exists in Schema 'APP'.
Error Code: 30000
Call: CREATE TABLE ServiceAgents (service_id VARCHAR(255) NOT NULL, agent_id VARCHAR(255) NOT NULL, PRIMARY KEY (service_id, agent_id))
Query: DataModifyQuery(sql="CREATE TABLE ServiceAgents (service_id VARCHAR(255) NOT NULL, agent_id VARCHAR(255) NOT NULL, PRIMARY KEY (service_id, agent_id))")
[EL Warning]: 2018-03-29 11:00:06.35--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: Constraints 'UNQ_HST_REQUEST_0' and 'UNQ_HST_REQUEST_0' have the same set of columns, which is not allowed.
Error Code: 30000
Call: ALTER TABLE HST_REQUEST ADD CONSTRAINT UNQ_HST_REQUEST_0 UNIQUE (requestKey, agent_id)
Query: DataModifyQuery(sql="ALTER TABLE HST_REQUEST ADD CONSTRAINT UNQ_HST_REQUEST_0 UNIQUE (requestKey, agent_id)")
[EL Warning]: 2018-03-29 11:00:06.357--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "." at line 1, column 86.
Error Code: 30000
Call: ALTER TABLE HST_BUNDLE_SERVICE ADD CONSTRAINT HSTBUNDLE_SERVICE0 UNIQUE (name, bundle.id)
Query: DataModifyQuery(sql="ALTER TABLE HST_BUNDLE_SERVICE ADD CONSTRAINT HSTBUNDLE_SERVICE0 UNIQUE (name, bundle.id)")
[EL Warning]: 2018-03-29 11:00:06.423--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Constraint 'HSTREQUESTAGENT_ID' already exists in Schema 'APP'.
Error Code: 30000
Call: ALTER TABLE HST_REQUEST ADD CONSTRAINT HSTREQUESTagent_id FOREIGN KEY (agent_id) REFERENCES HST_AGENT (ID)
Query: DataModifyQuery(sql="ALTER TABLE HST_REQUEST ADD CONSTRAINT HSTREQUESTagent_id FOREIGN KEY (agent_id) REFERENCES HST_AGENT (ID)")
[EL Warning]: 2018-03-29 11:00:06.448--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Constraint 'HSTBNDLSRVICEBNDLD' already exists in Schema 'APP'.
Error Code: 30000
Call: ALTER TABLE HST_BUNDLE_SERVICE ADD CONSTRAINT HSTBNDLSRVICEBNDLD FOREIGN KEY (BUNDLE_ID) REFERENCES HST_BUNDLE (ID)
Query: DataModifyQuery(sql="ALTER TABLE HST_BUNDLE_SERVICE ADD CONSTRAINT HSTBNDLSRVICEBNDLD FOREIGN KEY (BUNDLE_ID) REFERENCES HST_BUNDLE (ID)")
[EL Warning]: 2018-03-29 11:00:06.472--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Constraint 'BUNDLEAGENTSGENTID' already exists in Schema 'APP'.
Error Code: 30000
Call: ALTER TABLE BundleAgents ADD CONSTRAINT BundleAgentsgentid FOREIGN KEY (agent_id) REFERENCES HST_AGENT (ID)
Query: DataModifyQuery(sql="ALTER TABLE BundleAgents ADD CONSTRAINT BundleAgentsgentid FOREIGN KEY (agent_id) REFERENCES HST_AGENT (ID)")
[EL Warning]: 2018-03-29 11:00:06.496--ServerSession(1241480588)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Constraint 'SRVCEAGENTSSRVCEID' already exists in Schema 'APP'.
Error Code: 30000
Call: ALTER TABLE ServiceAgents ADD CONSTRAINT SrvceAgentssrvceid FOREIGN KEY (service_id) REFERENCES HST_BUNDLE_SERVICE (ID)
Query: DataModifyQuery(sql="ALTER TABLE ServiceAgents ADD CONSTRAINT SrvceAgentssrvceid FOREIGN KEY (service_id) REFERENCES HST_BUNDLE_SERVICE (ID)")
[EL Info]: connection: 2018-03-29 11:00:10.211--ServerSession(1241480588)--file:/usr/hdp/share/hst/hst-common/lib/smartsense-hst-1.3.0.0-22.jar_hst logout successful
1 REPLY 1

Re: hst-server stopped

Contributor

Hello @Anurag Mishra

Might be due to existing tables present in database and issues while altering the database tables it is causing this exception.

I would like you to try out these steps:

1) Check if user has proper permissions on the database itself directory, i.e. :

/var/lib/smartsense/hst-server/hstDB

2) Secondly, take a backup of the database at the above folder at a directory of your choice using tar and then delete the tables inside the database and retry the process of restarting. Check if it comes up properly.

tar -cvfz database.gz /var/lib/smartsense/hst-server/hstDB/*

Also, in the meanwhile can you provide me list of files and directories inside :

/var/lib/smartsense/hst-server/hstDB

Don't have an account?
Coming from Hortonworks? Activate your account here