History: I was able to get read/write to my local DynamoDB environment. I followed the AWS Documents for Downloading and Running DynamoDB [http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html]
Issue: I had an accidental power outage to my computer. Now, I get the following error after I launch the DynamoDB process
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
Error Message:
Aug 23, 2017 3:52:42 PM com.almworks.sqlite4java.Internal log
WARNING: [sqlite] SQLiteQueue[shared-local-instance.db]: stopped abnormally, reincarnating in 3000ms
Aug 23, 2017 3:52:45 PM com.almworks.sqlite4java.Internal log
WARNING: [sqlite] cannot open DB[2]: com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
Aug 23, 2017 3:52:45 PM com.almworks.sqlite4java.Internal log
SEVERE: [sqlite] SQLiteQueue[shared-local-instance.db]: error running job queue
com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1480)
at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:282)
at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:293)
at com.almworks.sqlite4java.SQLiteQueue.openConnection(SQLiteQueue.java:464)
at com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:641)
at com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623)
at com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77)
at com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205)
at java.lang.Thread.run(Thread.java:748)
Attempts: This post is the closest to my error but it involves not DynamoDB but some Cloud logs, etc. [https://forums.aws.amazon.com/thread.jspa?threadID=165134]
Any thoughts on how to rectify the database file?
You can run DynamoDB Offline on a different port by specifying -p option to the sls offline start command like so:
The problem (in my case) was that another application was using the port 8000 which dynamodb uses. Therefore, there was a conflict and the process couldn't start. This will give you further information.
When you're ready to deploy your application in production, you remove the local endpoint in the code, and then it points to the DynamoDB web service. Having this local version helps you save on throughput, data storage, and data transfer fees.
Java-based distribution of DynamoDB Local uses port 8000 by default. If it's not available, DynamoDB Local shouldn't even start. If it was started with custom port (like in Amplify's case ), you can run following command: And find a number supplied as -port. For example, in following result:
It could be a permission issue. try updating permissions.
sudo chown user dynamodb -R
chmod 775 -R dynamodb
It is indeed a permission issue as suggested by Zudhin https://stackoverflow.com/a/53132375/239613
In my case, I'm running Ubuntu and the quick and dirty solution I found is just changing the permissions of the local folder for the volume:
sudo chmod 777 ./docker/dynamodb
(provided that's your local folder after following https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html)
I had faced a similar error with Docker on Windows and the solution was to give 'System' all the permissions for the Docker Volume which persisted the DB Data
Quick solution was to reinstall everything.
rm -rf <unzipped DynamoDB Local folder>
Then, go back through the installation instructions. http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
I'm unfamiliar with jar files. Replacing them with new jar files is like reinstalling?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With