question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client throws base64 encoding error on RPC call

See original GitHub issue

Given the following sample web page

<html>
    <meta charset="utf-8"/>
    <script src="compiled.js"></script>
    <script>

        var client = new proto.API.ServiceClient('127.0.0.1:50051');

        var query = new proto.API.Query();
        query.setMessagesList(["testing", "1", "2", "3"]);

        client.get(query, {}, function(error, response) {
            if (error) {
                console.log(error);
            } else {
                console.log(reponse.getResponse());
            }
        });
    </script>
</html>

A JavaScript error is thrown at client.get with the following stacktrace.

Error: Unknown base64 encoding at char: <
compiled.js:429:210
c
http://localhost:3000/compiled.js:429:210
goog.crypt.base64.decodeStringInternal_
http://localhost:3000/compiled.js:429:312
goog.crypt.base64.decodeStringToUint8Array
http://localhost:3000/compiled.js:428:277
module$contents$grpc$web$GrpcWebClientReadableStream_GrpcWebClientReadableStream/<
http://localhost:3000/compiled.js:432:237
goog.events.EventTarget.prototype.fireListeners
http://localhost:3000/compiled.js:279:296
goog.events.EventTarget.dispatchEventInternal_
http://localhost:3000/compiled.js:281:475
goog.events.EventTarget.prototype.dispatchEvent
http://localhost:3000/compiled.js:276:274
goog.net.XhrIo.prototype.onReadyStateChangeHelper_
http://localhost:3000/compiled.js:401:485
goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_
http://localhost:3000/compiled.js:400:491
goog.net.XhrIo.prototype.onReadyStateChange_
http://localhost:3000/compiled.js:400:387
<anonymous> self-hosted:975:17

I’m a little puzzled by the method signature of client.get. Are there any docs which point me in the direction of what the empty object in the second parameter is doing?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
ateccecommented, May 14, 2018

heh. yeah, i did move to that! simple single static binaries. such is the Way of Unix 😄

1reaction
jonahbroncommented, May 14, 2018

@atecce There’s also a GRPC-Web proxy implemented in Go by Improbable, available here:

https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy

I found it a bit easier to set up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

libxmlrpc_util - User manual for XML-RPC for C/C++
Fatal Error Handling; Memory Blocks; Base64 Encoding And Decoding; Character Code Conversions ... We call what XMLRPC_FAIL does "throwing an error.".
Read more >
CSE 461: Introduction to Computer-Communication Networks ...
Remote procedure call (RPC) is a mechanism intended to greatly simplify writing ... During this process, an error might occur and an exception...
Read more >
How to send base64 image to gRPC tf serving server instead ...
I want to do the same but using gRPC client code. The code for that is: import grpc from tensorflow_serving.apis import predict_pb2 from ......
Read more >
gRPC over HTTP2
This will prevent other HTTP/2 clients from interpreting a gRPC error response, ... apply base64 encoding & decoding as headers are sent and...
Read more >
XML-RPC - Quick Guide - Tutorialspoint
XML-RPC - Quick Guide, RPC stands for Remote Procedure Call. ... base64, Binary information encoded as Base 64, as defined in RFC 2045....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found