Interactions-HSG / xarm-grpc

A command-line interface for xArm-C++-SDK to interact with UFACTORY xArms
Eclipse Public License 2.0
5 stars 0 forks source link

Serialization Error: Invalid UTF-8 Data in String Field #38

Closed jo-bru closed 2 years ago

jo-bru commented 2 years ago

Sending multiple getVersion requests may result in breaking the gRPC connection, resulting in the following error message:

[XAPIDeamon] stderr: [libprotobuf ERROR /home/jo-bru/grpc/third_party/protobuf/src/google/protobuf/wire_format_lite.cc:577] String field 'xapi.Version.version' contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.

jo-bru commented 2 years ago

This problem occurs only when the connection is created and closed multiple times using initialize/ disconnect The following error is shown before further problems arise: Error: socket read failed, port=502, fp=13, errno=0, exit => internal error thrown in xARM-CPLUS-SDK This problem is only relevant for non-normal use-cases and therefore will not be addressed in the near future. => might still be interesting for the MT discussion.

this issue is paused until further notice.

jo-bru commented 2 years ago

This can be recreated by running the following code: (requires the xarm-grpc-client.js script defined here.

const XAPIClient = require("./lib/xarm-grpc-client.js");

const IPService = '130.82.171.7'; //130.82.171.7 / localhost
const PortService = '50051';

const IPXarm = '130.82.171.9';

var xapiClient = new XAPIClient(IPService, PortService);

var errorCode = 0;

async function runReconnectRoutine() {
    while (!errorCode) {
        await xapiClient.initialize(IPXarm)
        response = await xapiClient.getVersion();
        console.log("Version: ", response.version);
        console.log("Response code: ", response.status_code);
        errorCode = response.status_code
        await xapiClient.disconnect();
        await new Promise(r => setTimeout(r, 100));

    }
}

runReconnectRoutine();