cops icon indicating copy to clipboard operation
cops copied to clipboard

Gray page

Open errecielle opened this issue 4 years ago • 71 comments

I have Cops installed on my web server but the only thing I see is a gray page. My server log reports these errors which, you will excuse me, I am absolutely unable to decipher. The metadata.db file is from Calibre 5.9. The PHP version is 7.4

17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: PHP Fatal error: Uncaught Error: Call to a member function fetchColumn() on bool in /web/htdocs/site_blank/home/cops/base.php:1295: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: Stack trace:: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: #0 /web/htdocs/site_blank/home/cops/base.php(1302): Base::executeQuerySingle(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: #1 /web/htdocs/site_blank/home/cops/author.php(43): Base::getCountGeneric(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: #2 /web/htdocs/site_blank/home/cops/base.php(613): Author::getCount(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: #3 /web/htdocs/site_blank/home/cops/JSON_renderer.php(192): Page->InitializeContent(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: #4 /web/htdocs/site_blank/home/cops/getJSON.php(16): JSONRenderer::getJson(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: #5 {main}: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:35 [error] [client ip_blank] - site_blank - AH01215: thrown in /web/htdocs/site_blank/home/cops/base.php on line 1295: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: PHP Fatal error: Uncaught Error: Call to a member function fetchColumn() on bool in /web/htdocs/site_blank/home/cops/base.php:1295: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: Stack trace:: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: #0 /web/htdocs/site_blank/home/cops/base.php(1302): Base::executeQuerySingle(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: #1 /web/htdocs/site_blank/home/cops/author.php(43): Base::getCountGeneric(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: #2 /web/htdocs/site_blank/home/cops/base.php(613): Author::getCount(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: #3 /web/htdocs/site_blank/home/cops/JSON_renderer.php(192): Page->InitializeContent(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: #4 /web/htdocs/site_blank/home/cops/getJSON.php(16): JSONRenderer::getJson(): /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: #5 {main}: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php
17/01/2021 14:54:30 [error] [client ip_blank] - site_blank - AH01215: thrown in /web/htdocs/site_blank/home/cops/base.php on line 1295: /web/htdocs/site_blank/home/cops/getJSON.php, referer http://site_blank/cops/index.php

Thank you for your help to solve this issue.

Regards

Roberto

errecielle avatar Jan 17 '21 14:01 errecielle

A grey screen is usually caused by an error in the settings in config_local.php

please post your config_local.php

NB: edit out your domain name and external IP from your post above. You do not want the whole world be able to access you webserver!

marioscube avatar Jan 17 '21 17:01 marioscube

First of all thank you... here the config_local.php

/*
 * The directory containing calibre's metadata.db file, with sub-directories
 * containing all the formats.
 * BEWARE : it has to end with a /
 */
$config['calibre_directory'] = '../files/libri/bibliotecadicalibre/';

/*
 * Catalog's title
 */
$config['cops_title_default'] = "RCL";

/*
 * use URL rewriting for downloading of ebook in HTML catalog
 * See README for more information
 *  1 : enable
 *  0 : disable
 */
$config['cops_use_url_rewriting'] = "1";

errecielle avatar Jan 17 '21 17:01 errecielle

Your config_local.php file should start with:

marioscube avatar Jan 17 '21 18:01 marioscube

That looks correct.

you could try the absolute path to the calibre library

http://........../cops/checkconfig.php gives no error?

marioscube avatar Jan 17 '21 18:01 marioscube

Immagine 2021-01-17 193525

All seems to be ok...

errecielle avatar Jan 17 '21 18:01 errecielle

Did you install a release zip or git pull?

use the zip.

php 7.4 should work.

Just for testing: Either install the calibre library in ../cops ( and adjust config_local.php ;-) )

or

chmod 777 your existing library to make sure permissions do not mess things up. You can always change it back to what it was.

marioscube avatar Jan 17 '21 18:01 marioscube

I've installed the release zip: cops-1.1.3.zip The library is very large so I've changed the permissions to the library directory and all the sub to 777 Also the metadata.db have 777 as permissions.

Thanx again for your time...

rcl

errecielle avatar Jan 17 '21 19:01 errecielle

10000 books should be no problem, even on a slow (not very old and slow) server. Memory could be a problem. Cops starts with reading the metadata.db in memory (In my experience).

marioscube avatar Jan 17 '21 19:01 marioscube

The books are around 4500 so this should not be a problem

errecielle avatar Jan 17 '21 19:01 errecielle

Sometimes if something does not work a reinstall and new setup of config files fixes the problem.

the error with the base.php file suggest that something with a php file does not work as it should. What? I do not know.

marioscube avatar Jan 17 '21 20:01 marioscube

😂 😂 😂 Ok. Tomortow I'll reinstall and keep you updated.

errecielle avatar Jan 17 '21 20:01 errecielle

Nope :-( I've reinstall from scratch, I've tried to move the calibre directory under /cops but nothing happens and the log errors are the same...

errecielle avatar Jan 18 '21 06:01 errecielle

What OS (Linux debian, ubuntu, centos, etc) do you use? And what webserver (if Apache I can try to help)?

Maybe I can recreate and test your setup in a VM.

Calibre 5.9 works (just tested), so not the problem.

marioscube avatar Jan 18 '21 10:01 marioscube

I'm using a server provided by a server farm here in Italy. Aruba. So I'm not able to answer this type of questions. It's an hosted solution.

I'll check with the provider.

Thank you again.

Roberto

Il giorno lun 18 gen 2021 alle ore 11:37 marioscube < [email protected]> ha scritto:

What OS (Linux debian, ubuntu, centos, etc) do you use? And what webserver (if Apache I can try to help)?

Maybe I can recreate and test your setup in a VM.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/seblucas/cops/issues/499#issuecomment-762156421, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD7SDPPROFO44EUSPW4GXDS2QFNDANCNFSM4WGETGXA .

errecielle avatar Jan 18 '21 21:01 errecielle

I did some testing (just for fun), but it did not solve your problem.

My findings are that it is NOT:

  • cops: it just works
  • CentOS: I tested with centOS 8 (your provider probably uses centOS 7, but I see no real problem there)
  • Apache: no problems
  • PHP: i tested with one version lower and one version higher than your setup, both no problem
  • Calibre version: I installed latest version and no problem there.

What could be the problem:

  • calibre database: can you make a small (2 or 3 books and no custom things) database with calibre and test that.
  • missing php extensions (should not be, because cops said it's ok). Make small file in the cops directory and name it test.php <?php phpinfo() ?> then, in your browser goto this file http://<>IP or URL>/cops/info.php maybe post the output in a file here.
  • error in the php_config.php file (but I saw no errors there).

marioscube avatar Jan 21 '21 14:01 marioscube

First of all thank you very much for your support Secondly I've tried this:

  • create a calibre database with 3 books. Same gray page
  • create a test.php file and opened in the browser: attached you can find the zip file with all the page (hopefully I've blanked all the ip number :-) )
  • I can confirm the checkconfig.php file shows no errors

In addition I've posted a question to the tech of the provider but I've little hope they answer this type of questions

PHP 7.4.10 - phpinfo().zip

errecielle avatar Jan 21 '21 16:01 errecielle

Aaahhrrrggg I should have thought of this earlier (I must be getting old and forgetfull). It's this #48 problem all over again with.centOS 7!

The calibre database made with Calibre 5 does not work with the php-sqlite3 version included in centOS 7. I think, based on their website, that Aruba uses centOS 7 as OS.

This thread in #487 gives a nice solution to your problem if you are comfortable with changing some of the COPS code. If not, let me know.

marioscube avatar Jan 21 '21 18:01 marioscube

If it's a simple CTRl-C - Ctrl-V, yes I'm able to do that.

// -------------------------------------------------------------------------------- // -- Fix for incompatibility older sqlite3 & Calibre v5 database format // true will create metadata.dbv4 and use that copy $config['sqlite_fix'] = true; $config['dumpfile'] = '/tmp/metadata.dump'; $config['sqlite3pgm'] = '/opt/bin/sqlite3'; // leave this false unless debugging is required with url /getJSON.php?complete=1 $config['sqlite_fix_debug'] = false;
// --------------------------------------------------------------------------------

But... where?

errecielle avatar Jan 21 '21 18:01 errecielle

See: https://github.com/jvanderzande/cops/commit/9abeffa462b3c72984931ac3e44300931f387767

The above part in config_local.php

The larger part in ../cops/lib/base.php

I have not tried this last iteration of this solution.

marioscube avatar Jan 21 '21 18:01 marioscube

we, you, are close, I feel it :-)

Now the error is in the path for the db: " File ../files/libri/calibre/metadata.dbv4 not found, Please check I've tried to modify the path in $config['dumpfile'] = '/tmp/metadata.dump'; because I don't have a tmp directory so I've put the same of the db but it seems not working

Il giorno gio 21 gen 2021 alle ore 19:32 marioscube < [email protected]> ha scritto:

See: https://github.com/jvanderzande/cops/commit/9abeffa462b3c72984931ac3e44300931f387767 http://url

The above part in config_local.php

The larger part in ../cops/lib/base.php

I have not tried this last iteration of this solution.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/seblucas/cops/issues/499#issuecomment-764851155, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD7SDOUSSC4YZVRKSAFJD3S3BXNPANCNFSM4WGETGXA .

errecielle avatar Jan 21 '21 19:01 errecielle

What worx for me:

1 - make e tmp directory in ../cops

2 - copy the config_local.php file in ../cops (or after evaluating my changes copy the changes to your config_local.php config_local.php.txt

3 - replace the existing ../cops/lib/Base.php (or rename first to Base.php.orig)with this Base.php Base.php.txt

4 - check if it works.

There is one problem with this fix. It only works if you use just one calibre library in COPS. I use multiple, so I do not use this fix.

marioscube avatar Jan 21 '21 23:01 marioscube

I checked your files with mine and I don't see any particular differences but some must be there because now I have this error message:

Check if Calibre database file contains at least some of the needed tablesNot all Calibre tables were found. Are you sure you're using the correct database. It actually created the .dbv4 file but created it empty. I also tried to move the calbre folder under /cops but the error remains the same.

I've checked the permissions and all 777 [image: Immagine 2021-01-22 075226.png]

Il giorno ven 22 gen 2021 alle ore 00:13 marioscube < [email protected]> ha scritto:

What worx for me:

1 - make e tmp directory in ../cops

2 - copy the config_local.php file in ../cops (or after evaluating my changes copy the changes to your config_local.php config_local.php.txt https://github.com/seblucas/cops/files/5852607/config_local.php.txt

3 - replace the existing ../cops/lib/Base.php (or rename first to Base.php.orig)with this Base.php Base.php.txt https://github.com/seblucas/cops/files/5852610/Base.php.txt

4 - check if it works.

There is one problem with this fix. It only works if you use just one calibre library in COPS. I use multiple, so I do not use this fix.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/seblucas/cops/issues/499#issuecomment-765001129, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD7SDIXFEPOXIDMJC5GP7LS3CYKXANCNFSM4WGETGXA .

errecielle avatar Jan 22 '21 06:01 errecielle

Is there a metadata.dump file in ../cops/tmp/ ?

marioscube avatar Jan 22 '21 07:01 marioscube

Yes. There is

[image: Immagine 2021-01-22 141748.png]

Il giorno ven 22 gen 2021 alle ore 08:24 marioscube < [email protected]> ha scritto:

Is there a metadata.dump file in ../cops/tmp/ ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/seblucas/cops/issues/499#issuecomment-765193781, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD7SDKL4SJ6KZ6T3YH3673S3ER2LANCNFSM4WGETGXA .

errecielle avatar Jan 22 '21 13:01 errecielle

The image does not work, but I believe you. Size of metadata.dump is > 0?

I will test again with my antique setup.

marioscube avatar Jan 22 '21 15:01 marioscube

Yes...

Immagine 2021-01-22 141748

errecielle avatar Jan 22 '21 15:01 errecielle

I don't know if this matters but the sizes of metadata.db and metadata.dump are different The first one is 405.504.

errecielle avatar Jan 22 '21 15:01 errecielle

That is ok. The size of metadata.dump seems a bit small though.....

You have tried to delete metadata.dump and metadata.dbv4 and then tried it again

marioscube avatar Jan 22 '21 15:01 marioscube

Yes, more or less five times switching the calibre folder up and down... I'll retry again now

Il giorno ven 22 gen 2021 alle ore 16:42 marioscube < [email protected]> ha scritto:

That is ok. The size of metadata.dump seems a bit small though.....

You have tried to delete metadata.dump and metadata.dbv4 and then tried it again

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/seblucas/cops/issues/499#issuecomment-765494590, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD7SDKQTWGRD3FH7AZMFHLS3GMFNANCNFSM4WGETGXA .

errecielle avatar Jan 22 '21 15:01 errecielle