Skip to content

FileCacheProvider - exception about invalid Manifest #303

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

Open
BAKAOLC opened this issue Jan 6, 2025 · 1 comment
Open

FileCacheProvider - exception about invalid Manifest #303

BAKAOLC opened this issue Jan 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@BAKAOLC
Copy link

BAKAOLC commented Jan 6, 2025

What does the bug do?

I know there was a time when we had the same problem (#264), but I still have this problem.

If there is no cache at the time of saving the manifest, attempting to add and access the cache will result in an exception:

System.NullReferenceException: Object reference not set to an instance of an object.
    at CacheTower.Providers.FileSystem.FileCacheLayer.GetAsync[T](String cacheKey) in /home/runner/work/CacheTower/CacheTower/src/CacheTower/Providers/FileSystem/FileCacheLayer.cs:line 211
    at CacheTower.CacheStack.GetAsync[T](String cacheKey) in /home/runner/work/CacheTower/CacheTower/src/CacheTower/CacheStack.cs:line 215

How can it be reproduced?

builder.AddFileCacheLayer(new("cache", new NewtonsoftJsonCacheSerializer(new()),
    TimeSpan.FromMilliseconds(300000)));

This doesn't even need to go through a reboot for this to occur after a certain amount of time.

Environment:

  • Operating System: All (Windows, Mac and Linux)
  • .NET Version: 9.0.101
  • Nuget Package:
    • CacheTower 0.14.0
    • CacheTower.Providers.FileSystem.Json 0.14.0
    • CacheTower.Serializers.NewtonsoftJson 0.14.0
@BAKAOLC BAKAOLC added the bug Something isn't working label Jan 6, 2025
@Chasel-Li-WTG
Copy link

Chasel-Li-WTG commented Apr 15, 2025

I get same result, since it set "null" to manifest, it would throw this exception when I try to execute cache.SetAsync()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants