Giter Site home page Giter Site logo

grpc-dynamic-gateway's Issues

Deprecation Warnings

How hard would it be to update the grpc load functions?

I'm getting a lot of

(node:1156) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead

But seems like load doesn't behave like loadPackageDefinition because when I tried making a quick patch

grpc.load = function(options) {
	return grpc.loadPackageDefinition(
		loader.loadSync(options.file, {
			keepCase: true,
			includeDirs: [options.root],
		})
	);
};

Enumerations stopped serializing as string and turned into numbers in the response's json object

Error: Unexpected token: "XXX.proto". Expected ";"

We do not support import public when running grpc-dynamic-gateway.

After removing the public, it runs without any problem.

/home/huan/git/grpc-dynamic-gateway/node_modules/protocol-buffers-schema/parse.js:501
  if (tokens[0] !== ';') throw new Error('Unexpected token: ' + tokens[0] + '. Expected ";"')
                         ^

Error: Unexpected token: "puppet/base.proto". Expected ";"

Related issue: grpc-ecosystem/grpc-gateway#139

An in-range update of grpc is breaking the build 🚨

The dependency grpc was updated from 1.15.1 to 1.16.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

grpc is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Issue running grpc-dynamic-gateway

I am having some issues using grpc-dynamic-gateway, and I was hoping to get some ideas or help from you on getting things working (or tell me if I’m doing something wrong).

My own proto file is failing, but I tried to run it against the example/api.proto file in the repository, and I am getting the same service.children error, as 'children' on the service instance seems to be undefined.

C:\ grpc-dynamic-gateway-master>node example example/api.proto 5050 ./example/api.js
C:\grpc-dynamic-gateway-master\example\index.js:35
      **proto[p][t].service.children.forEach(c => {**
                                  ^
 
**TypeError: Cannot read property 'forEach' of undefined**
    at Object.keys.forEach.t (C:\Users\graham\Desktop\grpc-dynamic-gateway-master\grpc-dynamic-gateway-master\example\index.js:35:35)
    at Array.forEach (native)
    at Object.keys.forEach.p (C:\Users\graham\Desktop\grpc-dynamic-gateway-master\grpc-dynamic-gateway-master\example\index.js:32:25)
    at Array.forEach (native)
    at Object.<anonymous> (C:\Users\graham\Desktop\grpc-dynamic-gateway-master\grpc-dynamic-gateway-master\example\index.js:31:20)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

A few questions:

  1. Do you know why I would get an error like that?
  2. You have a an empty stubbed out annotations.proto file with your test.proto
    a. Why is it stubbed instead of the one from grpc-gateway?
    b. With the stub, the http options attribute wouldn’t parse it seems, or am I missing something?
  3. The install docs for grpc-dynamic-gateway says to do this:
    a. npm -g grpc-dynamic-gateway
    b. I presume it’s a typo and it should be npm install?

Thank you,
Graham

No published Docker build

Though there is a Dockerfile, the Travis CI build does not actually push to Docker Hub so the image is not available as is shown in the readme

This can be rectified by creating a konsumer DockerHub account (if you don't already have one), updating TravisCI with the dockerhub credentials, and updating the travis build to call Docker build and push on the master branch.

An in-range update of release-it is breaking the build 🚨

The devDependency release-it was updated from 8.3.1 to 8.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

release-it is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for Release 8.4.0
  • Try to coerce provided increment into valid semver version (3abbc73)
  • Fall back to "0.0.0" if no latest version is found (ab4c1e7)
Commits

The new version differs by 3 commits.

  • 56ee11f Release 8.4.0
  • 3abbc73 Try to coerce provided increment into valid semver version
  • ab4c1e7 Fall back to "0.0.0" if no latest version is found

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of protocol-buffers-schema is breaking the build 🚨

The dependency protocol-buffers-schema was updated from 3.3.2 to 3.3.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

protocol-buffers-schema is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of yargs is breaking the build 🚨

The dependency yargs was updated from 13.2.2 to 13.2.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

yargs is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 14 commits.

  • a6e67f1 chore(release): 13.2.4
  • fc13476 chore: update standard-verison dependency
  • bf46813 fix(i18n): rename unclear 'implication failed' to 'missing dependent arguments' (#1317)
  • a3a5d05 docs: fix a broken link to MS Terminology Search (#1341)
  • b4f8018 build: add .versionrc that hides test/build
  • 0c39183 chore(release): 13.2.3
  • 08e0746 chore: update deps (#1340)
  • 843e939 docs: make --no- boolean prefix easier to find in the docs (#1338)
  • 84cac07 docs: restore removed changelog of v13.2.0 (#1337)
  • b20db65 fix(deps): upgrade cliui for compatibility with latest chalk. (#1330)
  • c294d1b test: accept differently formatted output (#1327)
  • ac3f10c chore: move .hbs templates into .js to facilitate webpacking (#1320)
  • 0295132 fix: address issues with dutch translation (#1316)
  • 9f2468e doc: clarify parserConfiguration object structure (#1309)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Error using package namespace in proto with . in it

I have found an issue where grpc-dynamic-gateway crashes if the package in the proto file contains a . in it (which is helpful for clean code generation in languages like C++)

i.e. this fails:

syntax = "proto3";

package test.stuff;

import "google/api/annotations.proto";

service TestService
{
	rpc TestRpc (TestParams) returns (TestData)
	{
		option (google.api.http) =
		{
			post: "/v1/assets/op/execute"
			body: "*"
		};
	}
}

message TestParams
{
	string testField = 1;
}

message TestData
{
	string myData = 1;
}

With this error:

C:\Users\graham\Documents\Repositories\halcyon>grpc-dynamic-gateway -g 0.0.0.0:50060 -I ./Proto/proto AssetService2.proto
C:\Users\graham\AppData\Roaming\npm\node_modules\grpc-dynamic-gateway\index.js:34
        clients[pkg][svc] = new protos[si][pkg][svc](grpcLocation, credentials)
                                               ^

TypeError: Cannot read property 'TestService' of undefined
    at sch.services.forEach.s (C:\Users\graham\AppData\Roaming\npm\node_modules\grpc-dynamic-gateway\index.js:34:48)
    at Array.forEach (native)
    at protoFiles.map.map.forEach (C:\Users\graham\AppData\Roaming\npm\node_modules\grpc-dynamic-gateway\index.js:32:20)
    at Array.forEach (native)
    at middleware (C:\Users\graham\AppData\Roaming\npm\node_modules\grpc-dynamic-gateway\index.js:29:6)
    at Object.<anonymous> (C:\Users\graham\AppData\Roaming\npm\node_modules\grpc-dynamic-gateway\cli.js:61:26)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

While this:

syntax = "proto3";

package teststuff;

import "google/api/annotations.proto";

service TestService
{
	rpc TestRpc (TestParams) returns (TestData)
	{
		option (google.api.http) =
		{
			post: "/v1/assets/op/execute"
			body: "*"
		};
	}
}

message TestParams
{
	string testField = 1;
}

message TestData
{
	string myData = 1;
}

Works fine:

C:\Users\graham\Documents\Repositories\halcyon>grpc-dynamic-gateway -g 0.0.0.0:50060 -I ./Proto/proto AssetService2.proto
POST /v1/assets/op/execute
Listening on http://0.0.0.0:8080, proxying to gRPC on 0.0.0.0:50060

Thank you,
Graham

8 RESOURCE_EXHAUSTED: Received message larger than max

Hello,

I'm getting this error 8 RESOURCE_EXHAUSTED: Received message larger than max (7479039 vs. 4194304) when sending a large request (base64 encoded input string) to my grpc gateway using this library.
I can see this is due to a exceeding a default request size value (of 4MB) set at the grpc server level and I need to pass options to the grpc server as mentioned in this thread (eg options = [('grpc.max_receive_message_length', max_message_length)]) to override and increase this request size option to fix this issue. However how can I pass options to the grpc server using this library?
Thanks!

An in-range update of body-parser is breaking the build 🚨

The dependency body-parser was updated from 1.18.3 to 1.19.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

body-parser is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 44 commits.

There are 44 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of grpc is breaking the build 🚨

The dependency grpc was updated from 1.22.1 to 1.22.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

grpc is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of release-it is breaking the build 🚨

The devDependency release-it was updated from 12.4.3 to 12.5.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

release-it is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for Release 12.5.0
  • Always use npm.tag if provided when resolving tag (fixes #586) (39dcc22)
  • Fix prerelease continuation type in interactive mode (fixes #588) (0e62393)
  • Add docs about npm.publishPath (90531ab)
  • Update dependencies (4949a8a)
  • Update/migrate to latest semver (a11f992)
  • Update/migrate to latest @octokit/rest (5ad3e18)
  • Fix links to documentation (#599) (cec2829)
  • Move both auto-changelog recipes to the /conf directory (#587) (b90831a)
Commits

The new version differs by 34 commits.

  • 12c73b4 Release 12.5.0
  • 39dcc22 Always use npm.tag if provided when resolving tag (fixes #586)
  • 0e62393 Fix prerelease continuation type in interactive mode (fixes #588)
  • 90531ab Add docs about npm.publishPath
  • 4949a8a Update dependencies
  • a11f992 Update/migrate to latest semver
  • 5ad3e18 Update/migrate to latest @octokit/rest
  • cec2829 Fix links to documentation (#599)
  • b90831a Move both auto-changelog recipes to the /conf directory (#587)
  • da075e6 Release 12.5.0-next.3
  • 8cc81f1 Simplify/fix debug logic in metrics (related to #574)
  • f818699 Fix toml example
  • fd67e6c Add auto-changelog template file to be used directly from the repository (#583)
  • 47548b5 Release 12.5.0-next.2
  • 923a56c Authenticate and verify as collaborator with GitLab on init

There are 34 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Include variable in middleware has no default value

There are some problems when trying the express example on README.
I've managed to make it start, but I had to dig into the library code to find out why it was failing.

The problem is here:

const middleware = (protoFiles, grpcLocation, credentials = requiredGrpc.credentials.createInsecure(), debug = true, include, grpc = requiredGrpc) => {

Since there's no default value for include argument it will fail with undefined errors. It would be better to move include to the start of the function if there's no way to set a default value like the other arguments.

app.use(grpcGateway(["test.proto"], '0.0.0.0:5051'));

Getting a little more verbose I managed to make it start with

app.use("/", grpcGateway(["test.proto"], "0.0.0.0:5051", undefined, false, __dirname));

better config options

It should not be necessary to modify the lib to set config options. Explore this a bit more, and make sure any options we need can be added to instantiation. Maybe a good higher default for message-size is a good idea, too.

See #38

An in-range update of release-it is breaking the build 🚨

The devDependency release-it was updated from 7.6.1 to 7.6.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

release-it is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for Release 7.6.2
Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

include multiple import path?

the protoc compilation support --proto_path= to be specified multiple times, but this project seems not? because in a real large project, there are multiple proto definition files in a complex hierarchy ...

$ protoc --help
Usage: protoc [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
  -IPATH, --proto_path=PATH   Specify the directory in which to search for
                              imports.  May be specified multiple times;
                              directories will be searched in order.  If not
                              given, the current working directory is used.

  -oFILE,                     Writes a FileDescriptorSet (a protocol buffer,
    --descriptor_set_out=FILE defined in descriptor.proto) containing all of
                              the input files to FILE.

I read the code seems requiring the include to be one string only?
https://github.com/konsumer/grpc-dynamic-gateway/blob/master/index.js#L37

While, I've tried to touch the code a bit if I can make it working, but the grpc.load({ file: p, root: include }) call seems undocumented? the Documentation will definitely need to be improved, while, do you know if it support multiple include proto path?
https://grpc.io/grpc/node/grpc.html#.load__anchor

Another possibility is I see protoc can compile the complex hierarchy *.proto into a single protoset binary file, and it's well supported by tools like grpcurl Are you aware if nodejs-grpc has similar protoset-files support? And add into this tool if possible

https://github.com/fullstorydev/grpcurl#protoset-files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.