You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/11/12 09:59:40 UTC

[GitHub] [shardingsphere] penghuazhou opened a new issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

penghuazhou opened a new issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576


   It be error when connect to shardingshpere-proxy in shardingsphere-proxy 5.0.0, when it be ok in apache-shardingsphere-5.0.0-beta-shardingsphere-proxy-bin.I usr go grom framework to connect.
   
   `package test
   import (
   	"fmt"
   	"gorm.io/driver/postgres"
   	"gorm.io/gorm"
   	"testing"
   )
   
   func TestShardingSpheress(t *testing.T) {
   	dsn := "host=127.0.0.1 user=sharding password=sharding dbname=sharding_db port=3307 sslmode=disable TimeZone=Asia/Shanghai"
   	db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
   	if err != nil {
   		fmt.Println(err)
   		return
   	}
   
   	var info string
   	err2 := db.Debug().Raw("select info from t_order where order_id = 3 and user_id = 3 and c1=1").Scan(&info).Error
   	//err2 := db.Debug().Raw("select info from t_order where order_id = ? and user_id = ?", 1206921609, 81031208).Scan(&info).Error
   	if err2 != nil {
   		fmt.Println(err2)
   		return
   	}
   	fmt.Println("info ss=",info)
   
   
   	db.Debug().Exec("update t_order set info = 'info~~' where user_id = 3 and order_id = 3")
   	db.Debug().Exec("insert into t_order(user_id,order_id,info) values(3,3,'3')")
   }`
   
   [INFO ] 2021-11-12 15:56:12.385 [main] o.a.s.p.i.BootstrapInitializer - Database name is `PostgreSQL`, version is `9.2.24`
   [INFO ] 2021-11-12 15:56:12.665 [main] o.a.s.p.frontend.ShardingSphereProxy - ShardingSphere-Proxy start success
   [DEBUG] 2021-11-12 17:51:55.972 [epollEventLoopGroup-3-2] o.a.s.db.protocol.codec.PacketCodec - Read from client 40d37698 :
            +-------------------------------------------------+
            |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
   +--------+-------------------------------------------------+----------------+
   |00000000| 00 00 00 5a 00 03 00 00 74 69 6d 65 7a 6f 6e 65 |...Z....timezone|
   |00000010| 00 41 73 69 61 2f 53 68 61 6e 67 68 61 69 00 54 |.Asia/Shanghai.T|
   |00000020| 69 6d 65 5a 6f 6e 65 00 41 73 69 61 2f 53 68 61 |imeZone.Asia/Sha|
   |00000030| 6e 67 68 61 69 00 75 73 65 72 00 73 68 61 72 64 |nghai.user.shard|
   |00000040| 69 6e 67 00 64 61 74 61 62 61 73 65 00 73 68 61 |ing.database.sha|
   |00000050| 72 64 69 6e 67 5f 64 62 00 00                   |rding_db..      |
   +--------+-------------------------------------------------+----------------+
   [ERROR] 2021-11-12 17:51:55.982 [epollEventLoopGroup-3-2] o.a.s.p.f.n.FrontendChannelInboundHandler - Exception occur:
   java.lang.IllegalArgumentException: Null charset name
           at java.nio.charset.Charset.lookup(Charset.java:457)
           at java.nio.charset.Charset.forName(Charset.java:528)
           at org.apache.shardingsphere.proxy.frontend.postgresql.authentication.PostgreSQLAuthenticationEngine.processStartupMessage(PostgreS
   QLAuthenticationEngine.java:85)
           at org.apache.shardingsphere.proxy.frontend.postgresql.authentication.PostgreSQLAuthenticationEngine.authenticate(PostgreSQLAuthent
   icationEngine.java:78)
           at org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler.authenticate(FrontendChannelInboundHandler.java:80)
           at org.apache.shardingsphere.proxy.frontend.netty.FrontendChannelInboundHandler.channelRead(FrontendChannelInboundHandler.java:72)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
           at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
           at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
           at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
           at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
           at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
           at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
           at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
           at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
           at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
           at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
           at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
           at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
           at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
           at java.lang.Thread.run(Thread.java:748)
   [DEBUG] 2021-11-12 17:51:55.992 [epollEventLoopGroup-3-2] o.a.s.db.protocol.codec.PacketCodec - Write to client 40d37698 :


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-967009347


   Hi @penghuazhou 
   It is a bug and this issue has been fixed in master branch by #13406.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] penghuazhou commented on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
penghuazhou commented on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-968264620


   thanks very much


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-967072960


   Hi @penghuazhou 
   I found a way that adding `client_encoding=UTF8` to DSN and it worked:
   
   ```go
   package main
   
   import (
   	"gorm.io/driver/postgres"
   	"gorm.io/gorm"
   )
   
   func main() {
   	dsn := "host=localhost user=postgres password=postgres dbname=postgres port=5432 sslmode=disable TimeZone=Asia/Shanghai client_encoding=UTF8"
   	_, _ = gorm.Open(postgres.Open(dsn), &gorm.Config{})
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] penghuazhou commented on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
penghuazhou commented on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-967012039


   > Hi @penghuazhou It is a bug and this issue has been fixed in master branch by #13406.
   
   When can I get a release version? I want use it in production environment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] penghuazhou commented on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
penghuazhou commented on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-967022820


   > Could you consider checking out the [3f7a17c](https://github.com/apache/shardingsphere/commit/3f7a17c572418de3664c9f6747564ffc0902490d) and packing it? It will take some time before next release.
   
   When can I use 5.0.1? can it will solve in 5.0.1?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] penghuazhou closed issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
penghuazhou closed issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-967030899


   > When can I use 5.0.1? can it will solve in 5.0.1?
   
   It would be fixed in next release. The next release are still planning.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-967017446


   Could you consider checking out the 3f7a17c572418de3664c9f6747564ffc0902490d and packing it? It will take some time before next release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN edited a comment on issue #13576: error to connect to shardingsphere-proxy 5.0.0, It a bug?

Posted by GitBox <gi...@apache.org>.
TeslaCN edited a comment on issue #13576:
URL: https://github.com/apache/shardingsphere/issues/13576#issuecomment-967072960


   Hi @penghuazhou 
   I found a way that adding `client_encoding=UTF8` to DSN and it worked:
   
   ```go
   package main
   
   import (
   	"gorm.io/driver/postgres"
   	"gorm.io/gorm"
   )
   
   func main() {
   	dsn := "host=localhost user=postgres password=postgres dbname=postgres port=5432" +
   		" sslmode=disable TimeZone=Asia/Shanghai client_encoding=UTF8"
   	_, _ = gorm.Open(postgres.Open(dsn), &gorm.Config{})
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org