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.

Upgrade from cm 5.2.0 to later cm failed..

Highlighted

Upgrade from cm 5.2.0 to later cm failed..

Explorer

Hello,

 I'd like to upgrade cloudera manager from 5.2.0 to 5.2.1, and I'm using Path C to install cloudera manager and CDH.

When I replace the old cloudera manager with the latest one and try to start the cluodera-scm-server, I got the following errors:

I checked my mysql configuration and databases as well as mysql-connector jar well. The databases are created using cm 5.2.0 scripts and I had already backed up the mysql databases. Hope anyone can help me resolve this.

Thanks.

 

2014-12-23 19:21:12,218 ERROR main:com.cloudera.server.cmf.Main: Server failed.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.cloudera.server.cmf.TrialState': Cannot resolve reference to bean 'entityManagerFactoryBean' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactoryBean': FactoryBean threw exception on object creation; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at com.cloudera.server.cmf.Main.bootstrapSpringContext(Main.java:360)
at com.cloudera.server.cmf.Main.<init>(Main.java:214)
at com.cloudera.server.cmf.Main.main(Main.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactoryBean': FactoryBean threw exception on object creation; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1440)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:247)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 17 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1397)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:62)
at com.cloudera.enterprise.AbstractWrappedEntityManager.beginForRollbackAndReadonly(AbstractWrappedEntityManager.java:85)
at com.cloudera.enterprise.dbutil.DbUtil.isInnoDbEnabled(DbUtil.java:529)
at com.cloudera.server.cmf.bootstrap.EntityManagerFactoryBean.checkMysqlTableEngineType(EntityManagerFactoryBean.java:115)
at com.cloudera.server.cmf.bootstrap.EntityManagerFactoryBean.getObject(EntityManagerFactoryBean.java:100)
at com.cloudera.server.cmf.bootstrap.EntityManagerFactoryBean.getObject(EntityManagerFactoryBean.java:50)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 22 more
Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:221)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:157)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:67)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160)
at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1426)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:59)
... 28 more
Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:527)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:84)
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:292)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214)
... 33 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@bdceeb2 -- timeout at awaitAvailable()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1317)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
... 37 more

6 REPLIES 6
Highlighted

Re: Upgrade from cm 5.2.0 to later cm failed..

Is your mysql still up and running? Did you try connecting to the database from that host with the same username / password to make sure mysql is still up and running?

Unless you've customized the location otherwise, you can see the credentials CM uses in /etc/cloudera-scm-server/db.properties.

It's possible when you did the tarball upgrade that you accidentally overwrote db.properties, so check for that too.

Thanks,
Darren
Highlighted

Re: Upgrade from cm 5.2.0 to later cm failed..

Explorer

Hi,

I am sure that mysql daemon is running at the right way. As I recreated databases using the latest 5.2.1 scripts and restart the server again, then I never see those errors. I use the command 'mysql -uroot -p' with the password being root to connect to mysql to create relative databases. 

I check the db.properties and only found the line com.cloudera.cmf.db.type=mysql is working while other properties are commented.

Does that mean we  need to specify the database and username / passwords respectively for our mysql usage? We configure several cmf databases on the same host with mysql, how should we configure the properties of ‘com.cloudera.cmf.db.name’? I changed the db.properties as the following and rerun the server start, however ,the errors still occure.

Hope for your reply and very appreciated.

 

# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# This file describes the database connection.
#

# The database type
# Currently 'mysql', 'postgresql' and 'oracle' are valid databases.
com.cloudera.cmf.db.type=mysql

# The database host
# If a non standard port is needed, use 'hostname:port'
#com.cloudera.cmf.db.host=web

# The database name
com.cloudera.cmf.db.name=default

# The database user
com.cloudera.cmf.db.user=root

# The database user's password
com.cloudera.cmf.db.password=root

 

Highlighted

Re: Upgrade from cm 5.2.0 to later cm failed..

Explorer

Hi, 

Sorry for some missing part. I checked the previous running cloudera manager for the db.properties file and found some configuration changing. Then I replaced the latest db.properties on tarball cm, restart the cloudera-manager server and I can successfully see the normal working.

Very appreciated and sorry for bothering.

Thanks.

Highlighted

Re: Upgrade from cm 5.2.0 to later cm failed..

Glad you got the problem fixed!

There's a step in the installation guide (running scm_prepare_database.sh) that you probably missed, which would have configured db.properties for you. Be sure to read it carefully, as even experts can miss a step = )

Regards,
Darren
Highlighted

Re: Upgrade from cm 5.2.0 to later cm failed..

Explorer

Hi,

Actually I did run the scm_prepare_database.sh when I install CM using Path C. The reason I got the upgrading errors is that I did not realize to replace the db.properties file when I want to upgrade to the newly CM. 

Anyway, this is the first try to upgrade CM and CDH, hope everything would go well duing the next steps.

Best regards,

Sun.

Highlighted

Re: Upgrade from cm 5.2.0 to later cm failed..

Contributor

I was using postgresql I was able to find and fix the issue with below steps, try similar way to fix it on mysql

 

If the above step doesn't fix your issue then the postgresql  is not running to identitfy it try to run command

 

service postgresql  restart

 

if above command fails then you have to check in /etc/hosts if loopback address is missing 127.0.0.1 localhost

 

Add line 127.0.0.1 localhost save it, then try starting the postgresql service

 

service postgresql  start

 

Hope this will help

 

Guruveer

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