When first installing calibre-web, no valid metadata.db file will be created if there is non available. Instead, a 0byte file will be created that crashes calibre-web on future starts.
I'm not sure I understand. I just moved my app.db file out of the way so I'm essentially starting fresh, and after restarting the service and going to the URL, I'm directed to the configuration page.
Are you saying that if you put an invalid directory in "Location of Calibre database" input that it crashes? Because I can't recreate that, either (it gives me a "DB location is not valid, please enter correct path" error).
What I understand is that the app doesn't create a valid calibre database. The metadata.db file.
That is correct. Calibre web requires that you already have an existing calibre database in the path you set in the initial config form.
I was under the (apparently false) impression, that an empty metadata.db would be created if none existed. Currently it will throw 500 errors after specifying a directory without an existing metadata.db and on further starts it will refuse to start.
I guess this might be changed to a feature request then if its not intended for a metadata.db to be created if none exists.
I've not looked at what it would take to generate a valid metadata.db from scratch, but I would venture a guess that it's beyond the scope of this project. That's the guts of Calibre and reverse engineering that seems superfluous, when one can use Calibre to create it.
We'd be chasing Calibre constantly to make sure we're always in sync.
Calibre database is also a SQLite file and doesn't include any restrictions so it is "easy" but tedious to add all SQL statements to recreate the database.
I agree with you, @jkrehm, that this might be beyond the scope of the project.
Maybe the requirements list should be updated and state that a calibre database, or the calibre library folder, is required.
@jkrehm I think also it could not be a problem to include one empty metadata.db. If one of the developers has an active calibre installation just dum the schema from your own metadata into a new one. Like:
sqlite3 metadata.db .schema | sqlite3 /tmp/metadata.db
and add it to the repo.
I was going to point out that we'd still be stuck chasing every release of Calibre to make sure we stay compatible, but Calibre must have some sort of migration in place to update outdated database files, so maybe that is viable. We'd still want to check regularly to make sure our version is up-to-date with what Calibre creates, but it wouldn't be dire if we fall behind for a bit.
But the project must do this also, cause if you share your metadata.db with your calibre installation
it will be updated if you update your calibre on on of your desktops.
I appreciate all the thoughts and time you all put into this point. From my point of view it beyond the scope of this project to replicate all features of calibre and to create a compatible calibre database. Currently its not possible to generate custom columns from calibre-web (and is not planned for the future), so generating a "empty" metadata.db would limit users only to a subset of calibre.
@Kyosfonica The first sentence of the readme states:
Calibre Web ... using an existing Calibre database. This should be sufficient, from my point of view.
@jkrehm, @ruben-herold
The structure of the calibre database is stable since a few year and releases, but of course it could change at any time in the future without notice.
Sorry for open it again. I think there is a misunderstanding about our point of view.
Here our (@ruben-herold, @p-rintz) found this nice project an try to build a little installation for shareing books inside our company.
So we installed it on a fresh vm and write some ansible stuff for installation. Nobody here use calibre so it was for us nor possible to bring the installation online cause the missing metadata.db .
The only solution was to setup another Linux vm install calibre create an empty metadata.db and copy it to the calibre-web server. After this we could remove the installed vm for calibre.
So I think the project should include all files that are needed to bring the application online.
So please make it in the documentation more clearly and put an empty metadata.db into the project so that it people can use it if they want only use the webapp.
@OzzieIsaacs soory forgott you to mention so you will get it by mail. Please think about my Points.
Most helpful comment
Sorry for open it again. I think there is a misunderstanding about our point of view.
Here our (@ruben-herold, @p-rintz) found this nice project an try to build a little installation for shareing books inside our company.
So we installed it on a fresh vm and write some ansible stuff for installation. Nobody here use calibre so it was for us nor possible to bring the installation online cause the missing metadata.db .
The only solution was to setup another Linux vm install calibre create an empty metadata.db and copy it to the calibre-web server. After this we could remove the installed vm for calibre.
So I think the project should include all files that are needed to bring the application online.
So please make it in the documentation more clearly and put an empty metadata.db into the project so that it people can use it if they want only use the webapp.