typhon-project / typhonql

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

[BUG] Cannot create a new entity relation #84

Closed benatspo closed 4 years ago

benatspo commented 4 years ago

It is impossible to create a relation dynamically, using the API. After having created the new entity "User_migrated" with the API, i wanted to create a new relation. I first uploaded the ML model to the polystore using the API (see the ML model below), and then the following query returned an exception:

create User_migrated.orders -> Order[0..*]

ML model:

<?xml version="1.0" encoding="ASCII"?>
<typhonml:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:typhonml="http://org.typhon.dsls.typhonml.sirius">
  <entities name="Order">
    <attributes xsi:type="typhonml:Attribute" name="id">
      <type xsi:type="typhonml:StringType" maxSize="32"/>
    </attributes>
    <attributes xsi:type="typhonml:Attribute" name="productDate">
      <type xsi:type="typhonml:StringType" maxSize="32"/>
    </attributes>
    <attributes xsi:type="typhonml:Attribute" name="totalAmount">
      <type xsi:type="typhonml:IntType"/>
    </attributes>
    <relations name="users" type="//@entities.1" cardinality="one" opposite="//@entities.0/@relations.0"/>
  </entities>
  <entities name="User_migrated">
    <attributes xsi:type="typhonml:Attribute" name="id">
      <type xsi:type="typhonml:StringType" maxSize="32"/>
    </attributes>
    <attributes xsi:type="typhonml:Attribute" name="name">
      <type xsi:type="typhonml:StringType" maxSize="32"/>
    </attributes>
    <relations name="orders" type="//@entities.0" cardinality="zero_many"/>
  </entities>
  <databases xsi:type="typhonml:RelationalDB" name="RelationalDatabase">
    <tables name="OrderDB" entity="//@entities.0">
      <indexSpec name="orderIndex" attributes="//@entities.0/@attributes.0"/>
      <idSpec attributes="//@entities.0/@attributes.0"/>
    </tables>
  </databases>
  <databases xsi:type="typhonml:DocumentDB" name="DocumentDatabase">
    <collections name="User_migrated" entity="//@entities.1"/>
  </databases>
</typhonml:Model>

I expected to create the new relation, like I was able in the past. According to DDL.rsc file, my query seems to be correct.

13:13:52.977 [qtp252480153-13] DEBUG org.eclipse.jetty.server.HttpConnection - releaseRequestBuffer HttpConnection@24bf9c11::SocketChannelEndPoint@69b9cb73{/172.26.0.7:60666<->/172.26.0.6:7000,OPEN,fill=-,flush=-,to=1/30000}{io=1/0,kio=1,kro=1}->HttpConnection@24bf9c11[p=HttpParser{s=END,2811 of 2811},g=HttpGenerator@37a39a6{s=START}]=>HttpChannelOverHttp@34abe8d4{s=HttpChannelState@2027792b{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=4,c=false/false,a=HANDLING,uri=//typhonql-server:7000/update,age=1} 13:13:52.977 [qtp252480153-13] TRACE engineering.swat.typhonql.server.QLRestServer - Received arguments: { command: create User_migrated.orders -> Order[0..] xmi: <?xml version="1.0" encoding="ASCII"?> </typhonml:Model> databaseInfo[DatabaseInfo [host=DocumentDatabase, port=27017, dbName=DocumentDatabase, dbType=documentdb, dbms=MongoDb, user=username, password=password], DatabaseInfo [host=RelationalDatabase, port=3306, dbName=RelationalDatabase, dbType=relationaldb, dbms=MariaDB, user=root, password=password], DatabaseInfo [host=polystore-mongo, port=27017, dbName=polystore_db, dbType=documentdb, dbms=MongoDb, user=admin, password=admin]]} 13:13:52.977 [qtp252480153-13] TRACE engineering.swat.typhonql.server.QLRestServer - Running command: { command: create User_migrated.orders -> Order[0..] xmi: <?xml version="1.0" encoding="ASCII"?> </typhonml:Model> databaseInfo[DatabaseInfo [host=DocumentDatabase, port=27017, dbName=DocumentDatabase, dbType=documentdb, dbms=MongoDb, user=username, password=password], DatabaseInfo [host=RelationalDatabase, port=3306, dbName=RelationalDatabase, dbType=relationaldb, dbms=MariaDB, user=root, password=password], DatabaseInfo [host=polystore-mongo, port=27017, dbName=polystore_db, dbType=documentdb, dbms=MongoDb, user=admin, password=admin]]} 13:13:52.978 [qtp252480153-18] DEBUG org.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@16aa8654{s=1/2,p=0}@4962913b task=EatWhatYouKill@1dfd5f51/SelectorProducer@5cbf9e9f/IDLE/p=true/QueuedThreadPool[qtp252480153]@f0c8a99{STARTED,8<=8<=200,i=4,r=2,q=0}[ReservedThreadExecutor@16aa8654{s=1/2,p=0}][pc=0,pic=0,pec=10,epc=29]@2020-06-03T13:13:52.978Z 13:13:52.978 [qtp252480153-18] DEBUG org.eclipse.jetty.util.thread.strategy.EatWhatYouKill - EatWhatYouKill@1dfd5f51/SelectorProducer@5cbf9e9f/IDLE/p=true/QueuedThreadPool[qtp252480153]@f0c8a99{STARTED,8<=8<=200,i=4,r=2,q=0}[ReservedThreadExecutor@16aa8654{s=1/2,p=0}][pc=0,pic=0,pec=10,epc=29]@2020-06-03T13:13:52.978Z tryProduce true 13:13:52.978 [qtp252480153-18] DEBUG org.eclipse.jetty.io.ManagedSelector - updateable 0 13:13:52.978 [qtp252480153-18] DEBUG org.eclipse.jetty.io.ManagedSelector - updates 0 13:13:52.978 [qtp252480153-18] DEBUG org.eclipse.jetty.io.ChannelEndPoint - Key interests updated 1 -> 0 on SocketChannelEndPoint@69b9cb73{/172.26.0.7:60666<->/172.26.0.6:7000,OPEN,fill=-,flush=-,to=2/30000}{io=0/0,kio=0,kro=1}->HttpConnection@24bf9c11[p=HttpParser{s=END,2811 of 2811},g=HttpGenerator@37a39a6{s=START}]=>HttpChannelOverHttp@34abe8d4{s=HttpChannelState@2027792b{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=4,c=false/false,a=HANDLING,uri=//typhonql-server:7000/update,age=2} 13:13:52.978 [qtp252480153-18] DEBUG org.eclipse.jetty.io.ManagedSelector - Selector sun.nio.ch.EPollSelectorImpl@e30c924 waiting with 1 keys at lang::typhonql::RunUsingCompiler(|main://lang::typhonql::RunUsingCompiler||lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(3461,2,<85,94>,<85,96>): CallFailed( |lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(3461,2,<85,94>,<85,96>), ["0",""]) at ddl2scriptAux(|lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(3375,141,<85,8>,<85,149>)) at ddl2script(|lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(692,173,<28,0>,<32,1>)) at request2script(|lib://typhonql/src/lang/typhonql/Request2Script.rsc|(2173,17,<82,13>,<82,30>)) at runUpdate(|lib://typhonql/src/lang/typhonql/RunUsingCompiler.rsc|(1430,32,<53,11>,<53,43>)) at runUpdate(|lib://typhonql/src/lang/typhonql/RunUsingCompiler.rsc|(3935,38,<125,9>,<125,47>)) 13:13:53.055 [qtp252480153-13] ERROR engineering.swat.typhonql.server.QLRestServer - Failed to handle response org.rascalmpl.interpreter.control_exceptions.Throw: |lib://typhonql/src/lang/typhonql/DDL2Script.rsc|:85,94: CallFailed( |lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(3461,2,<85,94>,<85,96>), ["0",""]) at org.rascalmpl.interpreter.control_exceptions.ControlException.reallyFillInStackTrace(ControlException.java:42) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.control_exceptions.Throw.fillInStackTrace(Throw.java:138) ~[rascal-0.18.0.jar:?] at java.lang.Throwable.(Throwable.java:266) ~[?:1.8.0_252] at java.lang.Exception.(Exception.java:66) ~[?:1.8.0_252] at java.lang.RuntimeException.(RuntimeException.java:62) ~[?:1.8.0_252] at org.rascalmpl.interpreter.control_exceptions.ControlException.(ControlException.java:25) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.control_exceptions.Throw.(Throw.java:73) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.control_exceptions.Throw.(Throw.java:93) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.utils.RuntimeExceptionFactory.callFailed(RuntimeExceptionFactory.java:110) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:536) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:495) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:783) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$IfThen.interpret(Statement.java:604) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.ConcretePatternDispatchedFunction.call(ConcretePatternDispatchedFunction.java:200) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.ConcretePatternDispatchedFunction.call(ConcretePatternDispatchedFunction.java:177) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:416) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:394) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Declarator$Default.interpret(Declarator.java:53) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.LocalVariableDeclaration$Default.interpret(LocalVariableDeclaration.java:36) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$VariableDeclaration.interpret(Statement.java:1005) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:783) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.utils.Cases$DefaultBlock.matchAndEval(Cases.java:252) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Switch.interpret(Statement.java:900) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:205) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$IfThen.interpret(Statement.java:604) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:416) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:394) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:783) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:416) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:394) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:385) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:710) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:694) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:683) ~[rascal-0.18.0.jar:?] at nl.cwi.swat.typhonql.client.XMIPolystoreConnection.lambda$4(XMIPolystoreConnection.java:215) ~[typhonql-0.1.0-SNAPSHOT.jar:?] at org.rascalmpl.util.ConcurrentSoftReferenceObjectPool.useAndReturn(ConcurrentSoftReferenceObjectPool.java:96) ~[rascal-0.18.0.jar:?] at nl.cwi.swat.typhonql.client.XMIPolystoreConnection.evaluateUpdate(XMIPolystoreConnection.java:210) ~[typhonql-0.1.0-SNAPSHOT.jar:?] at nl.cwi.swat.typhonql.client.XMIPolystoreConnection.executeUpdate(XMIPolystoreConnection.java:204) ~[typhonql-0.1.0-SNAPSHOT.jar:?] at engineering.swat.typhonql.server.QLRestServer.handleCommand(QLRestServer.java:208) ~[classes/:?] at engineering.swat.typhonql.server.QLRestServer.handle(QLRestServer.java:244) ~[classes/:?] at engineering.swat.typhonql.server.QLRestServer.access$300(QLRestServer.java:46) ~[classes/:?] at engineering.swat.typhonql.server.QLRestServer$1.doPost(QLRestServer.java:276) ~[classes/:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javax.servlet-api-3.1.0.jar:3.1.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755) ~[jetty-servlet-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:547) ~[jetty-servlet-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485) ~[jetty-servlet-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:767) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.Server.handle(Server.java:500) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547) [jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375) [jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270) [jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252] 13:13:53.064 [qtp252480153-13] DEBUG org.eclipse.jetty.server.HttpOutput - write(array HeapByteBuffer@13a66114[p=0,l=165,c=512,r=165]={<<<Error: |lib://typhonql/sr...,<85,96>),\n ["0",""])>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00}) 13:13:53.064 [qtp252480153-13] DEBUG org.eclipse.jetty.server.HttpOutput - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush HeapByteBuffer@676e5619[p=0,l=165,c=32768,r=165]={<<<Error: |lib://typhonql/sr...,<85,96>),\n ["0",""])>>>onse is {...\x00\x00\x00\x00\x00\x00\x00} 13:13:53.064 [qtp252480153-13] DEBUG org.eclipse.jetty.server.HttpOutput - close() s=CLOSING,api=BLOCKED,sc=false,e=null c=HeapByteBuffer@676e5619[p=0,l=165,c=32768,r=165]={<<<Error: |lib://typhonql/sr...,<85,96>),\n ["0",""])>>>onse is {...\x00\x00\x00\x00\x00\x00\x00} b=Blocker@1c3c60d2{null} 13:13:53.064 [qtp252480153-13] DEBUG org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor - org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor@27ce23a1 exclude by status 500 13:13:53.064 [qtp252480153-13] DEBUG org.eclipse.jetty.server.HttpChannel - sendResponse info=null content=HeapByteBuffer@676e5619[p=0,l=165,c=32768,r=165]={<<<Error: |lib://typhonql/sr...,<85,96>),\n ["0",""])>>>onse is {...\x00\x00\x00\x00\x00\x00\x00} complete=true committing=true callback=Blocker@1c3c60d2{null} 13:13:53.064 [qtp252480153-13] DEBUG org.eclipse.jetty.server.HttpChannel - COMMIT for /update on HttpChannelOverHttp@34abe8d4{s=HttpChannelState@2027792b{s=HANDLING rs=BLOCKING os=COMMITTED is=IDLE awp=false se=false i=true al=0},r=4,c=false/false,a=HANDLING,uri=//typhonql-server:7000/update,age=88} 500 null HTTP/1.1

benatspo commented 4 years ago

Hi,

Same problem when deleting a relation. For example, with the same ML schema: drop relation Order.users

Logs:

databaseInfo[DatabaseInfo [host=DocumentDatabase, port=27017, dbName=DocumentDatabase, dbms=MongoDb, user=username, password=password], DatabaseInfo [host=RelationalDatabase, port=3306, dbName=RelationalDatabase, dbms=MariaDB, user=root, password=password], DatabaseInfo [host=polystore-mongo, port=27017, dbName=polystore_db, dbms=MongoDb, user=admin, password=admin]]} 07:43:51.396 [qtp2075809815-19] TRACE engineering.swat.typhonql.server.QLRestServer - Running command: { command: drop relation Order.users databaseInfo[DatabaseInfo [host=DocumentDatabase, port=27017, dbName=DocumentDatabase, dbms=MongoDb, user=username, password=password], DatabaseInfo [host=RelationalDatabase, port=3306, dbName=RelationalDatabase, dbms=MariaDB, user=root, password=password], DatabaseInfo [host=polystore-mongo, port=27017, dbName=polystore_db, dbms=MongoDb, user=admin, password=admin]]} at lang::typhonql::RunUsingCompiler(|main://lang::typhonql::RunUsingCompiler||lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(7144,3,<169,81>,<169,84>): CallFailed( |lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(7144,3,<169,81>,<169,84>), [ <sql(),"RelationalDatabase">, "Order", "users", "User", "users", false, schema( { <"User",zero_many(),"orders","orders^",zero_one(),"Order",false>, <"Order",one(),"users","users",one(),"User",false> }, { <"User","id","string(32)">, <"Order","id","string(32)">, <"User","name","string(32)">, <"Order","totalAmount","int">, <"Order","productDate","string(32)"> }, customs={}, placement={ <<sql(),"RelationalDatabase">,"User">, <<sql(),"RelationalDatabase">,"Order"> }, pragmas={ <"RelationalDatabase",indexSpec( "orderIndex", {<"Order","id">})>, <"RelationalDatabase",indexSpec( "userIndex", {<"User","name">})> }, changeOperators=[]) ]) at ddl2scriptAux(|lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(7072,77,<169,9>,<169,86>)) at ddl2script(|lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(692,173,<28,0>,<32,1>)) at request2script(|lib://typhonql/src/lang/typhonql/Request2Script.rsc|(2369,17,<85,13>,<85,30>)) at runUpdate(|lib://typhonql/src/lang/typhonql/RunUsingCompiler.rsc|(1430,32,<53,11>,<53,43>)) at runUpdate(|lib://typhonql/src/lang/typhonql/RunUsingCompiler.rsc|(3935,38,<125,9>,<125,47>)) 07:43:51.894 [qtp2075809815-19] ERROR engineering.swat.typhonql.server.QLRestServer - Failed to handle response org.rascalmpl.interpreter.control_exceptions.Throw: |lib://typhonql/src/lang/typhonql/DDL2Script.rsc|:169,81: CallFailed( |lib://typhonql/src/lang/typhonql/DDL2Script.rsc|(7144,3,<169,81>,<169,84>), [ <sql(),"RelationalDatabase">, "Order", "users", "User", "users", false, schema( { <"User",zero_many(),"orders","orders^",zero_one(),"Order",false>, <"Order",one(),"users","users",one(),"User",false> }, { <"User","id","string(32)">, <"Order","id","string(32)">, <"User","name","string(32)">, <"Order","totalAmount","int">, <"Order","productDate","string(32)"> }, customs={}, placement={ <<sql(),"RelationalDatabase">,"User">, <<sql(),"RelationalDatabase">,"Order"> }, pragmas={ <"RelationalDatabase",indexSpec( "orderIndex", {<"Order","id">})>, <"RelationalDatabase",indexSpec( "userIndex", {<"User","name">})> }, changeOperators=[]) ]) at org.rascalmpl.interpreter.control_exceptions.ControlException.reallyFillInStackTrace(ControlException.java:42) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.control_exceptions.Throw.fillInStackTrace(Throw.java:138) ~[rascal-0.18.0.jar:?] at java.lang.Throwable.(Throwable.java:266) ~[?:1.8.0_252] at java.lang.Exception.(Exception.java:66) ~[?:1.8.0_252] at java.lang.RuntimeException.(RuntimeException.java:62) ~[?:1.8.0_252] at org.rascalmpl.interpreter.control_exceptions.ControlException.(ControlException.java:25) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.control_exceptions.Throw.(Throw.java:73) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.control_exceptions.Throw.(Throw.java:93) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.utils.RuntimeExceptionFactory.callFailed(RuntimeExceptionFactory.java:110) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:536) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:783) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:679) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$IfThen.interpret(Statement.java:604) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.ConcretePatternDispatchedFunction.call(ConcretePatternDispatchedFunction.java:200) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.ConcretePatternDispatchedFunction.call(ConcretePatternDispatchedFunction.java:177) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:416) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:394) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Declarator$Default.interpret(Declarator.java:53) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.LocalVariableDeclaration$Default.interpret(LocalVariableDeclaration.java:36) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$VariableDeclaration.interpret(Statement.java:1005) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:783) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.utils.Cases$DefaultBlock.matchAndEval(Cases.java:252) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Switch.interpret(Statement.java:900) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:205) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$IfThen.interpret(Statement.java:604) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:416) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:394) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365) ~[rascal-0.18.0.jar:?] at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:783) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:416) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:394) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:385) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:710) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:694) ~[rascal-0.18.0.jar:?] at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:683) ~[rascal-0.18.0.jar:?] at nl.cwi.swat.typhonql.client.XMIPolystoreConnection.lambda$4(XMIPolystoreConnection.java:208) ~[typhonql-0.1.0-SNAPSHOT.jar:?] at org.rascalmpl.util.ConcurrentSoftReferenceObjectPool.useAndReturn(ConcurrentSoftReferenceObjectPool.java:96) ~[rascal-0.18.0.jar:?] at nl.cwi.swat.typhonql.client.XMIPolystoreConnection.evaluateUpdate(XMIPolystoreConnection.java:203) ~[typhonql-0.1.0-SNAPSHOT.jar:?] at nl.cwi.swat.typhonql.client.XMIPolystoreConnection.executeUpdate(XMIPolystoreConnection.java:197) ~[typhonql-0.1.0-SNAPSHOT.jar:?] at engineering.swat.typhonql.server.QLRestServer.handleCommand(QLRestServer.java:208) ~[classes/:?] at engineering.swat.typhonql.server.QLRestServer.handle(QLRestServer.java:244) ~[classes/:?] at engineering.swat.typhonql.server.QLRestServer.access$300(QLRestServer.java:46) ~[classes/:?] at engineering.swat.typhonql.server.QLRestServer$1.doPost(QLRestServer.java:276) ~[classes/:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javax.servlet-api-3.1.0.jar:3.1.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755) ~[jetty-servlet-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:547) ~[jetty-servlet-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485) ~[jetty-servlet-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:767) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.Server.handle(Server.java:500) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383) ~[jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547) [jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375) [jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270) [jetty-server-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252] 07:43:51.897 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.HttpOutput - write(array HeapByteBuffer@6be5d35d[p=0,l=512,c=512,r=512]={<<<Error: |lib://typhonql/sr...ng(32)">,\n <"Use>>>}) 07:43:51.897 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.HttpOutput - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush HeapByteBuffer@37b80429[p=0,l=512,c=32768,r=512]={<<<Error: |lib://typhonql/sr...ng(32)">,\n <"Use>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00} 07:43:51.897 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.HttpOutput - write(array HeapByteBuffer@7ae14070[p=0,l=501,c=512,r=501]={<<<r","name","string(32)">,\n...hangeOperators=[])\n ])>>> <"Use}) 07:43:51.897 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.HttpOutput - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush HeapByteBuffer@37b80429[p=0,l=1013,c=32768,r=1013]={<<<Error: |lib://typhonql/sr...hangeOperators=[])\n ])>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00} 07:43:51.898 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.HttpOutput - close() s=CLOSING,api=BLOCKED,sc=false,e=null c=HeapByteBuffer@37b80429[p=0,l=1013,c=32768,r=1013]={<<<Error: |lib://typhonql/sr...hangeOperators=[])\n ])>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00} b=Blocker@40e2c712{null} 07:43:51.898 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor - org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor@109ec0cd exclude by status 500 07:43:51.898 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.HttpChannel - sendResponse info=null content=HeapByteBuffer@37b80429[p=0,l=1013,c=32768,r=1013]={<<<Error: |lib://typhonql/sr...hangeOperators=[])\n ])>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00} complete=true committing=true callback=Blocker@40e2c712{null} 07:43:51.898 [qtp2075809815-19] DEBUG org.eclipse.jetty.server.HttpChannel - COMMIT for /update on HttpChannelOverHttp@6a1cb46d{s=HttpChannelState@6e232df6{s=HANDLING rs=BLOCKING os=COMMITTED is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=HANDLING,uri=//typhonql-server:7000/update,age=521} 500 null HTTP/1.1

pinoval commented 4 years ago

Hi @benatspo , this should be fixed. Please confirm.

benatspo commented 4 years ago

Thank you, i've been able to add a relation and to remove it :)

Issue resolved