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

Logging reports crash of debug message #38

Closed
casabre opened this issue Feb 7, 2021 · 6 comments
Closed

Logging reports crash of debug message #38

casabre opened this issue Feb 7, 2021 · 6 comments

Comments

@casabre
Copy link

casabre commented Feb 7, 2021

Running the AMQP client in a Docker environment throws the following error continuously for multiple times in AMQPClient. The client itself is operational but dumps a lot of error messages to the log which are making debugging of the own code for "Service" quite hard.

Exception handling log message: MethodError(Service.var"#3#5"{String}("yyyy-mm-dd HH:MM:SS"), ((level = Debug, message = "Frame Conversion: generic => method", _module = AMQPClient, group = :types, id = :AMQPClient_96aa8459, file = "/root/.julia/packages/AMQPClient/P6CBt/src/types.jl", line = 242, kwargs = Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()),), 0x0000000000006d21)
module=AMQPClient  file=/root/.julia/packages/AMQPClient/P6CBt/src/types.jl  line=242
Second exception: MethodError(Service.var"#3#5"{String}("yyyy-mm-dd HH:MM:SS"), ((level = Error, message = "Exception while generating log record in module AMQPClient at /root/.julia/packages/AMQPClient/P6CBt/src/types.jl:242", _module = AMQPClient, group = :logevent_error, id = :AMQPClient_96aa8459, file = "/root/.julia/packages/AMQPClient/P6CBt/src/types.jl", line = 242, kwargs = Base.Iterators.Pairs{Symbol,Tuple{MethodError,Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}},Tuple{Symbol},NamedTuple{(:exception,),Tuple{Tuple{MethodError,Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}}}}}(:exception => (MethodError(AcquisitionService.var"#3#5"{String}("yyyy-mm-dd HH:MM:SS"), ((level = Debug, message = "Frame Conversion: generic => method", _module = AMQPClient, group = :types, id = :AMQPClient_96aa8459, file = "/root/.julia/packages/AMQPClient/P6CBt/src/types.jl", line = 242, kwargs = Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()),), 0x0000000000006d21), [Ptr{Nothing} @0x00007fcf9dde5aec, Ptr{Nothing} @0x00007fcf9dded454, Ptr{Nothing} @0x00007fcf9ddef1bc, Ptr{Nothing} @0x00007fcf70c13d46, Ptr{Nothing} @0x00007fcf70c13bfb, Ptr{Nothing} @0x00007fcf70c13c7e, Ptr{Nothing} @0x00007fcf9ddeee27, Ptr{Nothing} @0x00007fcf70bf14ae, Ptr{Nothing} @0x00007fcf70bf17ad, Ptr{Nothing} @0x00007fcf70bf4192, Ptr{Nothing} @0x00007fcf70bf4dda, Ptr{Nothing} @0x00007fcf70bf4e0c, Ptr{Nothing} @0x00007fcf9ddeee27, Ptr{Nothing} @0x00007fcf9de0d96e, Ptr{Nothing} @0x0000000000000000]))),), 0x0000000000006d21)

The following lines are affected for instance

  • 242 in types.jl
  • 159 in types.jl
  • 164 in types.jl
  • 282 in protocol.jl
  • 426 in protocol.jl
    ...
@tanmaykm
Copy link
Member

This error seems unrelated to the AMQPClient library. I tested AMQPClient in debug mode and it does log the message properly:

┌ Debug: reading method payload
│   class = 0x0014
│   method = 0x000b
│   nargs = 1
└ @ AMQPClient ~/.julia/dev/AMQPClient/src/types.jl:159
...
┌ Debug: Frame Conversion: generic => method
└ @ AMQPClient ~/.julia/dev/AMQPClient/src/types.jl:242
...

The errors report a MethodError in some code that refers to the entity named Service that you mentioned. So maybe there is something there that needs to be examined?

@casabre
Copy link
Author

casabre commented Feb 15, 2021

@tanmaykm I do not agree with your findings because the Julia log is especially referring to specific line in the e.g. types.jl. Maybe that my call is introducing a wrong interpretation of the variables → could be that they are resulting to nothing in your specific @debug call and thus, the log crashes. But frankly spoken, I am just sending JSON data converted to string and finally to a AMQPClient.Message.

But I am wondering how the string data can introduce such errors. Here is a snippet of my publishing code.

data = json(Dict(some JSON data));

data = Vector{UInt8}(data);
msg = Message(data, content_type = "application/json", delivery_mode = PERSISTENT);
basic_publish(channel, msg; exchange = exchange, routing_key = route);

where channel, exchange and route are set to my specific setup.

@tanmaykm
Copy link
Member

Yes, just sending string/byte data like you mentioned should be fine, that's what all messages are after all.

The occurrence of this: MethodError(Service.var"#3#5"{String}("yyyy-mm-dd HH:MM:SS") in the log snippet you had provided is a bit strange though. Is it possible that you are using a different logger?

@casabre
Copy link
Author

casabre commented Feb 15, 2021

Let's say, I am not overriding it by purpose. I am using AMQPClient in parallel with Genie.jl. After digging a bit in the code, the web framework is overriding the default logger → https://github.com/GenieFramework/Genie.jl/blob/master/files/new_app/config/initializers/logging.jl. But it seems to me not that critical because it is adapting just the message content.

But strange enough, some AMQPClient debug message are printed correctly, some are throwing these errors.

@tanmaykm
Copy link
Member

Yes, strange indeed. The log statement at line 242 of types.jl, for example, is just a simple string.

@debug("Frame Conversion: generic => method")

There does not seem to be else here that can cause this error.

I do not understand Genie.jl internals. Maybe best to raise an issue at Genie.jl and see if something turns up?

@casabre
Copy link
Author

casabre commented Feb 15, 2021

Maybe best to raise an issue at Genie.jl and see if something turns up?

Yes, that sounds reasonable. Because I am also not into deep the Genie.jl internals. I would come back to this thread if something is still related to AMQP.

Thanks anyway for your support!

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