-
Notifications
You must be signed in to change notification settings - Fork 33
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
'Command DEL does not exist' when using redis as cache #38
Comments
Can you provide an example that reproduces the issue? Cannot reproduce this myself |
Here is a minimal sample reproducing issue. Project created with micronaut launch, set micronaut version to 1.3.5, run vanilla redis in docker on localhost. Apparently, it trips over redis.caches. configuration. Perhaps it's some typo I can't see. package com.foo
import io.micronaut.cache.annotation.Cacheable
import io.micronaut.http.annotation.Controller
import io.micronaut.http.annotation.Get
import io.micronaut.runtime.Micronaut
import io.micronaut.scheduling.annotation.Scheduled
import javax.annotation.security.PermitAll
import javax.inject.Singleton
import kotlin.random.Random
@Singleton
open class FooService {
@Cacheable("my-cache")
open fun foo(): Int {
return Random.nextInt()
}
@Scheduled(fixedDelay = "60s", initialDelay = "1s")
open fun autoFail() {
// Comment out line bellow to get it to work
foo()
}
}
@Controller("/api/foo")
@PermitAll
open class FooController(val foo: FooService) {
@Get
fun fail() = foo.foo()
}
fun main() {
Micronaut.build()
.packages("com.foo")
.mainClass(FooService::class.java)
.start()
} micronaut:
application:
name: redisfail
redis:
uri: redis://localhost
# Comment out 'caches' section to get it to work
caches:
my-cache:
# expire one hour after write
expire-after-write: 1h |
Had the same issue (using Micronaut 1.3.4, Lettuce 1.2.0), but it was resolved when using Redis docker image |
I can confirm that using redis:5.0.6-alpine image works, while newer versions don't. Haven't find anything similiar in lettuce issue tracker. Perhaps some command (DEL?) definitions changed in redis 5.0.6+. |
Thanks that is useful information in helping us track this issue down. |
Can you test the 2.3.1 version to see if the issue is resolved for you? |
Attached a ZIP file with a micronaut1.3.4 which reproduces the issue and a Micronaut 2.0 which does not exhibit the issue. I used redis 6.0.5 for both. |
Micronaut 1.3.5
Micronaut redis lettuce 2.0.0
When starting up application with @Cacheable annotated methods and redis cache configuration, following exception happens:
The text was updated successfully, but these errors were encountered: