![]() |
#1321 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
Tried that. Same result. Also, I am pretty sure my database files are good, as calibre content sever can run correctly using them.
I am guessing I missed some dependency, I can't think of anything else it could be. . |
![]() |
![]() |
![]() |
#1322 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
You should see "missed" dependancies in http://<IP>/ebooks/checkconfig.php
There where you see your error. Is that the only error? |
![]() |
![]() |
Advert | |
|
![]() |
#1323 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
There are no missed dependancies in the checkconfig page. Everything lists as OK except it can't read the database
|
![]() |
![]() |
![]() |
#1324 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
What version of PHP are you using? If it's very new there could be a problem.
Maybe you could try to reinstall cops, apache2 and all dependencies as a last possible solution. How did you copy the Calibre (what version on Win, OSX or Linux?) database files to your pi? Maybe first zip, then copy then unzip. I vaguely remember a problem with something like this once. Or it could be totally unrelated. Just trying to help another cops user. :-) |
![]() |
![]() |
![]() |
#1325 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
"What version of PHP are you using? If it's very new there could be a problem."
Well, I assume apt-get installs the newest, but I don't know what choice I would have "Maybe you could try to reinstall cops, apache2 and all dependencies as a last possible solution." I am starting to build a fresh OS install to test that. "How did you copy the Calibre (what version on Win, OSX or Linux?) database files to your pi?" Pi shares ext4 drive over AFP. Copied using Carbon Copy Cloner (differential copy - only changed files) from OS X 10.11.6. Calibre and Calibre content server run on the Pi with no problems, so I am guessing that the database files are fine. "Maybe first zip, then copy then unzip." I'll test that as well "I vaguely remember a problem with something like this once. Or it could be totally unrelated. Just trying to help another cops user. :-)" I REALLY appreciate your helping out. I had it working (come to think, with this exact database) when I had the Pi running Owncloud. sadly, the Owncloud client on the Mac turned out to be a disaster (runaway process in the background would prevent sync and eventually crash) I'll report back later on the test build |
![]() |
![]() |
Advert | |
|
![]() |
#1326 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
So, here is the exact problem:
COPS cannot read from a database that lives on a ext4 formatted drive, automounted by the system. If I copy the exact same file to a Exfat drive it works fine. ExFAT does not support permissions properly, So I havn't been able to use that for the rest of the build. So, how to figure out exactly what error is happening so it can be fixed. There must be a log file somewhere |
![]() |
![]() |
![]() |
#1327 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
apache error log:
[Fri Sep 02 09:34:20.388748 2016] [:error] [pid 658] [client 10.0.1.17:50453] PHP Fatal error: Uncaught exception 'Exception' with message 'Database <> not found.' in /var/www/html/ebooks/base.php:1257\nStack trace:\n#0 /var/www/html/ebooks/base.php(1272): Base::error(NULL)\n#1 /var/www/html/ebooks/base.php(1285): Base::getDb()\n#2 /var/www/html/ebooks/index.php(37): Base::checkDatabaseAvailability()\n#3 {main}\n thrown in /var/www/html/ebooks/base.php on line 1257 |
![]() |
![]() |
![]() |
#1328 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
I have also verified that permissions (including ACLs) are exactly the same between the ext4 and exfat versions
|
![]() |
![]() |
![]() |
#1329 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
The HDD attached to my Pi with my ebook collection (with database files) is ext4 formatted and it works without problems. So in my opinion ext4 (alone) is not the problem.
Copying with CCC makes a 100% exact copy. But a copy from mac HFS+ to ext4 cannot be 100% exact. Why not try just rsync without exact file permissions, you can set them on your Pi later (that's what I do). Or copy using smb/samba. Also works ok from mac to pi (linux). |
![]() |
![]() |
![]() |
#1330 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
"Copying with CCC makes a 100% exact copy. But a copy from mac HFS+ to ext4 cannot be 100% exact.
Why not try just rsync without exact file permissions, you can set them on your Pi later (that's what I do)." all that is a good point, but... I've installed Calibre on the Pi, created a new database, cp'ed to both the exfat drive and ext4 drive (/media/pi/MEDIA/calibre_ebooks vs. /media/PNY128/calibre_ebooks. MEDIA is ext4 and PNY128 is exfat) and it works on one and not the other. I suspect it has something to do with how the drive is mounted. I am letting it automount, as I have not been successful in any of the other ways of mounting at startup. I suspect a timing issue, I am trying to mount a spinning drive, not a USB stick. May I ask: is your Pi running headless? Does it boot to command line or GUI? How, specifically are you getting the drive to mount at boot time? (or do you?) "Why not try just rsync without exact file permissions, you can set them on your Pi later (that's what I do)."" I could do that, but CCC is just easier. and should work. I don't think this is a file level permission problem, as evidenced above. I appreciate your help, it feels like I am getting somewhere. It helps to know it's working on your end, and that I am close to the right path. "Or copy using smb/samba. Also works ok from mac to pi (linux)." I have tried several times to get Samba working and have not been successful. If you have a set of instructions that worked, I'd appreciate a link. |
![]() |
![]() |
![]() |
#1331 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
With creating the new database on your pi and the resulting error I think you are right: it has to do with how the hard drive is mounted.
Maybe try to mount the hard drive manually and see what happens. I either "boot" from the hard drive (via SD-card) with a rather old method. So I do not need to mount it. It's my / drive. If and when I mount an additional drive I do it manually. When I'm behind a PC/Mac I will put together some instructions about Samba. |
![]() |
![]() |
![]() |
#1332 |
Member
![]() Posts: 13
Karma: 10
Join Date: Oct 2003
Device: Palm Tungsten T
|
SOLVED (I hope)
I *think* I have it working.
Instead of letting the drive automount (which can only be prevented by *NOT* booting to the GUI), I mount is using an entry in my /etc/rc.local ( sudo mount -t ext4 LABEL=MEDIA /media/storage ) AND a delay in /boot/cmdline.txt ( rootdelay=10 ) Using fstab may be better, but I have not hit upon the correct syntax yet With the exact same drive mounted this way, COPS can read the database. So, for those who find this while tearing their hair out: DO NOT let your ext4 drive automount by booting to the GUI. For whatever reason, this messes up COPS |
![]() |
![]() |
![]() |
#1333 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Great! I hope it works an keeps on working
![]() Better a good hack than a regular procedure that does not work. Google told me that if you automount an external (USB) drive the drive is not actually mounted until it is used. Perhaps cops wants to use it and it takes to long to respond, so "file not found". I use my pi (and linux computers) 99.9% headless. I never encountered this problem. I learn something new every day ![]() I will write up something short about samba tomorrow (it approaches midnight over here). Promise! |
![]() |
![]() |
![]() |
#1334 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
@dscottf - Something short about Samba (for on your Pi)
1 - install Samba (it is probably already installed) apt-get install samba 2 - edit smb.conf file cd /etc/samba cp smb.conf smb.conf.original nano smb.conf >> change contents to (works for me) Code:
#======================= Global Settings =============
[global]
workgroup = WORKGROUP
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = user
encrypt passwords = true
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
[Home]
comment = Home Directory
valid users = pi
path=/home/pi
create mask = 777
directory mask = 777
browseable = yes
writable = yes
read only = no
[cops]
comment = cops ebooks
valid users = pi
path=/media/pi/MEDIA/calibre_ebooks
create mask = 777
directory mask = 777
browseable = yes
writable = yes
read only = no
smbpasswd -a pi 4 - restart samba service samba restart 5 - login to samba share from OSX (top Menu) Go >> Connect to server >> smb://<IP_of_your_pi> Connect 6 - fill in credentials = pi and password you just added 7 - success? I do not say it's the best config file, but it works for me! |
![]() |
![]() |
![]() |
#1335 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Sep 2016
Device: Kobo Aura H2O
|
Help Needed
Ok, I'm raising the white flag here, and I throw myself at the mercy of the community.
I'm pretty new to PHP/Apache/Web Servers, and I think I probably understand about half of the concepts. I am trying to get COPS running on my Netgear ReadyNAS, and I think I'm very close! So far, I have done the following: 1. Created a folder on the NAS for a web server with appropriate permissions...the folder is called "website", and I have verified that I can read basic stuff out of it (e.g., an index.html file) by using a custom domain - that is, port forwarding, etc. is all set up correctly as far as I can tell 2. Installed PHP on the root of the NAS using "apt-get install libapache2-mod-php5" (although I have no idea if this was necessary, or if this was even the right place to install PHP) 3. Ran the additional commands listed on the COPS website, "apt-get install php5-gd php5-sqlite php5-json php5-intl" 4. Put the contents of the COPS zip file (unzipped) in a folder on my web server (i.e., in the "website" folder), and modified "config_local.php" with the directory list of my calibre library 5. Now, all my COPS stuff is in a folder called "cops" inside my web server folder called "website". If I go to www.customdomain.com/website, the url resolves correctly. However, if I try www.customdomain.com/website/cops, or www.customdomain.com/website/cops/feed.php, I get a 403 error stating that I don't have permission to access the directory. Interestingly, if I take all of the COPS stuff out of the "cops" folder, www.customdomain.com/website/cops resolves just fine. It's only when I put all of the php stuff in there that it breaks. Is there a smoking gun in all of this that someone more knowledgeable than me can recognize? I suspect one of the php files in my "cops" folder is not able to see my PHP installation correctly, or something like that, but I really have no idea. I have SSH access to my NAS as well, if that is helpful. I feel like I'm so close, but I don't know where to go from here. Last edited by KnnNike; 09-04-2016 at 04:15 PM. |
![]() |
![]() |
![]() |
Tags |
calibre opds, dns, kobo aura, synology |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre OPDS server with windows apps? | nickdma | Related Tools | 10 | 03-03-2024 02:53 PM |
[Old Thread] Android FBreader and Calibre OPDS server question | kalex | Calibre | 5 | 12-24-2015 10:16 PM |
PHP+Apache web server for calibre ... | chaley | Related Tools | 254 | 04-28-2014 08:18 PM |
External OPDS catalogue in Calibre | bolton | Calibre | 1 | 09-05-2012 06:14 AM |
Calibre Command Line usage with PHP | artoros | Related Tools | 13 | 07-01-2010 09:57 AM |