michalmuskala / jason

A blazing fast JSON parser and generator in pure Elixir.
Other
1.6k stars 170 forks source link

Error cleaning up processes #92

Closed pedroseabra1091 closed 4 years ago

pedroseabra1091 commented 4 years ago

Everytime I start my Elixir application, I get this error:

Error cleaning up processes -  %Jason.DecodeError{data: "Pedros-MBP.lan:10556:2bfbb92eb793", position: 0, token: nil}

Any suggestions?

OvermindDL1 commented 4 years ago

Error cleaning up processes is not an error that exists within Jason or anywhere that I can see in any of the usual dependencies I use or Elixir itself. What is generating that error? A guess would be that something is trying to parse Pedros-MBP.lan:10556:2bfbb92eb793 as JSON, which it quite isn't, and thus is failing, which code is that?

pedroseabra1091 commented 4 years ago

@OvermindDL1 An Elixir app thats connected to Rails one through Exq / Sidekiq. The error appears after I execute the iex -S mix

OvermindDL1 commented 4 years ago

But what code is reporting that error. Error cleaning up processes is not a standard message so it should be possible to grep it through your code. Check the places where Jason is used to parse shouldn't be hard to grep for either, at the very least just grepping for decode should be sufficient.

This is not a Jason issue, you should ask this on the Elixir forums. All Jason is doing is just saying that Pedros-MBP.lan:10556:2bfbb92eb793 is not JSON, which it isn't, so that is correct. Jason does not create processes. Thus it has to be something in the rest of your code that is causing this. The Elixir Forums would be the place to ask, with a result of at least a grep -R 'decode' lib/ deps/ or so.

pedroseabra1091 commented 4 years ago

Yeh, I searched for it before opening the issue. Since I couldn't anything suspicious on my code, I thought it could be related with Jason. Anyway, thank you. You can close the issue if you want.

OvermindDL1 commented 4 years ago

I don't have access. ^.^

But yeah, definitely should post on the elixir forums, lots of help there!

pedroseabra1091 commented 4 years ago

I happened to find when this happens and how to fix it. It happens when I have Exq hanging processes. However, I can't understand how Jason enters in that equation. Exq.Api.clear_processes(Exq.Api) solves the issue.

Thanks for the help.

michalmuskala commented 4 years ago

Something passes data to Jason.decode that is not a valid JSON. Doesn't seem like an issue with Jason itself, possibly exq, if interacting with it solves the issue.