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

[Bug] 'BASE_TYPE=1, WHERE ID=1' was aborted: ERROR: syntax error at or near "WHERE" #1923

Closed
1 task done
javeme opened this issue Jul 7, 2022 · 0 comments · Fixed by #1924
Closed
1 task done

[Bug] 'BASE_TYPE=1, WHERE ID=1' was aborted: ERROR: syntax error at or near "WHERE" #1923

javeme opened this issue Jul 7, 2022 · 0 comments · Fixed by #1924
Labels
bug Something isn't working

Comments

@javeme
Copy link
Contributor

javeme commented Jul 7, 2022

Bug Type (问题类型)

logic (逻辑设计问题)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题

Environment (环境信息)

  • Server Version: master(0.13)

Expected & Actual behavior (期望与实际表现)

error info:
UPDATE il SET INDEX_TYPE=21, FIELDS='[76]', STATUS=4, USER_DATA='{"~create_time":"2022-07-07 03:16:43.587"}', BASE_VALUE=16, NAME='personByAge', BASE_TYPE=1, WHERE ID=1 was aborted: ERROR: syntax error at or near "WHERE"

#1921 pg ci:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.baidu.hugegraph.api.ApiTestSuite
Error:  Tests run: 56, Failures: 42, Errors: 0, Skipped: 0, Time elapsed: 3,387.361 s <<< FAILURE! - in com.baidu.hugegraph.api.ApiTestSuite
Error:  testGet(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 117.46 s  <<< FAILURE!
java.lang.AssertionError: Failed to wait for task 22 due to timeout
Error:  testList(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 95.591 s  <<< FAILURE!
java.lang.AssertionError: Response with status 400 and content {"exception":"class com.baidu.hugegraph.exception.ExistedException","message":"The index label 'personByAge' has existed","cause":""} expected:<202> but was:<400>
	at com.baidu.hugegraph.api.IndexLabelApiTest.testList(IndexLabelApiTest.java:133)
Error:  testList(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 95.591 s  <<< FAILURE!
java.lang.AssertionError: Failed to wait for task 23 due to timeout
Error:  testEliminate(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93.465 s  <<< FAILURE!
java.lang.AssertionError: Response with status 400 and content {"exception":"class com.baidu.hugegraph.exception.ExistedException","message":"The index label 'personByAge' has existed","cause":""} expected:<202> but was:<400>
	at com.baidu.hugegraph.api.IndexLabelApiTest.testEliminate(IndexLabelApiTest.java:93)
Error:  testEliminate(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93.467 s  <<< FAILURE!
java.lang.AssertionError: Failed to wait for task 24 due to timeout
Error:  testAppend(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93.295 s  <<< FAILURE!
java.lang.AssertionError: Response with status 400 and content {"exception":"class com.baidu.hugegraph.exception.ExistedException","message":"The index label 'personByAge' has existed","cause":""} expected:<202> but was:<400>
	at com.baidu.hugegraph.api.IndexLabelApiTest.testAppend(IndexLabelApiTest.java:65)
Error:  testAppend(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93.296 s  <<< FAILURE!
java.lang.AssertionError: Failed to wait for task 25 due to timeout
Error:  testCreate(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93 s  <<< FAILURE!
java.lang.AssertionError: Response with status 400 and content {"exception":"class com.baidu.hugegraph.exception.ExistedException","message":"The index label 'personByAge' has existed","cause":""} expected:<202> but was:<400>
	at com.baidu.hugegraph.api.IndexLabelApiTest.testCreate(IndexLabelApiTest.java:51)
Error:  testCreate(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93 s  <<< FAILURE!
java.lang.AssertionError: Failed to wait for task 26 due to timeout
Error:  testDelete(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93.024 s  <<< FAILURE!
java.lang.AssertionError: Response with status 400 and content {"exception":"class com.baidu.hugegraph.exception.ExistedException","message":"The index label 'personByAge' has existed","cause":""} expected:<202> but was:<400>
	at com.baidu.hugegraph.api.IndexLabelApiTest.testDelete(IndexLabelApiTest.java:149)
Error:  testDelete(com.baidu.hugegraph.api.IndexLabelApiTest)  Time elapsed: 93.024 s  <<< FAILURE!
java.lang.AssertionError: Failed to wait for task 27 due to timeout
Error:  com.baidu.hugegraph.api.SchemaApiTest  Time elapsed: 186.051 s  <<< FAILURE!
java.lang.AssertionError: Failed to wait for task 28 due to timeout

error log:

2022-07-07 03:24:56 [task-worker-3] [INFO] c.b.h.j.s.SchemaJob - The index label 'personByAge(id=1)' has been in DELETING status, please check if it's expected to delete it again
Error: -07 03:24:56 [task-worker-3] [ERROR] c.b.h.b.Transaction - Failed to commit changes:
com.baidu.hugegraph.backend.BackendException: Failed to commit
	at com.baidu.hugegraph.backend.store.mysql.MysqlSessions$Session.commit(MysqlSessions.java:438) ~[hugegraph-mysql-0.13.0.jar:?]
	at com.baidu.hugegraph.backend.store.mysql.MysqlStore.commitTx(MysqlStore.java:308) ~[hugegraph-mysql-0.13.0.jar:?]
	at com.baidu.hugegraph.backend.tx.AbstractTransaction.commitMutation2Backend(AbstractTransaction.java:322) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.IndexableTransaction.commit2Backend(IndexableTransaction.java:57) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.AbstractTransaction.commit(AbstractTransaction.java:238) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.AbstractTransaction.commitOrRollback(AbstractTransaction.java:377) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.AbstractTransaction.afterWrite(AbstractTransaction.java:344) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.SchemaTransaction.saveSchema(SchemaTransaction.java:448) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.SchemaTransaction.updateSchema(SchemaTransaction.java:406) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.cache.CachedSchemaTransaction.updateSchema(CachedSchemaTransaction.java:216) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.SchemaTransaction.updateSchemaStatus(SchemaTransaction.java:391) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.job.schema.IndexLabelRemoveJob.removeIndexLabel(IndexLabelRemoveJob.java:61) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.job.schema.IndexLabelRemoveJob.execute(IndexLabelRemoveJob.java:39) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.job.SysJob.call(SysJob.java:29) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_332]
	at com.baidu.hugegraph.task.HugeTask.run(HugeTask.java:292) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_332]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_332]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_332]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_332]
	at java.lang.Thread.run(Thread.java:750) [?:1.8.0_332]
Caused by: java.sql.BatchUpdateException: Batch entry 0 UPDATE il SET INDEX_TYPE=21, FIELDS='[76]', STATUS=4, USER_DATA='{"~create_time":"2022-07-07 03:16:43.587"}', BASE_VALUE=16, NAME='personByAge', BASE_TYPE=1,  WHERE ID=1 was aborted: ERROR: syntax error at or near "WHERE"
  Position: 105  Call getNextException to see other errors in the batch.
	at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:148) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.core.ResultHandlerDelegate.handleError(ResultHandlerDelegate.java:50) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2191) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:472) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:791) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1563) ~[postgresql-42.1.4.jar:42.1.4]
	at com.baidu.hugegraph.backend.store.mysql.MysqlSessions$Session.commit(MysqlSessions.java:433) ~[hugegraph-mysql-0.13.0.jar:?]
	... 20 more
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "WHERE"
  Position: 105
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:472) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:791) ~[postgresql-42.1.4.jar:42.1.4]
	at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1563) ~[postgresql-42.1.4.jar:42.1.4]
	at com.baidu.hugegraph.backend.store.mysql.MysqlSessions$Session.commit(MysqlSessions.java:433) ~[hugegraph-mysql-0.13.0.jar:?]
	... 20 more

2022-07-07 03:24:56 [task-worker-3] [WARN] c.b.h.t.HugeTask - An exception occurred when running task: 27
com.baidu.hugegraph.backend.BackendException: Failed to commit changes: Failed to commit(org.postgresql.util.PSQLException: ERROR: syntax error at or near "WHERE"
  Position: 105)
	at com.baidu.hugegraph.backend.tx.AbstractTransaction.commitOrRollback(AbstractTransaction.java:393) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.AbstractTransaction.afterWrite(AbstractTransaction.java:344) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.SchemaTransaction.saveSchema(SchemaTransaction.java:448) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.SchemaTransaction.updateSchema(SchemaTransaction.java:406) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.cache.CachedSchemaTransaction.updateSchema(CachedSchemaTransaction.java:216) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.backend.tx.SchemaTransaction.updateSchemaStatus(SchemaTransaction.java:391) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.job.schema.IndexLabelRemoveJob.removeIndexLabel(IndexLabelRemoveJob.java:61) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.job.schema.IndexLabelRemoveJob.execute(IndexLabelRemoveJob.java:39) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at com.baidu.hugegraph.job.SysJob.call(SysJob.java:29) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_332]
	at com.baidu.hugegraph.task.HugeTask.run(HugeTask.java:292) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_332]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_332]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_332]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_332]
	at java.lang.Thread.run(Thread.java:750) [?:1.8.0_332]

detail: https://github.com/apache/incubator-hugegraph/runs/7226336526?check_suite_focus=true

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

@javeme javeme added the bug Something isn't working label Jul 7, 2022
javeme added a commit that referenced this issue Jul 7, 2022
fix #1923
Change-Id: I095311942c3633a5978930e35fecd9fd47b08796
javeme added a commit that referenced this issue Jul 19, 2022
* fix: possible extra comma before where statement

add ',' before the next key construct & just skip thr first key

fix #1923
Change-Id: I095311942c3633a5978930e35fecd9fd47b08796
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant