-
Notifications
You must be signed in to change notification settings - Fork 230
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
metadata.db not found #533
Comments
|
Fedora 40
Tried that. Made no difference.
That's what I'm using.
Did that as a symbolic link. No difference. Tried again but copying the directory (recursively). This time it doesn't give the metadata.db error, but the check still fails with: You've been redirected because COPS is not configured properly |
Some progress. To test: chmod 777 -R ./Books Refresh browser cache and try again. |
That did it, thanks. Does this mean that Books can't be outside the COPS tree? |
chmod 755 -R ./Books & refresh browser cache ./Books should be able to be outside ./cops Just play around with the SELinux settings, permissions and owners of the path /storage/Media/Books setenforce 0 This should work until the next (re)boot. If it does, then play around with the SELinux setting to give access to /storage/Media/Books and it's subdirectories. |
OK. I actually did have it working on the old version of COPS, using SElinux, but then did a fresh install and am trying to figure out what bits are missing. Still haven´t got Apache access working from outside my local net (all this has been on localhost:80), but thatś another issue. Thanks anyway. |
To make apache2 access from the WAN working (for IPv4):
I personally would not open port 80 or 443 to the www. |
Yes, I understand that. including LetsEncrypt, and I have a domain already. I just need to go over all the details and make sure the firewall settings are correct. |
Happy reading! Don't forget to set this in config_local.php
|
Didn't know about that, thanks. |
Then I would have to announce those ports to my users, so not sure what good it would do. I already have access control and fail2ban. |
If you have users, then port 80 and 443 will have to do. Just test your security. |
I'm afraid I still don't have this working. I continue to get the 'metadata.db not found' error, despite the file clearly existing, the config_local script pointing to the right place (including the terminating '/') and the permissions aligned (execute and read on every element of the path). FollowSymLinks is on by default. Turning SElinux off makes no difference, so that isn't it. I've tried accessing the file as the Apache user using 'sudo', and it's accessible. It would help if there were a debugging option saying exactly what the access error is, but there doesn't appear to be. |
Back to basics then:
What is the exact error given by cops/checkconfig.php ? |
Yes. Tested from the command-line on with both the /storage location and with /var/www/html/Books
I assume you mean /var/www/html/Books. If not, please clarify.
Makes no difference.
Off.
Just the one pointing to my server, which is very simple.
When the db is in /storage/... I get "metadata.db not found". When I put the db in /var/www/html/Books, I no longer get that (this is a change), but the config test still says: You've been redirected because COPS is not configured properly I installed COPS from Git. I didn't realise it mattered. One more thing: if I run "php config_local.php" from the command line, it says:
Please check_ This is after restarting Apache. Nevertheless, the web GUI still says it can find metadata.db but there is a database error. |
After some troubles*) installing fedora server 40 (command line only) in virtualbox, installing apache (httpd) and php (and the php packages for COPS) I installed COPS from the zip file in /var/www/html/cops And it works. *) to make apache2 (httpd) work I had to enable and start apache SELINUX set to "disabled" in /etc/sysconfig/selinux edit: I opened the firewall as well (do not know if it's needed, but it can't hurt). |
I moved the library to /var/www/html/cops/Books but no difference. (you can combine those two apache commands into one: systemctl -now start httpd) Did you create an 'apache' user? What user owns the /var/www/html/cops directory? This is the full output of the config test: _You've been redirected because COPS is not configured properly SCRIPT_NAME: /checkconfig.php I'm going to try again but installing from the zip file. Can;t think of anything else to do. |
Hmmmmmmm........ I do not see much wrong here. I did not create an apache user, the install script should do that (in debian) What is your documentroot? Cops installed in /var/www/html/cops Differences I see with my output (in debian)
I installed apache2 like this (but you probably did the same...): |
I've wiped everything and am starting again. My DocumentRoot is /var/www/html. To clarify, you unzipped the cops zip file directly into /var/www/html/cops? Note that my .../html directory is currently empty, i.e. I have no other web content, not even an index.html file. |
I made a directory somewhere in /home/user/ made directory Books in /var/www/html/cops $config['calibre_directory'] = './Books/'; Put an index.html file in /var/www/html so you know the apache2 (httpd) server is working. |
Make sure you clean all browser caches before browsing to http://localhost/cops If I do not do that, I sometimes get "strange/unexpected" results, not only with cops. |
OK, I did all that and it works for localhost. I don't know why it didn't work before. However I still have the original issue: it doesn't work when Books is not under /var/www/html/cops, or when it's a symlink to somewhere outside the tree (even with SElinux turned off). It does work when it's a symlink to a directory within the tree. So it looks like the problem isn't with the symlink per se but with the location of the Books directory. |
At least a partial success! In debian I can place the calibre library wherever I want, with or without a symlink, except in a /home/user directory. (apparmor prevents that = like SELinux). Maybe this link provides a solution? |
If I set SELINUX=disabled in /etc/selinux/config (and reboot) I can place a calibre directory in /storage/Books Placing a directory in /home/fedora/Books does NOT work (for me) It in my opinion it all comes down to SELinux. It's way to strict and complicated (for me) to set-up and use in a simple LAN environment. With SELINUX=enforcing in /etc/selinux/config and sudo setenforce 0 COPS works for me. |
As I said, turning off SElinux (setenforcing 0) makes no difference, so it's hard to see how it can be an SElinux issue. I'll look over that link you sent anyway. |
Just a quick update: I still don't know why symlinks won't work, but I've worked around the problem by using a bind mount of the out-of tree directory. I've also made it read-only for safety. This seems to work, touch wood: mount -o bind,ro /storage/Media/Books Books PS Possibly my issue is caused by the "Directory" blocks in /etc/httpd/conf/httpd.conf which control access to parts of the filesystem, but this hasn't changed since my previous working system so it seems unlikely. |
Thank you for your update. A symlink should work, but lately I also use "mount bind" more and more. Usually they just work. |
For future reference, when your Calibre library is outside the web directory, it's always worth checking if your PHP installation has "open_basedir" restrictions configured or not: https://www.php.net/manual/en/ini.core.php#ini.open-basedir |
Looks like that's it. in /etc/php.ini I find: open_basedir = /var/www I assume that must be a recent change in the default setup, since I've never touched any PHP config settings. I'll try turning it off as a test, but may just leave it set since I've worked round the problem with a bind mount. Good call, thanks. It might be worth adding something about this to the COPS README file. |
Interesting. I've no idea how this could have happened, but 'rpm -V php-common' says the file has been modified, so I guess I must have done it at one point. |
I know this is a FAQ, but I've checked:
File /storage/Media/Books/metadata.db not found, Please check
ls -lZ /storage/Media/Books/metadata.db
-rw-r--r--. 1 poc poc unconfined_u:object_r:unlabeled_t:s0 4128768 Aug 6 11:58 /storage/Media/Books/metadata.db
Suggestions welcome.
The text was updated successfully, but these errors were encountered: