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

Problem validating JSON document against schema #111

Closed
astropanic opened this issue May 7, 2018 · 14 comments
Closed

Problem validating JSON document against schema #111

astropanic opened this issue May 7, 2018 · 14 comments
Assignees

Comments

@astropanic
Copy link
Contributor

astropanic commented May 7, 2018

2018-05-07T15:44:25.647+0200    ERROR    [request]    beater/handlers.go:384    error handling request    {"request_id": "f0472126-608a-41b8-81fb-1741d457e632", "error": "Problem validating JSON document against schema: I[#] S[#] doesn't validate with \"transaction#\"\n  I[#/transactions/0/spans/1/context/db/statement] S[#/properties/transactions/items/properties/spans/items/properties/context/properties/db/properties/statement/type] expected string or null, but got object"}

How I should proceed with debugging to find out what the issue is?
What information should I attach?

@mikker
Copy link
Contributor

mikker commented May 7, 2018

Hi @astropanic ! Thanks for reporting this. What ORM are you using? Is this a Rails app? Are you using Sequel/Mongo/something else? And what version?

@astropanic
Copy link
Contributor Author

Hi @mikker,

Plain Rails with ActiveRecord

@mikker
Copy link
Contributor

mikker commented May 7, 2018

Can I make you try running master? It should be fixed. At least the statements should be converted to strings before sending.

I haven't heard of you problem with running both NewRelic and ElasticAPM before (from your support forum post). Is this maybe related?

@mikker mikker self-assigned this May 9, 2018
@mikker
Copy link
Contributor

mikker commented May 15, 2018

Bump. How do the statements look like if you run master?

@astropanic
Copy link
Contributor Author

astropanic commented May 15, 2018 via email

@mikker
Copy link
Contributor

mikker commented May 22, 2018

Hi again. There's a new version out you could try. Let me know how it works.

@steve21168
Copy link
Contributor

I'm receiving this errors on 1.0.0.beta1 gem.

This is a Rails app using Active Record with Postgresql

From the app side the errors look like this:

apm-server's response: {"error":"Problem validating JSON document against schema: I[#] S[#] doesn't validate with \"transaction#\"\n I[#/transactions/0/spans/13/context/db/statement] S[#/properties/transactions/items/properties/spans/items/properties/context/properties/db/properties/statement/type] expected string or null, but got object"}

From the APM server side:

ERROR [request] beater/handlers.go:384 error handling request {"request_id": "60e2fc39-c2f4-43e1-992b-e3fea1741122", "error": "Problem validating JSON document against schema: I[#] S[#] doesn't validate with \"transaction#\"\n I[#/transactions/0/spans/13/context/db/statement] S[#/properties/transactions/items/properties/spans/items/properties/context/properties/db/properties/statement/type] expected string or null, but got object"}

@sandrew
Copy link

sandrew commented Jun 20, 2018

Same for me

[ElasticAPM] POST returned an unsuccessful status code (400)
[ElasticAPM] apm-server's response: {"error":"data validation error: Problem validating JSON document against schema: I[#] S[#] doesn't validate with \"transaction#\"\n  I[#/transactions/0/spans/10/context/db/statement] S[#/properties/transactions/items/properties/spans/items/properties/context/properties/db/properties/statement/type] expected string or null, but got object"}

apm-server 6.3.0 and agent 1.0.0.beta1 and Rails 5.1.6

@zube zube bot reopened this Jun 20, 2018
@mikker
Copy link
Contributor

mikker commented Jun 20, 2018

Weird. Are any of you using the Elasticsearch gem?

@steve21168
Copy link
Contributor

@mikker Yes we're using the Elasticsearch gem.

@mikker
Copy link
Contributor

mikker commented Jun 20, 2018

@steve21168 I think that might be it. Can I make you try with this?:

gem 'elastic-apm', git: 'https://github.com/elastic/apm-agent-ruby', branch: 'fix-es-spans'`

It's this one: #157

@steve21168
Copy link
Contributor

@mikker Yeah I'll try that branch and get back to you.

@steve21168
Copy link
Contributor

@mikker I think that did the trick. Thanks!

@mikker
Copy link
Contributor

mikker commented Jun 21, 2018

Perfect! Thank you for helping out – I'm merging it to master and releasing a beta2. And also making an issue for APM Server to accept objects as "db" statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants