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

[Bug]: moving datahike-db folder to another location does not allow the db to start #726

Open
awb99 opened this issue Mar 6, 2025 · 1 comment
Labels
bug Something isn't working triage

Comments

@awb99
Copy link

awb99 commented Mar 6, 2025

What version of Datahike are you using?

0.6.1594

What version of Java are you using?

openjdk 21

What operating system are you using?

linux nix

What database EDN configuration are you using?

(def cfg {:store {:backend :file
:path (str data-path "datahike-db")}
:keep-history? false
:schema-flexibility :write ;default - strict value types need to be defined in advance.
})

Describe the bug

I recently have moved the location of where the datahike db is located on my server.
So I have changed :path in the setting.
And that lead to the db connection not being able to start.
To be fair, there was a message, that I could put in another setting to let it work, but this
is a very weird behavior. Why does the database care from which path it is being loaded?
I dont think there should be a setting for this. Our database is backuped to some storage,
and might be loaded to a new machine with a slightly different folder location. Why is this
a problem?

What is the expected behaviour?

Load DB from a folder specified.

How can the behaviour be reproduced?

create a db, which will create the folder.
then move the folder to a different location
then change the config to use the different folder.
the new connection will not work.

@awb99 awb99 added bug Something isn't working triage labels Mar 6, 2025
@whilo
Copy link
Member

whilo commented Mar 7, 2025

The configuration uniquely identifies a database in a memory system and the configuration check is there to make sure you are connecting to the intended database and not another one, potentially corrupting it with an incompatible configuration. It is maybe a bit too defensive, we could ignore the :store config settings completely for the check. I mostly put it there to make sure people do not corrupt their databases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants