Skip to content
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

Cache directory not created exception #152

Closed
FrEaKmAn opened this issue Feb 25, 2015 · 8 comments
Closed

Cache directory not created exception #152

FrEaKmAn opened this issue Feb 25, 2015 · 8 comments

Comments

@FrEaKmAn
Copy link

Hi

I have 0.9.4 installed. I checkout develop branch and run it. It fails to run and gives me the following error

15:39:31.992 [main] ERROR [Main.java:282] - Failed starting up services
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.lang.IllegalStateException: Cache directory not created
  at org.kairosdb.core.datastore.KairosDatastore.<init>(KairosDatastore.java:69)
  at org.kairosdb.core.CoreModule.configure(CoreModule.java:72)
  while locating org.kairosdb.core.datastore.KairosDatastore
    for parameter 1 at org.kairosdb.core.jobs.CacheFileCleaner.<init>(CacheFileCleaner.java:41)
  at org.kairosdb.core.CoreModule.configure(CoreModule.java:76)
  while locating org.kairosdb.core.jobs.CacheFileCleaner

1 error
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013) ~[guice-3.0.jar:na]
    at org.kairosdb.core.scheduler.KairosDBScheduler.start(KairosDBScheduler.java:68) ~[classes/:na]
    at org.kairosdb.core.Main.startServices(Main.java:389) ~[classes/:na]
    at org.kairosdb.core.Main.main(Main.java:272) ~[classes/:na]
Caused by: java.lang.IllegalStateException: Cache directory not created
    at com.google.common.base.Preconditions.checkState(Preconditions.java:149) ~[guava-14.0.jar:na]
    at org.kairosdb.core.datastore.KairosDatastore.setupCacheDirectory(KairosDatastore.java:98) ~[classes/:na]
    at org.kairosdb.core.datastore.KairosDatastore.<init>(KairosDatastore.java:77) ~[classes/:na]
    at org.kairosdb.core.datastore.KairosDatastore$$FastClassByGuice$$593c1111.newInstance(<generated>) ~[guice-3.0.jar:na]
    at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.Scopes$1$1.get(Scopes.java:65) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) ~[guice-3.0.jar:na]
    at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.Scopes$1$1.get(Scopes.java:65) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974) ~[guice-3.0.jar:na]
    ... 4 common frames omitted
15:39:31.997 [Thread-1] INFO  [Main.java:398] - Shutting down
15:39:32.001 [Thread-1] ERROR [Main.java:267] - Shutdown exception:
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.lang.IllegalStateException: Cache directory not created
  at org.kairosdb.core.datastore.KairosDatastore.<init>(KairosDatastore.java:69)
  at org.kairosdb.core.CoreModule.configure(CoreModule.java:72)
  while locating org.kairosdb.core.datastore.KairosDatastore

1 error
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013) ~[guice-3.0.jar:na]
    at org.kairosdb.core.Main.stopServices(Main.java:415) ~[classes/:na]
    at org.kairosdb.core.Main$3.run(Main.java:258) ~[classes/:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_72]
Caused by: java.lang.IllegalStateException: Cache directory not created
    at com.google.common.base.Preconditions.checkState(Preconditions.java:149) ~[guava-14.0.jar:na]
    at org.kairosdb.core.datastore.KairosDatastore.setupCacheDirectory(KairosDatastore.java:98) ~[classes/:na]
    at org.kairosdb.core.datastore.KairosDatastore.<init>(KairosDatastore.java:77) ~[classes/:na]
    at org.kairosdb.core.datastore.KairosDatastore$$FastClassByGuice$$593c1111.newInstance(<generated>) ~[guice-3.0.jar:na]
    at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031) ~[guice-3.0.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.Scopes$1$1.get(Scopes.java:65) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974) ~[guice-3.0.jar:na]
    ... 4 common frames omitted
0

Deleting the /tmp/kairos_cache solves the problem, but is this normal?

@brianhks
Copy link
Member

Iv'e seen this happen if Kairos was ran as root and then ran as another user it doesn't have access to the folder. Could this have been the case?

@FrEaKmAn
Copy link
Author

Yes, you are correct. Do you think it would be better to run KairosDB under a special user instead of root?

@brianhks
Copy link
Member

Yes we have an issue open to do just that.

@kabirbansod
Copy link

Hi, I am sorry I am reviving an old thread, but I get the same error and in my case a kairos_cache folder is not present in the /tmp/ directory..I am using kairos 0.9.4 with cassandra. I have changed the permissions of /tmp/ folder to user instead of root, still i get the same error.

@brianhks
Copy link
Member

brianhks commented Aug 1, 2015

And what happens if you use a different folder for the cache? Use something besides tmp use the users home folder.

@kabirbansod
Copy link

There was something in the settings that was trying to use SSL to establish connection with cassandra, and it was failing because i had not provisioned use of SSL, so i was getting that error, i am sorry. It is working fine now.

@brianhks
Copy link
Member

brianhks commented Aug 3, 2015

No worries.

@falzm
Copy link

falzm commented May 2, 2016

Hi

I just ran into a similar issue with the latest KairosDB version (1.1.1): despite having the kairosdb.query_cache.cache_dir set to /var/cache/kairosdb and running the kairosdb service with user kairosdb (at systemd service unit level), KairosDB still creates a directory in /tmp/kairosdb_cache.

Is the kairosdb.query_cache.cache_dir setting of any use in this case?

EDIT: actually it looks like KairosDB creates temporary directories in both kairosdb.query_cache.cache_dir and /tmp/kairosdb_cache...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants