Fauna Dev data is corrupted when machine shuts down

I’m running fauna locally as explained in the docs executing this docker command:

$ docker run -d --name faunadb -p 8443:8443 -p 8084:8084 -v /Users/alfon/fauna/data:/var/lib/faunadb -v /Users/alfon/fauna/log:/var/log/faunadb fauna/faunadb

And the problem is that if I forget to stop the container before I shutdown my Macbook it gets corrupted and the next I time I try to use it again it fails with this error forcing me to delete everything and start from scratch (wasting my time and giving me a terrible bad developer experience using fauna):

** jamm will use sun.misc.Unsafe to compute the size of objects on heap.
** This is not safe and results in wrong assumptions of the free/occupied Java
** heap and potentially in OOMs. The implementation performs arithmetics on the
**  "cookies" returned by Unsafe.objectFieldOffset(), althought the Javadoc says:
** "Do not expect to perform any sort of arithmetic on this offset; 
** it is just a cookie which is passed to the unsafe heap memory accessors."
** The implementation does not always consider Java object layouts in under
** all circumstances for all JVMs.
** Solutions:
** - Use a JDK/JVM with JEP-8249196
** - Load jamm as an agent into the JVM
Deprecated configuration setting `accelerate_indexes`. Will be ignored.
FaunaDB Enterprise Edition 21.09.01-fbf88b9
Loaded configuration from /etc/faunadb.yml...
Trace sampling enabled without exporters?
Feature Flags disabled.
Network Host ID:
Cluster name: fauna
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Identified as b942a825-2bb7-4194-b5f6-810304a804cb at
Data path: /var/lib/faunadb
Temp path: /var/lib/faunadb/tmp
Snapshot path: /var/lib/faunadb/snapshots
Admin endpoint:
API endpoint:
API(plain) endpoint:
Replica name: NoDC
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.

New fauna version available 4.2.0 -> 1.5.3-SNAPSHOT
Changelog: https://github.com/fauna/faunadb-jvm/blob/main/CHANGELOG.txt
HTTP Server started at port 8084.
FaunaDB is ready.
2021-11-14T18:19:16.059318Z ERROR - time out: Read timed out. (Timed out waiting for appliedTimestamp for key 6(314810182656852480) to reach 2021-11-14T18:19:10.818Z)
faunadb.errors.UnavailableException: time out: Read timed out. (Timed out waiting for appliedTimestamp for key 6(314810182656852480) to reach 2021-11-14T18:19:10.818Z)
	at faunadb.FaunaClient.$anonfun$handleErrorResponse$13(FaunaClient.scala:406)
	at faunadb.FaunaClient.$anonfun$handleErrorResponse$6(FaunaClient.scala:394)
	at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
	at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Any solution for this? :frowning_face:

Used Docker image version: fauna/faunadb:4.3.0
My machine info:

I’m so tired of Docker Desktop that I decided a few hours ago to switch to Podman. Now on Podman everything is working fine.

More info at: How to replace Docker with Podman on a Mac

1 Like

Hi @alfonmga,

Glad you got things working with Podman. Another option would be a custom .plist to be run at shutdown. You can do this with the launchd process in MacOS. More information about launchd is available at the Apple Support site.


1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.