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

Failed to obtain reader in the logs #331

Closed
smacker opened this issue Oct 25, 2018 · 7 comments
Closed

Failed to obtain reader in the logs #331

smacker opened this issue Oct 25, 2018 · 7 comments
Assignees

Comments

@smacker
Copy link
Contributor

smacker commented Oct 25, 2018

Failed to obtain reader, Failed to marshal fields to JSON, json: unsupported type: func(io.Reader)

this error isn't formatted as json, so I guess the error happens during logging.

@carlosms
Copy link
Contributor

What is the context of that error? Is that from staging? Your installation? which version? Is that after performing some action, or on startup?

@smacker
Copy link
Contributor Author

smacker commented Oct 30, 2018

staging. the version is master.

Because the error doesn't contain any info besides above I don't know when exactly it happens. Context around says during fetching events but looks like it doesn't happen always.

the PR should help to debug it.

@smacker
Copy link
Contributor Author

smacker commented Oct 30, 2018

Don't see this error on staging anymore (not exactly this but the one related to logging a function).

Let's wait few days if there is still no error we can close it as "can't reproduce". It's possible that error was fixed in some previous commit (apparently lookout was deploying on different cluster since some days ago)

@smacker
Copy link
Contributor Author

smacker commented Nov 2, 2018

Still nothing related in logs on new staging.

@smacker smacker closed this as completed Nov 2, 2018
@smacker
Copy link
Contributor Author

smacker commented Dec 5, 2018

I see this error in staging logs again:

Failed to obtain reader, Failed to marshal fields to JSON, json: unsupported type: func() (io.ReadCloser, error)

not sure why new logrus version doesn't provide correct logs for this error. We need to investigate.

@smacker smacker reopened this Dec 5, 2018
@smacker
Copy link
Contributor Author

smacker commented Dec 5, 2018

When I try to reproduce it locally adding function with the same signature into logs I get:

{"app":"lookoutd","level":"info","logrus_error":"can not add field \"func\"","msg":"my-test","time":"2018-12-05T17:13:34.32557+01:00"}

@smacker
Copy link
Contributor Author

smacker commented Dec 5, 2018

Most probably it happens because we pass pointer to a function as a log field somewhere 😱
Can't find such place in our code.

Here is a proposal to fix it in logrus: sirupsen/logrus#642 (comment)

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

2 participants