typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

[BUG] reset database not working #80

Closed meuriceloup closed 4 years ago

meuriceloup commented 4 years ago

Hi,

I'm facing critical problems since I pulled the latest docker images. Indeed, the deployment works fine but I encounter a critical problem when I execute the resetdatabase operation. It returns this exception:

java.lang.RuntimeException: Failure to initialize connection toRelationalDatabase
(internal error)
        at $typhonql$(|main://$typhonql$|)
java.lang.RuntimeException: Failure to initialize connection toRelationalDatabase
        at nl.cwi.swat.typhonql.backend.rascal.MariaDBOperations.lambda$0(MariaDBOperations.java:61)
        at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
        at nl.cwi.swat.typhonql.backend.rascal.MariaDBOperations.getConnection(MariaDBOperations.java:47)
        at nl.cwi.swat.typhonql.backend.rascal.MariaDBOperations.lambda$4(MariaDBOperations.java:120)
        at nl.cwi.swat.typhonql.backend.rascal.MariaDBOperations.executeUpdate(MariaDBOperations.java:104)
        at nl.cwi.swat.typhonql.backend.rascal.MariaDBOperations.lambda$2(MariaDBOperations.java:90)
        at nl.cwi.swat.typhonql.backend.rascal.Operations$1.call(Operations.java:56)
        at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533)
        at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
        at org.rascalmpl.interpreter.utils.Cases.matchAndEval(Cases.java:423)
        at org.rascalmpl.interpreter.utils.Cases$DefaultBlock.matchAndEval(Cases.java:261)
        at org.rascalmpl.interpreter.utils.Cases$NodeCaseBlock.tryCases(Cases.java:394)
        ...
Caused by: java.sql.SQLSyntaxErrorException: Unknown database 'RelationalDatabase'
        at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:242)
        at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:171)
        at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1132)
        at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:620)
        at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:175)
        at org.mariadb.jdbc.Driver.connect(Driver.java:92)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:270)
        at nl.cwi.swat.typhonql.backend.rascal.MariaDBOperations.getConnection(MariaDBOperations.java:68)
        at nl.cwi.swat.typhonql.backend.rascal.MariaDBOperations.lambda$0(MariaDBOperations.java:54)

I observed that the 'RelationalDatabase' database does not exist yet when I execute the resetdatabase operation. Is it normal? This explains why it returns this exception: it simply cannot find the database! I found a workaround to it: before resetting the databases, I manually created the RelationalDatabase mariadb and then, I could successfully execute the resetdatabase operation.

In attachment, the deployment files I used.

Thanks in advance. ecommerce-new.zip

tvdstorm commented 4 years ago

Merci! Which versions of TyphonQL are you using?

meuriceloup commented 4 years ago

This is the version of my images:

REPOSITORY                           TAG                 DIGEST                                                                    IMAGE ID            CREATED             SIZE
test_kafka                           latest              <none>                                                                    a134ba2ee474        About an hour ago   481MB
clms/typhon-polystore-api            latest              sha256:5ad2dcb764ef7007d1ce8992c1018886f7b2e3ef9f0a7a0fc01c9802a9bb6613   f17253136abc        2 hours ago         410MB
swatengineering/typhonql-server      latest              sha256:7c6290b20eb359fd4f305b4cc13b10a51a8f51a6e28812d13db34af503b01788   98e1343ce1a2        5 days ago          442MB
mariadb                              latest              sha256:0fac2fa5ec295d16c356e567cfe676f92605b60f3b257f2958e23676c2acf937   9c1f27148b1f        10 days ago         357MB
zolotas4/typhon-analytics-auth-all   latest              sha256:0480df592ce8414d0a499bb2065b89c3cbb477e2ddf667b1ef57480d3b03abad   0c2e1b9cef22        2 weeks ago         151MB
mongo                                latest              sha256:c880f6b56f443bb4d01baa759883228cd84fa8d78fa1a36001d1c0a0712b5a07   3f3daf863757        4 weeks ago         388MB
clms/typhon-polystore-ui             latest              sha256:cfc84b9bb8657e173c76f7f891c780c2298cde23473f2af93a1c429da581cd43   f905833208b7        7 weeks ago         1.42GB
openjdk                              8u212-jre-alpine    sha256:f362b165b870ef129cbe730f29065ff37399c0aa8bcab3e44b51c302938c9193   f7a292bbb70c        12 months ago       84.9MB
wurstmeister/zookeeper               latest              sha256:7a7fd44a72104bfbd24a77844bad5fabc86485b036f988ea927d1780782a6680   3f43f72cb283        16 months ago       510MB
tvdstorm commented 4 years ago

Thanks, this lives in the Java side of things, assigning @pinoval

pinoval commented 4 years ago

Hi @meuriceloup , we have just merged a fix that should solve this problem. Could you please try again with the new QL version?

pinoval commented 4 years ago

Sorry @meuriceloup , it seems that it will take a bit more to have a stable master with the fix merged in. Most likely tomorrow. I will update this issue accordingly.

pinoval commented 4 years ago

Hi @meuriceloup. It took longer than expected but now you should be able to try this and let us know if it works.

meuriceloup commented 4 years ago

Hi,

I pulled the newest images and re-deployed my polystore. The resetdatatbase operation worked fine! I did not need to manually create the databases before.

Good job.

pinoval commented 4 years ago

Good to know. I close the issue then.