lmenezes / cerebro

MIT License
5.54k stars 716 forks source link

unknown error #560

Open zack542 opened 2 years ago

zack542 commented 2 years ago

Error: [root@iZ2vc9fgpvelaja4lwmsh8Z cerebro-0.9.4]# bin/cerebro Oops, cannot start the server. com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Unable to load cache item at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2051) at com.google.common.cache.LocalCache.get(LocalCache.java:3951) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964) at com.google.inject.internal.FailableCache.get(FailableCache.java:54) at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49) at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:155) at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:592) at com.google.inject.internal.AbstractBindingProcessor$Processor.initializeBinding(AbstractBindingProcessor.java:173) at com.google.inject.internal.AbstractBindingProcessor$Processor.lambda$scheduleInitialization$0(AbstractBindingProcessor.java:160) at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:49) at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:124) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:108) at com.google.inject.Guice.createInjector(Guice.java:87) at com.google.inject.Guice.createInjector(Guice.java:78) at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:200) at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:155) at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21) at play.core.server.ProdServerStart$.start(ProdServerStart.scala:54) at play.core.server.ProdServerStart$.main(ProdServerStart.scala:30) at play.core.server.ProdServerStart.main(ProdServerStart.scala) Caused by: java.lang.IllegalStateException: Unable to load cache item at com.google.inject.internal.cglib.core.internal.$LoadingCache.createEntry(LoadingCache.java:79) at com.google.inject.internal.cglib.core.internal.$LoadingCache.get(LoadingCache.java:34) at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:119) at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:294) at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:65) at com.google.inject.internal.BytecodeGen.newFastClassForMember(BytecodeGen.java:258) at com.google.inject.internal.BytecodeGen.newFastClassForMember(BytecodeGen.java:207) at com.google.inject.internal.DefaultConstructionProxyFactory.create(DefaultConstructionProxyFactory.java:49) at com.google.inject.internal.ProxyFactory.create(ProxyFactory.java:156) at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:94) at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:30) at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:38) at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:34) at com.google.inject.internal.FailableCache$1.load(FailableCache.java:43) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045) ... 21 more Caused by: java.lang.ExceptionInInitializerError at com.google.inject.internal.cglib.core.$DuplicatesPredicate.evaluate(DuplicatesPredicate.java:104) at com.google.inject.internal.cglib.core.$CollectionUtils.filter(CollectionUtils.java:52) at com.google.inject.internal.cglib.reflect.$FastClassEmitter.<init>(FastClassEmitter.java:69) at com.google.inject.internal.cglib.reflect.$FastClass$Generator.generateClass(FastClass.java:77) at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at com.google.inject.internal.cglib.core.$AbstractClassGenerator.generate(AbstractClassGenerator.java:332) at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:96) at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:94) at com.google.inject.internal.cglib.core.internal.$LoadingCache$2.call(LoadingCache.java:54) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at com.google.inject.internal.cglib.core.internal.$LoadingCache.createEntry(LoadingCache.java:61) ... 38 more Caused by: com.google.inject.internal.cglib.core.$CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @774bd0a2 at com.google.inject.internal.cglib.core.$ReflectUtils.defineClass(ReflectUtils.java:464) at com.google.inject.internal.cglib.core.$AbstractClassGenerator.generate(AbstractClassGenerator.java:339) at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:96) at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:94) at com.google.inject.internal.cglib.core.internal.$LoadingCache$2.call(LoadingCache.java:54) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at com.google.inject.internal.cglib.core.internal.$LoadingCache.createEntry(LoadingCache.java:61) at com.google.inject.internal.cglib.core.internal.$LoadingCache.get(LoadingCache.java:34) at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:119) at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:294) at com.google.inject.internal.cglib.core.$KeyFactory$Generator.create(KeyFactory.java:221) at com.google.inject.internal.cglib.core.$KeyFactory.create(KeyFactory.java:174) at com.google.inject.internal.cglib.core.$KeyFactory.create(KeyFactory.java:157) at com.google.inject.internal.cglib.core.$KeyFactory.create(KeyFactory.java:149) at com.google.inject.internal.cglib.core.$KeyFactory.create(KeyFactory.java:145) at com.google.inject.internal.cglib.core.$MethodWrapper.<clinit>(MethodWrapper.java:23) ... 49 more Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @774bd0a2 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:200) at java.base/java.lang.reflect.Method.setAccessible(Method.java:194) at com.google.inject.internal.cglib.core.$ReflectUtils$1.run(ReflectUtils.java:61) at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) at com.google.inject.internal.cglib.core.$ReflectUtils.<clinit>(ReflectUtils.java:52) at com.google.inject.internal.cglib.reflect.$FastClassEmitter.<init>(FastClassEmitter.java:67) ... 46 more [root@iZ2vc9fgpvelaja4lwmsh8Z cerebro-0.9.4]#

my config:

# Secret will be used to sign session cookies, CSRF tokens and for other encryption utilities.
# It is highly recommended to change this value before running cerebro in production.
secret = "ki:s:[[@=Ag?QI`W2jMwkY:eqvrJ]JqoJyi2axj3ZvOv^/KavOT4ViJSv?6YY4[N"

# Application base path
basePath = "/"

# Defaults to RUNNING_PID at the root directory of the app.
# To avoid creating a PID file set this value to /dev/null
#pidfile.path = "/var/run/cerebro.pid"
pidfile.path=/dev/null

# Rest request history max size per user
rest.history.size = 50 // defaults to 50 if not specified

# Path of local database file
#data.path: "/var/lib/cerebro/cerebro.db"
data.path = "./cerebro.db"

play {
  # Cerebro port, by default it's 9000 (play's default)
  server.http.port = ${?CEREBRO_PORT}
}

es = {
  gzip = true
}

# Authentication
auth = {
  # either basic or ldap
  type: ${?AUTH_TYPE}
  settings {
    # LDAP
    url = ${?LDAP_URL}
    # OpenLDAP might be something like "ou=People,dc=domain,dc=com"
    base-dn = ${?LDAP_BASE_DN}
    # Usually method should  be "simple" otherwise, set it to the SASL mechanisms to try
    method = ${?LDAP_METHOD}
    # user-template executes a string.format() operation where
    # username is passed in first, followed by base-dn. Some examples
    #  - %s => leave user untouched
    #  - %s@domain.com => append "@domain.com" to username
    #  - uid=%s,%s => usual case of OpenLDAP
    user-template = ${?LDAP_USER_TEMPLATE}
    // User identifier that can perform searches
    bind-dn = ${?LDAP_BIND_DN}
    bind-pw = ${?LDAP_BIND_PWD}
    group-search {
      // If left unset parent's base-dn will be used
      base-dn = ${?LDAP_GROUP_BASE_DN}
      // Attribute that represent the user, for example uid or mail
      user-attr = ${?LDAP_USER_ATTR}
      // Define a separate template for user-attr
      // If left unset parent's user-template will be used
      user-attr-template = ${?LDAP_USER_ATTR_TEMPLATE}
      // Filter that tests membership of the group. If this property is empty then there is no group membership check
      // AD example => memberOf=CN=mygroup,ou=ouofthegroup,DC=domain,DC=com
      // OpenLDAP example => CN=mygroup
      group = ${?LDAP_GROUP}
    }

    # Basic auth
    username = ${?BASIC_AUTH_USER}
    password = ${?BASIC_AUTH_PWD}
  }
}

# A list of known hosts
hosts = [
  #{
  #  host = "http://localhost:9200"
  #  name = "Localhost cluster"
  #  headers-whitelist = [ "x-proxy-user", "x-proxy-roles", "X-Forwarded-For" ]
  #}
  # Example of host with authentication
  #{
  #  host = "http://some-authenticated-host:9200"
  #  name = "Secured Cluster"
  #  auth = {
  #    username = "username"
  #    password = "secret-password"
  #  }
  #}
]

All my steps:

  1. wget https://github.com//lmenezes/cerebro/releases/download/v0.9.4/cerebro-0.9.4.tgz
  2. tar xvf cerebro-0.9.4.tgz
  3. cd xvf cerebro-0.9.4
  4. ./bin/cerebro

jdk: [root@iZ2vc9fgpvelaja4lwmsh8Z conf]# java -version java version "18.0.1.1" 2022-04-22 Java(TM) SE Runtime Environment (build 18.0.1.1+2-6) Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing) [root@iZ2vc9fgpvelaja4lwmsh8Z conf]#

Who can tell me why? I'm going crazy

lazki commented 2 years ago

Same here on Debian 11.

~/cerebro-0.9.4#  java -version
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.2+8-Debian-1deb11u1, mixed mode, sharing)
liangxiong3403 commented 2 years ago

Maybe your java environment can't be Compatible with cerebro; you can use docker image to avoid it: docker pull lmenezes/cerebro:0.9.4