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

Can't not connect to sharding-proxy by pgAdmin #33733

Closed
solio opened this issue Nov 20, 2024 · 7 comments
Closed

Can't not connect to sharding-proxy by pgAdmin #33733

solio opened this issue Nov 20, 2024 · 7 comments

Comments

@solio
Copy link

solio commented Nov 20, 2024

sharding-proxy logs

2024-11-20 16:07:41.689 [ShardingSphere-Command-3] DEBUG o.a.s.proxy.frontend.command.CommandExecutorTask - Exception occur: 
org.apache.shardingsphere.infra.exception.dialect.exception.syntax.sql.DialectSQLParsingException: You have an error in your SQL syntax: SET DateStyle=ISO; SET client_min_messages=notice; SELECT set_config('bytea_output','hex',false) FROM pg_settings WHERE name = 'bytea_output'; SET client_encoding='utf-8';, null
	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:60)
	at org.apache.shardingsphere.proxy.backend.handler.ProxySQLComQueryParser.parse(ProxySQLComQueryParser.java:50)
	at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.simple.PostgreSQLComQueryExecutor.<init>(PostgreSQLComQueryExecutor.java:73)
	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecutorFactory.getCommandExecutor(PostgreSQLCommandExecutorFactory.java:112)
	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecutorFactory.newInstance(PostgreSQLCommandExecutorFactory.java:77)
	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getCommandExecutor(PostgreSQLCommandExecuteEngine.java:65)
	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:120)
	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
	at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

When I debug source code (SQLParserExecutor:twoPhaseParse), I found that it can't not run multi sql in one line.
When pgadmin connect to sharding-proxy it automatically run below sql. I run any one sql in below that's ok.

SET DateStyle=ISO; SET client_min_messages=notice; SELECT set_config('bytea_output','hex',false) FROM pg_settings WHERE name = 'bytea_output'; SET client_encoding='utf-8';
@solio
Copy link
Author

solio commented Nov 20, 2024

        at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.twoPhaseParse(SQLParserExecutor.java:70)
        at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.parse(SQLParserExecutor.java:49)
        at org.apache.shardingsphere.sql.parser.api.SQLParserEngine.parse(SQLParserEngine.java:53)
        at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:47)
        at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:57)
        at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:53)
        at org.apache.shardingsphere.proxy.backend.handler.ProxySQLComQueryParser.parse(ProxySQLComQueryParser.java:50)
        at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.simple.PostgreSQLComQueryExecutor.<init>(PostgreSQLComQueryExecutor.java:73)
        at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecutorFactory.getCommandExecutor(PostgreSQLCommandExecutorFactory.java:112)
        at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecutorFactory.newInstance(PostgreSQLCommandExecutorFactory.java:77)
        at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getCommandExecutor(PostgreSQLCommandExecuteEngine.java:65)
        at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:120)
        at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
        at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)```

@terrymanu
Copy link
Member

terrymanu commented Nov 20, 2024

What is the ShardingSphere version and pgAdmin version?

@solio
Copy link
Author

solio commented Nov 21, 2024

ShardingSphere-5.5.0 @terrymanu

@terrymanu
Copy link
Member

What is pgAdmin and Postgres version?

@solio
Copy link
Author

solio commented Nov 21, 2024

@terrymanu postgresql-16.4-1 suites. pgAdmin4 8.10

@xuxiang-hub
Copy link

What is the ShardingSphere version and pgAdmin version?

I got same problem,ShardingSphere proxy 5.5.0, pgadmin4 8.13 @terrymanu

@zzyReal666
Copy link
Contributor

The various database tools do have some problems connecting to proxy.As for postgres,you can try to use dbever connect to database.

@solio solio closed this as completed Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants