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

[reporter] [elasticsearch] Request not indexed with complex request's message #1021

Closed
tdaghelet opened this Issue Jan 22, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@tdaghelet
Copy link

tdaghelet commented Jan 22, 2018

Hello,

I have an API with a Assign content policy.

When I call this API, I have an error :
{
"message": "Unable to assign body content: For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar):\n==> request.content [in template "a46207be8b05d9bf1379897a41bbb67ef4fbff14" at line 1, column 37]\n\n----\nFTL stack trace ("~" means nesting-related):\n\t- Failed at: ${request.content.customerNumber} [in template "a46207be8b05d9bf1379897a41bbb67ef4fbff14" at line 1, column 35]\n----",
"http_status_code": 500
}

The problem is that Gravitee doesn't log the call

Steps to Reproduce (for bugs)

  1. Create an API
  2. Add Assign Content policy which throw an error
  3. Call the API
  4. Go in the log : the call doesn't appear

Your Environment

  • Version used: 1.12.2
  • Browser Name and version: N/A
  • Operating System and version: N/A

@brasseld brasseld changed the title [Policy Assign Content] No call logging when error is triggered [policy] [assign-content] No call logging when error is triggered Oct 16, 2018

@brasseld

This comment has been minimized.

Copy link
Member

brasseld commented Oct 16, 2018

Hi @tdaghelet

Are you able to reproduce this issue ?

@tdaghelet

This comment has been minimized.

Copy link
Author

tdaghelet commented Oct 23, 2018

Hello David

Sure, here is an export of an example API to reproduce this bug. Call http://localhost:8082/test, it will fail and nothing will be logged in analytics

{ "name": "TEST", "version": "1", "description": "TEST", "visibility": "PRIVATE", "tags": [], "proxy": { "context_path": "/test", "strip_context_path": false, "loggingMode": "NONE", "endpoints": [ { "name": "default", "target": "http://localhost", "weight": 1, "backup": false, "type": "HTTP", "http": { "connectTimeout": 5000, "idleTimeout": 60000, "keepAlive": true, "readTimeout": 10000, "pipelining": false, "maxConcurrentConnections": 100, "useCompression": true, "followRedirects": false } } ], "load_balancing": { "type": "ROUND_ROBIN" } }, "paths": { "/": [ { "methods": [ "GET", "POST", "PUT", "DELETE", "HEAD", "PATCH", "OPTIONS", "TRACE", "CONNECT" ], "policy-assign-content": { "scope": "REQUEST", "body": "${request.params['blabla']}" }, "description": "Description of the Assign content Policy", "enabled": true }, { "methods": [ "GET", "POST", "PUT", "DELETE", "HEAD", "PATCH", "OPTIONS", "TRACE", "CONNECT" ], "mock": { "headers": [ {} ], "status": "200", "content": "OK" }, "description": "Description of the Mock Gravitee Policy", "enabled": true } ] }, "services": {}, "resources": [], "members": [ { "username": "admin", "role": "PRIMARY_OWNER" } ], "pages": [], "plans": [ { "id": "60cab302-bf12-4beb-8ab3-02bf121beb37", "name": "keyless", "description": "keyless", "validation": "AUTO", "security": "KEY_LESS", "securityDefinition": "{}", "type": "API", "status": "PUBLISHED", "apis": [ "f5e092a6-dd8a-41da-a092-a6dd8a11da33" ], "order": 1, "characteristics": [], "created_at": 1540281275401, "updated_at": 1540281278334, "published_at": 1540281278334, "paths": { "/": [] }, "excluded_groups": [] } ] }

@brasseld brasseld self-assigned this Nov 17, 2018

@brasseld brasseld modified the milestones: 1.21.0, 1.22.0 Nov 17, 2018

@NicolasGeraud NicolasGeraud modified the milestones: 1.22.0, backlog Jan 14, 2019

brasseld added a commit to gravitee-io/gravitee-elasticsearch that referenced this issue Feb 3, 2019

@brasseld brasseld changed the title [policy] [assign-content] No call logging when error is triggered [reporter] [elasticsearch] Request not indexed with complex request's message Feb 3, 2019

NicolasGeraud added a commit to gravitee-io/gravitee-elasticsearch that referenced this issue Feb 4, 2019

@NicolasGeraud NicolasGeraud modified the milestones: backlog, 1.20.12 Feb 4, 2019

NicolasGeraud added a commit to gravitee-io/gravitee-elasticsearch that referenced this issue Feb 11, 2019

@NicolasGeraud NicolasGeraud added this to Done in API Management via automation Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.