cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijayendra Bhamidipati <vijayendra.bhamidip...@citrix.com>
Subject RE: can't deploydb on 4.1 branch, why don't you face it?
Date Sat, 09 Feb 2013 00:21:24 GMT
Hi Frank,

This issue is being tracked in https://issues.apache.org/jira/browse/CLOUDSTACK-1181 . The
workaround is to comment out the code in Transaction.java that checks whether the db.properties
file contains a parameter for encryption. It needs to be fixed - everyone deploying a fresh
db will face the issue as of now. I haven't had the time to look into it yet but will do so
at the first opportunity unless someone fixes it before that.

Regards,
Vijay

-----Original Message-----
From: Frank Zhang [mailto:Frank.Zhang@citrix.com] 
Sent: Friday, February 08, 2013 3:52 PM
To: cloudstack-dev@incubator.apache.org
Subject: can't deploydb on 4.1 branch, why don't you face it?

'mvn -P developer -pl developer -Ddeploydb' greets me below error:

[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (create-schema) @ cloud-developer --- ========>
WARNING: Provided file does not exist: /home/frank/dev/incubator-cloudstack/utils/conf/db.properties.override
[WARNING]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.ExceptionInInitializerError
        at com.cloud.upgrade.DatabaseCreator.main(DatabaseCreator.java:160)
        ... 6 more
Caused by: com.cloud.utils.exception.CloudRuntimeException: File db.properties not found
        at com.cloud.utils.crypt.EncryptionSecretKeyChecker.check(EncryptionSecretKeyChecker.java:142)
        at com.cloud.utils.db.Transaction.<clinit>(Transaction.java:101)
        ... 7 more
Caused by: java.io.FileNotFoundException: file:/home/frank/.m2/repository/org/apache/cloudstack/cloud-utils/4.1.0-SNAPSHOT/cloud-utils-4.1.0-SNAPSHOT-tests.jar!/db.properties
(No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:137)
        at com.cloud.utils.crypt.EncryptionSecretKeyChecker.check(EncryptionSecretKeyChecker.java:65)

after looking into it, I think it's a bug that everyone would encounter, but to my surprise
it seems as if only I suffer it.

The cause is in EncryptionSecretKeyChecker.java

    @Override
    public void check() {
        //Get encryption type from db.properties
        final File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
        final Properties dbProps = new Properties();

        ... .... 

PropertiesUtil.findConfigFile will search file in classpath first, and unfortunately cloud-utils-4.1.0-SNAPSHOT-tests.jar
does have db.properties packaged in it, then it's returned as the first match. 
As it's a file in JAR it can not be opened as ordinary file that why the exception happens.

I don't know why we have utils/conf/db.properties,  can anyone tell me its purpose? And does
anyone else encountered this bug?


Mime
View raw message