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/08/15 13:53:22 UTC
[GitHub] [dubbo-go-pixiu] MasterKenway opened a new issue #240: Request for a none params integration request which is on dubbo protocol failed
MasterKenway opened a new issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240
<!-- 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**:
Request for a none params integration request which is on dubbo protocol failed
**What you expected to happen**:
fix it
**How to reproduce it (as minimally and precisely as possible)**:
In `samples/dubbogo/simple/query/`
add below function for `userDB`
```
func (db *userDB) GetAllUsers() ([]*User, error) {
var users []*User //nolint:prealloc
if len(db.nameIndex) == 0 {
return users, errors.New("no users")
}
for _, user := range db.nameIndex {
users = append(users, user)
}
return users, nil
}
```
add below function for `UserProvider`
```
func (u *UserProvider) GetAllUsers(_ context.Context) ([]*User, error) {
return cache.GetAllUsers()
}
```
add below config for `pixiu/api_config.yml`
```
- path: '/api/v1/test-dubbo/user/get-all'
type: restful
description: user
methods:
- httpVerb: GET
onAir: true
timeout: 1000ms
inboundRequest:
requestType: http
integrationRequest:
requestType: http
host: 127.0.0.1:8889
path: /UserProvider/GetAllUsers
group: "test"
version: 1.0.0
```
this example will lead to null pointer panic
**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-pixiu] MasterKenway edited a comment on issue #240: Request for a none params integration request which is on dubbo protocol failed
Posted by GitBox <gi...@apache.org>.
MasterKenway edited a comment on issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240#issuecomment-899054471
After my debug and discuss with @XavierNiu, I changed my code to
```
// Call invoke service
func (dc *Client) Call(req *client.Request) (res interface{}, err error) {
// method, paramType, paramValue
gsReq := make([]interface{}, 3)
// if GET with no args, values would be nil
values, err := dc.genericArgs(req)
if err != nil {
return nil, err
}
val, ok := values.(*dubboTarget)
if !ok {
return nil, errors.New("map parameters failed")
}
dm := req.API.Method.IntegrationRequest
method := dm.Method
gsReq[0] = method
if val != nil {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, val.Types, val.Values)
gsReq[1], gsReq[2] = val.Types, val.Values
} else {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, nil, nil)
gsReq[1], gsReq[2] = []hessian.Object{}, []hessian.Object{}
}
gs := dc.Get(dm)
rst, err := gs.Invoke(req.Context, gsReq)
if err != nil {
return nil, err
}
logger.Debugf("[dubbo-go-pixiu] dubbo client resp:%v", rst)
return rst, nil
}
```
But this lead to server error:
```
2021-08-15T22:00:59.795+0800 INFO dubbo-getty/session.go:578 {server:TCP_SERVER:1:172.17.161.60:20000<->172.17.161.60:47748}, [session.conn.read] = error:EOF
github.com/apache/dubbo-getty.(*gettyTCPConn).recv
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/connection.go:262
github.com/apache/dubbo-getty.(*session).handleTCPPackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:629
github.com/apache/dubbo-getty.(*session).handlePackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:578
runtime.goexit
C:/Users/Kenway/gosdk/go1.16.4/src/runtime/asm_amd64.s:1371
github.com/apache/dubbo-getty.(*session).handleTCPPackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:635
github.com/apache/dubbo-getty.(*session).handlePackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:578
runtime.goexit
C:/Users/Kenway/gosdk/go1.16.4/src/runtime/asm_amd64.s:1371
```
--
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-pixiu] MasterKenway edited a comment on issue #240: Request for a none params integration request which is on dubbo protocol failed
Posted by GitBox <gi...@apache.org>.
MasterKenway edited a comment on issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240#issuecomment-899054471
After my debug and discuss with @xavier-niu, I changed my code to
In dubbo protocol client call method:
```
// Call invoke service
func (dc *Client) Call(req *client.Request) (res interface{}, err error) {
// method, paramType, paramValue
gsReq := make([]interface{}, 3)
// if GET with no args, values would be nil
values, err := dc.genericArgs(req)
if err != nil {
return nil, err
}
val, ok := values.(*dubboTarget)
if !ok {
return nil, errors.New("map parameters failed")
}
dm := req.API.Method.IntegrationRequest
method := dm.Method
gsReq[0] = method
if val != nil {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, val.Types, val.Values)
gsReq[1], gsReq[2] = val.Types, val.Values
} else {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, nil, nil)
gsReq[1], gsReq[2] = []hessian.Object{}, []hessian.Object{}
}
gs := dc.Get(dm)
rst, err := gs.Invoke(req.Context, gsReq)
if err != nil {
return nil, err
}
logger.Debugf("[dubbo-go-pixiu] dubbo client resp:%v", rst)
return rst, nil
}
```
But this lead to pixiu error:
```
2021-08-17T17:08:37.216+0800 ERROR dubbo/dubbo_codec.go:245 pkg.Unmarshal(len(@data):0) = error:can not find go type name com.dubbogo.pixiu.User in registry
github.com/apache/dubbo-go-hessian2.(*Decoder).getStructDefByIndex
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/object.go:576
github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/object.go:678
github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/decode.go:285
github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/object.go:652
github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/decode.go:285
github.com/apache/dubbo-go-hessian2.(*Decoder).readUntypedList
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/list.go:414
github.com/apache/dubbo-go-hessian2.(*Decoder).decList
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/list.go:284
github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/decode.go:278
github.com/apache/dubbo-go-hessian2.(*Decoder).Decode
```
--
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-pixiu] MasterKenway closed issue #240: Request for a none params integration request which is on dubbo protocol failed
Posted by GitBox <gi...@apache.org>.
MasterKenway closed issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240
--
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-pixiu] MasterKenway edited a comment on issue #240: Request for a none params integration request which is on dubbo protocol failed
Posted by GitBox <gi...@apache.org>.
MasterKenway edited a comment on issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240#issuecomment-899054471
After my debug and discuss with @xavier-niu, I changed my code to
In dubbo protocol client call method:
```
// Call invoke service
func (dc *Client) Call(req *client.Request) (res interface{}, err error) {
// method, paramType, paramValue
gsReq := make([]interface{}, 3)
// if GET with no args, values would be nil
values, err := dc.genericArgs(req)
if err != nil {
return nil, err
}
val, ok := values.(*dubboTarget)
if !ok {
return nil, errors.New("map parameters failed")
}
dm := req.API.Method.IntegrationRequest
method := dm.Method
gsReq[0] = method
if val != nil {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, val.Types, val.Values)
gsReq[1], gsReq[2] = val.Types, val.Values
} else {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, nil, nil)
gsReq[1], gsReq[2] = []hessian.Object{}, []hessian.Object{}
}
gs := dc.Get(dm)
rst, err := gs.Invoke(req.Context, gsReq)
if err != nil {
return nil, err
}
logger.Debugf("[dubbo-go-pixiu] dubbo client resp:%v", rst)
return rst, nil
}
```
But this lead to server error:
```
2021-08-15T22:00:59.795+0800 INFO dubbo-getty/session.go:578 {server:TCP_SERVER:1:172.17.161.60:20000<->172.17.161.60:47748}, [session.conn.read] = error:EOF
github.com/apache/dubbo-getty.(*gettyTCPConn).recv
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/connection.go:262
github.com/apache/dubbo-getty.(*session).handleTCPPackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:629
github.com/apache/dubbo-getty.(*session).handlePackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:578
runtime.goexit
C:/Users/Kenway/gosdk/go1.16.4/src/runtime/asm_amd64.s:1371
github.com/apache/dubbo-getty.(*session).handleTCPPackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:635
github.com/apache/dubbo-getty.(*session).handlePackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:578
runtime.goexit
C:/Users/Kenway/gosdk/go1.16.4/src/runtime/asm_amd64.s:1371
```
--
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-pixiu] MasterKenway commented on issue #240: Request for a none params integration request which is on dubbo protocol failed
Posted by GitBox <gi...@apache.org>.
MasterKenway commented on issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240#issuecomment-899054471
After my debug and discuss with @XavierNiu, I changed my code to
--
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-pixiu] MasterKenway edited a comment on issue #240: Request for a none params integration request which is on dubbo protocol failed
Posted by GitBox <gi...@apache.org>.
MasterKenway edited a comment on issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240#issuecomment-899054471
After my debug and discuss with @xavier-niu, I changed my code to
```
// Call invoke service
func (dc *Client) Call(req *client.Request) (res interface{}, err error) {
// method, paramType, paramValue
gsReq := make([]interface{}, 3)
// if GET with no args, values would be nil
values, err := dc.genericArgs(req)
if err != nil {
return nil, err
}
val, ok := values.(*dubboTarget)
if !ok {
return nil, errors.New("map parameters failed")
}
dm := req.API.Method.IntegrationRequest
method := dm.Method
gsReq[0] = method
if val != nil {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, val.Types, val.Values)
gsReq[1], gsReq[2] = val.Types, val.Values
} else {
logger.Debugf("[dubbo-go-pixiu] dubbo invoke, method:%s, types:%s, reqData:%v", method, nil, nil)
gsReq[1], gsReq[2] = []hessian.Object{}, []hessian.Object{}
}
gs := dc.Get(dm)
rst, err := gs.Invoke(req.Context, gsReq)
if err != nil {
return nil, err
}
logger.Debugf("[dubbo-go-pixiu] dubbo client resp:%v", rst)
return rst, nil
}
```
But this lead to server error:
```
2021-08-15T22:00:59.795+0800 INFO dubbo-getty/session.go:578 {server:TCP_SERVER:1:172.17.161.60:20000<->172.17.161.60:47748}, [session.conn.read] = error:EOF
github.com/apache/dubbo-getty.(*gettyTCPConn).recv
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/connection.go:262
github.com/apache/dubbo-getty.(*session).handleTCPPackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:629
github.com/apache/dubbo-getty.(*session).handlePackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:578
runtime.goexit
C:/Users/Kenway/gosdk/go1.16.4/src/runtime/asm_amd64.s:1371
github.com/apache/dubbo-getty.(*session).handleTCPPackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:635
github.com/apache/dubbo-getty.(*session).handlePackage
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-getty/session.go:578
runtime.goexit
C:/Users/Kenway/gosdk/go1.16.4/src/runtime/asm_amd64.s:1371
```
--
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-pixiu] MasterKenway commented on issue #240: Request for a none params integration request which is on dubbo protocol failed
Posted by GitBox <gi...@apache.org>.
MasterKenway commented on issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240#issuecomment-914059019
Fixed: https://github.com/apache/dubbo-go/pull/1413
--
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