question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cache directory not created exception

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
falzmcommented, 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

0reactions
brianhkscommented, Aug 3, 2015

No worries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeException: Unable to create the cache directory (/var ...
It looks like a file/directory permission problem. The directory has to be writeable by the webserver. After creating the directory you should adjust...
Read more >
Cache directory not created error - Google Groups
I get cache directory not created error and it only works after I delete /tmp/kairos_cache. ... ProvisionException: Guice provision errors:.
Read more >
How do I fix the errors “Unable to write in the cache directory ...
The following error just broke Matomo (v3.10.0): An exception has been thrown during the rendering of a template "Unable to write in the...
Read more >
'Unable to create the "cache" directory' Runtime Exception ...
I'm running composer and the install as apache. I get a bunch of “deprecated” messages from composer, but no errors. I get no...
Read more >
Fatal error: Uncaught exception 'RuntimeException' with ...
On some server configurations, WPML is not allowed to create a cache directory even though the permissions should allow to. This issue has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found