Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server closes connection while creating tables through "JavaPlay Ebeans ORM" #1652

Closed
azeemshahzad opened this issue Jun 28, 2019 · 4 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) community/request Issues created by external users

Comments

@azeemshahzad
Copy link

YugaByte closes connection while creating tables through "JavaPlay Ebeans ORM". Ebean entity and exception stack given below

@entity
@table(name = "orders")
public class Order extends Model {
@id
@GeneratedValue(strategy = GenerationType.AUTO)
public UUID orderId;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss")
public Date orderTime;

@ManyToOne
@JoinColumn(name="user_id")
public  User orderOwner;

@Transient
public Long userId;

@Column(columnDefinition = "numeric(10,2)")
public double orderTotal;

@Transient
@Ignore
public List<OrderLine> products;

public static final Finder<UUID, Order> find = new Finder<>(Order.class);

}

Exception:
[warn] c.z.h.p.ProxyConnection - HikariPool-1 - Connection org.postgresql.jdbc42.Jdbc42Connection@1effc9ca marked as broken because of SQLSTATE(0A000), ErrorCode(0)
org.postgresql.util.PSQLException: ERROR: FOREIGN KEY constraint not supported yet
Hint: See #1129. Click '+' on the description to raise its priority
Position: 53
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:481)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:473)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] o.j.StatementLogger - java.sql.Statement.execute: alter table orders add constraint fk_orders_user_id foreign key (user_id) references users (user_id) on delete restrict on update restrict;
throws exception: org.postgresql.util.PSQLException: ERROR: FOREIGN KEY constraint not supported yet
Hint: See #1129. Click '+' on the description to raise its priority
Position: 53
org.postgresql.util.PSQLException: ERROR: FOREIGN KEY constraint not supported yet
Hint: See #1129. Click '+' on the description to raise its priority
Position: 53
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:481)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:473)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] o.j.ConnectionLogger - java.sql.Connection.prepareStatement:
throws exception: java.sql.SQLException: Connection is closed
java.sql.SQLException: Connection is closed
at com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection.lambda$getClosedConnection$0(ProxyConnection.java:489)
at com.sun.proxy.$Proxy28.prepareStatement(Unknown Source)
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:311)
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jdbcdslog.GenericLoggingHandler.invoke(GenericLoggingHandler.java:30)
at com.sun.proxy.$Proxy27.prepareStatement(Unknown Source)
[error] application -

! @7cb39290p - Internal server error, for (POST) [/users] ->

@bmatican
Copy link
Contributor

@azeemshahzad thank you for trying out our YSQL API!

Seeing this in your log:

org.postgresql.util.PSQLException: ERROR: FOREIGN KEY constraint not supported yet
Hint: See #1129. Click '+' on the description to raise its priority

Can you confirm which release you're using? We've landed basic foreign key support in our 1.2.10 release.

cc @m-iancu in case there are still pending work items there that might be prevent Play from working ok...

@bmatican bmatican added the area/ysql Yugabyte SQL (YSQL) label Jun 28, 2019
@azeemshahzad
Copy link
Author

I was using 1.2.9. before. Now installed latest version 1.2.11 and getting different error.

[ERROR] from org.jdbcdslog.StatementLogger in play-dev-mode-akka.actor.default-dispatcher-11 - java.sql.Statement.execute:
create table play_evolutions (
id int not null primary key,
hash varchar(255) not null,
applied_at timestamp not null,
apply_script text,
revert_script text,
state varchar(255),
last_problem text
)
;
throws exception: org.postgresql.util.PSQLException: ERROR: Invalid argument: Invalid table definition: Timed out (yb/client/client-internal.cc:144): Timed out waiting for Table Creation
org.postgresql.util.PSQLException: ERROR: Invalid argument: Invalid table definition: Timed out (yb/client/client-internal.cc:144): Timed out waiting for Table Creation
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:481)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:473)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jdbcdslog.StatementLoggingHandler.invoke(StatementLoggingHandler.java:27)
at com.sun.proxy.$Proxy57.execute(Unknown Source)
at play.api.db.evolutions.DatabaseEvolutions.execute(EvolutionsApi.scala:335)
at play.api.db.evolutions.DatabaseEvolutions.createPlayEvolutionsTable$1(EvolutionsApi.scala:267)
at play.api.db.evolutions.DatabaseEvolutions.checkEvolutionsState(EvolutionsApi.scala:299)
at play.api.db.evolutions.DatabaseEvolutions.databaseEvolutions(EvolutionsApi.scala:139)
at play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:114)
at play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:129)
at play.api.db.evolutions.DefaultEvolutionsApi.scripts(EvolutionsApi.scala:94)
at play.api.db.evolutions.ApplicationEvolutions$.$anonfun$runEvolutions$1(ApplicationEvolutions.scala:177)
at play.api.db.evolutions.ApplicationEvolutions$.withLock(ApplicationEvolutions.scala:203)
at play.api.db.evolutions.ApplicationEvolutions$.runEvolutions(ApplicationEvolutions.scala:173)
at play.api.db.evolutions.ApplicationEvolutions.$anonfun$start$1(ApplicationEvolutions.scala:53)
at play.api.db.evolutions.ApplicationEvolutions.$anonfun$start$1$adapted(ApplicationEvolutions.scala:53)
at scala.collection.immutable.List.foreach(List.scala:392)
at play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:53)
at play.api.db.evolutions.ApplicationEvolutions.(ApplicationEvolutions.scala:85)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:51)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:50)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:41)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:85)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:77)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:59)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:61)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:211)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:182)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:78)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:186)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:139)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anon$1.$anonfun$reload$3(DevServerStart.scala:176)
at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:168)
at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:127)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:253)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:149)
at akka.stream.impl.fusing.MapAsync$$anon$30.onPush(Ops.scala:1207)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:411)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:588)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:472)
at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:563)
at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:745)
at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:760)

@yugabyte-ci yugabyte-ci added the community/request Issues created by external users label Jul 17, 2019
@m-iancu
Copy link
Contributor

m-iancu commented Jul 18, 2019

@azeemshahzad The Timed out waiting for Table Creation error could be an intermittent issue. We have also fixed some issues related to that somewhat recently.
Could you upgrade to latest version, re-create the cluster and try again?
If that does not work could you try creating that table directly from the shell (./bin/ysqlsh)-- again on a newly created cluster -- and see if that works?

@rkarthik007
Copy link
Collaborator

Closing this issue out, most of these should be resolved with the newer versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) community/request Issues created by external users
Projects
None yet
Development

No branches or pull requests

5 participants