Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in v0.10.1 when validation is disabled #203

Closed
dagardner-nv opened this issue Nov 7, 2022 · 0 comments · Fixed by #206
Closed

TypeError in v0.10.1 when validation is disabled #203

dagardner-nv opened this issue Nov 7, 2022 · 0 comments · Fixed by #206
Assignees
Labels
bug Something isn't working

Comments

@dagardner-nv
Copy link

dagardner-nv commented Nov 7, 2022

Describe the bug
When validation is disabled I get this error (Possible a duplicate of #202):

2022-11-07 14:51:27 info: Worker sharing HTTP server at http://localhost:8080 ⛳ 
/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:47
            const request = validator.validateRequest(req);
                                      ^

TypeError: Cannot read properties of undefined (reading 'validateRequest')
    at GlobalController.<anonymous> (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:47:39)
    at Generator.next (<anonymous>)
    at /home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:4:12)
    at GlobalController.handler (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:45:44)
    at /home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:41:22
    at Layer.handle [as handle_request] (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/node_modules/express/lib/router/route.js:114:3)

To Reproduce
Steps to reproduce the behavior:

  1. Create a new camouflage project:
camouflage init
  1. Edit config.yml changing line 54 from:
  enable: true

to:

  enable: false
  1. Run camouflage:
camouflage --config config.yml
  1. Test the /pets endpoint
curl -v "http://localhost:8080/pets"

Expected behavior
Working without validation enabled, default project works with validation enabled, and I have a pre-existing project (https://github.com/nv-morpheus/Morpheus/tree/branch-22.11/tests/mock_triton_server) that works with camouflage 0.9 but fails with 0.10.1 .

Desktop (please complete the following information):

  • OS: Linux
  • Browser curl
  • Version 7.74.0

Additional context
Error doesn't appear in log file, copy/pasting terminal output.
FWIW I'm installing camouflage in a conda env.

$ camouflage --config config.yml
2022-11-07 15:07:03 info: [41917] Master Started 
2022-11-07 15:07:03 info: Cluster metrics server listening to 5555, metrics exposed on http://localhost:5555/metrics . Set a negative value for config.monitoring.port to enable monitoring  
(node:41917) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
2022-11-07 15:07:03 info: CORS enabled for http://localhost:3000, http://localhost:3001, http://localhost:5000 
2022-11-07 15:07:03 info: [41941] Worker started 
2022-11-07 15:07:03 info: Handlebar helpers registration started 
2022-11-07 15:07:03 warn: Code Injection is disabled. Helpers such as code, inject, pg, csv and functionalities such as external helpers, will not work. 
2022-11-07 15:07:03 info: Handlebar helpers registration completed 
2022-11-07 15:07:03 info: No middleware injection. 
(node:41941) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
2022-11-07 15:07:03 info: Worker sharing HTTP server at http://localhost:8080 ⛳ 
/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:47
            const request = validator.validateRequest(req);
                                      ^

TypeError: Cannot read properties of undefined (reading 'validateRequest')
    at GlobalController.<anonymous> (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:47:39)
    at Generator.next (<anonymous>)
    at /home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:4:12)
    at GlobalController.handler (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:45:44)
    at /home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/dist/routes/GlobalController.js:41:22
    at Layer.handle [as handle_request] (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/home/dagardner/work/conda/envs/test-camo/lib/node_modules/camouflage-server/node_modules/express/lib/router/route.js:114:3)

Node.js v17.4.0
2022-11-07 15:07:08 warn: [41941] Worker Stopped Mon Nov 07 2022 15:07:08 GMT-0800 (Pacific Standard Time) 
2022-11-07 15:07:08 info: CORS enabled for http://localhost:3000, http://localhost:3001, http://localhost:5000 
2022-11-07 15:07:08 info: [41972] Worker started 
2022-11-07 15:07:08 info: Handlebar helpers registration started 
2022-11-07 15:07:08 warn: Code Injection is disabled. Helpers such as code, inject, pg, csv and functionalities such as external helpers, will not work. 
2022-11-07 15:07:08 info: Handlebar helpers registration completed 
2022-11-07 15:07:08 info: No middleware injection. 
(node:41972) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
2022-11-07 15:07:08 info: Worker sharing HTTP server at http://localhost:8080 ⛳ 
@dagardner-nv dagardner-nv added the bug Something isn't working label Nov 7, 2022
richardruiter added a commit to richardruiter/camouflage that referenced this issue Nov 10, 2022
shubhendumadhukar added a commit that referenced this issue Nov 14, 2022
* fix: validating parameterized paths on the openapi is now supported
* fix: lazy loading the validation modules #203 (#206)
* feat: state helper (#207)
shubhendumadhukar added a commit that referenced this issue Nov 22, 2022
* fix: lazy loading the validation modules #203 (#206)
* feat: state helper (#207)
* feat: cookie support for the capture helper (#209)
* implement basic error response and metadata. #188
* docs: grpc documentation
* fix: race condition with lazy loading of the validation adapters (#210)
richardruiter pushed a commit to richardruiter/camouflage that referenced this issue Nov 28, 2022
* fix: validating parameterized paths on the openapi is now supported
* fix: lazy loading the validation modules testinggospels#203 (testinggospels#206)
* feat: state helper (testinggospels#207)
richardruiter pushed a commit to richardruiter/camouflage that referenced this issue Nov 28, 2022
* fix: lazy loading the validation modules testinggospels#203 (testinggospels#206)
* feat: state helper (testinggospels#207)
* feat: cookie support for the capture helper (testinggospels#209)
* implement basic error response and metadata. testinggospels#188
* docs: grpc documentation
* fix: race condition with lazy loading of the validation adapters (testinggospels#210)
rapids-bot bot pushed a commit to nv-morpheus/Morpheus that referenced this issue Sep 18, 2023
…1195)

* Adopt camouflage-server 0.15, previously we've been locked on v0.9 due to outstanding bugs introduced in versions 0.10 - 0.14.1 :
  - testinggospels/camouflage#203
  - testinggospels/camouflage#223  
  - testinggospels/camouflage#227
  - testinggospels/camouflage#229
* Includes unrelated fix to running CI locally
* Restrict mlflow to versions prior to 2.7

closes #967
Fixes #1192

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md).
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - David Gardner (https://github.com/dagardner-nv)

Approvers:
  - Christopher Harris (https://github.com/cwharris)

URL: #1195
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants