Closed Reizar closed 2 months ago
Hey @Reizar,
Did you do any kind of updates to your caching infrastructure?
Or maybe a ruby upgrade? Maybe the Marshal
class changed somehow?
Another thing I can think of is an HTTParty
upgrade?
I'm don't think this should just malfunction like this all of the sudden.
Please try to confirm that the response
is the thing that can't be marshalled and cached.
def cache_response(response: nil, time: CACHE_TIME)
response = normalize_response response
response.merge!(
expiry: time,
fetched_at: Time.now,
**payload
).stringify_keys!
cache_store.write(self.class.cache_key,
response, # check to see if the stacktrace points to this line
expires_in: time
)
response
end
I don't want you to run with an un-cached license check so I want to fix this ASAP.
Hi @adrianthedev,
Changed out the code and the stacktrace pointed to this line:
cache_store.write(self.class.cache_key,
.
However, I tried changing the self.class.cache_key variable used with the hardcoded string: "avo.hq-3-7-4.response" and the error still happened.
I did lots of experimenting, and the issue goes away if I call .deep_dup
on the response hash. Tried inspecting and it looks to just be a regular hash, can't find any reason why it should be treated as a singleton.
Haven't changed out caching infrastructure, we don't really cache at the moment, so its still just configured as ActiveSupport::Cache::MemoryStore. Haven't changed out ruby version either. Could potentially be an upgrade of HTTParty though.
Thanks
This issue has been marked as stale because there was no activity for the past 15 days.
@Reizar can you try to update rails? Maybe there's something wrong with 7.0.8...
This issue has been marked as stale because there was no activity for the past 15 days.
Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️
Describe the bug
Avo throws a 500 error whenever any page is accessed. There's an issue with the license check logic from what I can tell.
See the following stack trace:
Steps to Reproduce
Steps to reproduce the behavior:
Expected behavior & Actual behavior
Expected behaviour is that avo should load, instead I can't load anything.
Models and resource files
System configuration
Avo version: 3.7.4
Rails version: 7.0.8
Ruby version: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin22]
License type:
Are you using Avo monkey patches, overriding views or view components?
Screenshots or screen recordings
Additional context
I have managed to add a temporary fix for now, by monkey patching the
Avo::Licensing::HQ
class and changing thecache_response
method to this:So its not hugely impacting me, but this does mean that the response is not cached and I'm constantly pinging the license check server which slows things down.
This is the output when I inspect the response
Impact
Urgency