You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/11/11 07:22:41 UTC

[GitHub] [dubbo-go] PhilYue opened a new issue #1583: pkg.Unmarshal(len(@data):0) = error:get wrong attachments

PhilYue opened a new issue #1583:
URL: https://github.com/apache/dubbo-go/issues/1583


   <!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
   
   -->
   
   
   **What happened**:
   
   基于 [JSON-PRC](https://github.com/apache/dubbo-go-samples/tree/master/rpc/jsonrpc) 改造入参出参,同 #1582 ,在此代码基础上,Server 同时暴露 `dubbo` 和 `jsonrpc`协议,Client 消费使用 `dubbo`协议时,Server 报错如下:
   
   Server Error Log:
   ```
   2021-11-11T15:14:28.086+0800    ERROR   dubbo/dubbo_codec.go:196        pkg.Unmarshal(len(@data):0) = error:get wrong attachments: 
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.unmarshalRequestBody
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/impl/hessian.go:267
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.HessianSerializer.Unmarshal
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/impl/hessian.go:56
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.(*ProtocolCodec).Decode
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/impl/codec.go:186
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.(*DubboPackage).Unmarshal
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/impl/package.go:93
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo.(*DubboCodec).decodeRequest
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/dubbo_codec.go:189
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo.(*DubboCodec).Decode
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/dubbo_codec.go:165
   dubbo.apache.org/dubbo-go/v3/remoting/getty.(*RpcServerPackageHandler).Read
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/remoting/getty/readwriter.go:104
   github.com/apache/dubbo-getty.(*session).handleTCPPackage
           /Users/phil/go/pkg/mod/github.com/apache/dubbo-getty@v1.4.5/session.go:627
   github.com/apache/dubbo-getty.(*session).handlePackage
           /Users/phil/go/pkg/mod/github.com/apache/dubbo-getty@v1.4.5/session.go:549
   runtime.goexit
           /usr/local/go/src/runtime/asm_amd64.s:1371
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo.(*DubboCodec).decodeRequest
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/dubbo_codec.go:196
   dubbo.apache.org/dubbo-go/v3/protocol/dubbo.(*DubboCodec).Decode
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/protocol/dubbo/dubbo_codec.go:165
   dubbo.apache.org/dubbo-go/v3/remoting/getty.(*RpcServerPackageHandler).Read
           /Users/phil/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc3.0.20211109121610-2ebc38bed562/remoting/getty/readwriter.go:104
   github.com/apache/dubbo-getty.(*session).handleTCPPackage
           /Users/phil/go/pkg/mod/github.com/apache/dubbo-getty@v1.4.5/session.go:627
   github.com/apache/dubbo-getty.(*session).handlePackage
           /Users/phil/go/pkg/mod/github.com/apache/dubbo-getty@v1.4.5/session.go:549
   ```
   Client dubbogo.yml
   ```
   dubbo:
     consumer:
       references:
         UserProvider:
   #        protocol: jsonrpc
           protocol: dubbo
           interface: com.ikurento.user.UserProvider
   ```
   
   **What you expected to happen**:
   Server正常处理请求
   
   **How to reproduce it (as minimally and precisely as possible)**:
   -
   **Anything else we need to know?**:
   -
   


-- 
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@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] PhilYue commented on issue #1583: pkg.Unmarshal(len(@data):0) = error:get wrong attachments

Posted by GitBox <gi...@apache.org>.
PhilYue commented on issue #1583:
URL: https://github.com/apache/dubbo-go/issues/1583#issuecomment-966052161


   @PhilYue 


-- 
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@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks commented on issue #1583: pkg.Unmarshal(len(@data):0) = error:get wrong attachments

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on issue #1583:
URL: https://github.com/apache/dubbo-go/issues/1583#issuecomment-966818061


   try to fix it by yourself?


-- 
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@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] PhilYue closed issue #1583: pkg.Unmarshal(len(@data):0) = error:get wrong attachments

Posted by GitBox <gi...@apache.org>.
PhilYue closed issue #1583:
URL: https://github.com/apache/dubbo-go/issues/1583


   


-- 
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@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] PhilYue commented on issue #1583: pkg.Unmarshal(len(@data):0) = error:get wrong attachments

Posted by GitBox <gi...@apache.org>.
PhilYue commented on issue #1583:
URL: https://github.com/apache/dubbo-go/issues/1583#issuecomment-966067655


   [dubbo-go/protocol/dubbo/impl/hessian.go#unmarshalRequestBody](https://github.com/apache/dubbo-go/blob/master/protocol/dubbo/impl/hessian.go#L197)
   ```go
           attachments, err := decoder.Decode()
   	if err != nil {
   		return perrors.WithStack(err)
   	}
   
   	//if attachments == nil {
   	if attachments == nil || attachments == "" { // || attachments == ""
   		attachments = map[interface{}]interface{}{constant.InterfaceKey: target}
   	}
   
   	if v, ok := attachments.(map[interface{}]interface{}); ok {
   		v[DUBBO_VERSION_KEY] = dubboVersion
   		req[6] = ToMapStringInterface(v)
   		buildServerSidePackageBody(p)
   		return nil
   	}
   	return perrors.Errorf("get wrong attachments: %+v", attachments)
   ```


-- 
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@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org