Grpc: error unmarshalling request: proto: wrong wireType = 2 for field StartTs

Hi
I create a recommendation system by golang and dgo
and i use this query for this recommend :
{


    find as var(func: allofterms(UrlName,mehrdad)) {
        sc as math(1)
        fr as friend {
            friend {
                fscore as math(sc)
            }
        }
    }
    recommendationprofile(func: uid(fscore), orderdesc: val(fscore), first: 10) @filter(not uid(find, fr)) {
        UrlName
    }
}

But when i start the project and send a UrlName with grpc show this error :

{
     "recommendedprofileid": [],
     "err": "rpc error: code = Internal desc = grpc: error unmarshalling request: proto: wrong wireType = 2 for field StartTs"
}

my function for recommend is :

func (s *recomenderStore) Recommend(ctx context.Context, profileid string) ([]string, error) {

	var resp struct {
		Find []struct {
			URLNAME []string `json:"UrlName"`
		} `json:"reecommendprofileid"`
	}

	queryvar := fmt.Sprintf(
		`{
	find as var(func: allofterms(UrlName,"%v")) {
		sc as math(1)
		fr as friend { 
			friend {
				fscore as math(sc)
			}
		}
	}
		   
		   
	recommendationprofile(func: uid(fscore), orderdesc: val(fscore), first: 10) @filter(not uid(find, fr)) {
		UrlName
	}
}`, profileid)

	fmt.Println(queryvar)
	query, err := s.client.NewTxn().Query(ctx, queryvar)

	fmt.Println(err)
	if err != nil {
		return nil, err
	}

	// parse response json recommend
	err = json.Unmarshal(query.Json, &resp)
	recommendProfileID := resp.Find[0].URLNAME

	return recommendProfileID, err
}

Can you help me ??!!

If you are using Dgraph 1.1, you should import dgo v2 github.com/dgraph-io/dgo/v2

I’m getting this with the Java library. Is it also a dependency version issue?

If you are using dgraph 1.1, use a version of the Java client >= 2.0

Otherwise, use a previous version.

1 Like

Turns out the wrong Jar version got deployed, so that’s what the issue was.

1 Like

Hey Aman,

If possible pls update the clients documentation on the site too. Was a little confusing in the start to be honest.
I was following the Go client, details in below examples are different

Thanks

1 Like

Hi @Paritosh-Anand, Welcome to Dgraph!

Thanks for pointing this out. While we take a look, can you point me where did you get confused? Github readme should be the most recent version. CC: @martinmr