taoensso / nippy

The fastest serialization library for Clojure
https://www.taoensso.com/nippy
Eclipse Public License 1.0
1.04k stars 60 forks source link

No reader provided for custom type with internal id #75

Closed alolis closed 8 years ago

alolis commented 8 years ago

Hello,

I am facing a weird problem at the moment. I have a custom type implemented (and everything works fine regarding that matter), but I stopped my application, started it again and I got the following error:

clojure.lang.ExceptionInfo: No reader provided for custom type with internal id: 31000 {:internal-type-id 31000}
at clojure.core$ex_info.invoke(core.clj:4403)
        at taoensso.nippy$read_custom_BANG_.invoke(nippy.clj:488)
        at taoensso.nippy$thaw_from_in.invoke(nippy.clj:601)
        at taoensso.nippy$thaw_from_in$fn__3868.invoke(nippy.clj:557)
        at taoensso.encore$repeatedly_into.invokePrim(encore.clj:1304)
        at taoensso.nippy$thaw_from_in.invoke(nippy.clj:557)
        at taoensso.nippy$thaw_from_in$fn__3856.invoke(nippy.clj:555)
        at taoensso.encore$repeatedly_into.invokePrim(encore.clj:1308)
        at taoensso.nippy$thaw_from_in.invoke(nippy.clj:555)
        at taoensso.nippy$thaw_from_in$fn__3868.invoke(nippy.clj:557)
        at taoensso.encore$repeatedly_into.invokePrim(encore.clj:1304)
        at taoensso.nippy$thaw_from_in.invoke(nippy.clj:557)
        at taoensso.nippy$thaw_from_in$fn__3862.invoke(nippy.clj:558)
        at taoensso.encore$repeatedly_into.invokePrim(encore.clj:1304)
        at taoensso.nippy$thaw_from_in.invoke(nippy.clj:558)
        at taoensso.nippy$thaw_from_in$fn__3868.invoke(nippy.clj:557)
        at taoensso.encore$repeatedly_into.invokePrim(encore.clj:1304)
        at taoensso.nippy$thaw_from_in.invoke(nippy.clj:557)
        at taoensso.nippy$thaw_from_in_BANG_.invoke(nippy.clj:614)
        at taoensso.nippy$thaw$thaw_data__3939.invoke(nippy.clj:684)
        at taoensso.nippy$thaw.invoke(nippy.clj:705)
        at taoensso.nippy$thaw.invoke(nippy.clj:651)
        at taoensso.carmine.protocol$get_unparsed_reply.invoke(protocol.clj:180)
        at taoensso.carmine.protocol$get_parsed_reply.invoke(protocol.clj:214)
        at taoensso.carmine.protocol$execute_requests.invoke(protocol.clj:321)
        at taoensso.carmine.protocol$with_replies_STAR_.invoke(protocol.clj:343)

If i flushdb however, and start my application, it works normally. Any ideas how can i avoid using flushdb and when this error happens?

Also, let me clear that I am using carmine 2.12.0 and I am extending nippy. My project only includes carmine and I let carmine decide for the nippy version.

ptaoussanis commented 8 years ago

Hi Alexander,

No reader provided for custom type with internal id: 31000

This error implies that you're trying to read some data frozen with Carmine before the necessary nippy/extend-thaw call has been made.

Try move your extend-thaw call earlier in your application startup, before any Carmine commands are executed.

Does that make sense / help?

alolis commented 8 years ago

I will give it a go. It's hard to reproduce it, I have only seen it a couple of times but this definitely helps to trace it faster.

ptaoussanis commented 8 years ago

May be a race condition that triggers rarely. The error is definitely a clear one: Carmine's trying to read something that was written with a type id which hasn't yet been registered with extend-thaw; only way that error can occur. Good luck! :-)

ptaoussanis commented 8 years ago

Assuming this is resolved but please feel free to reopen if you're still having trouble.

alolis commented 8 years ago

I haven't solved it yet but no problem; i will re-open it if i have any further questions