calibre server not working behind proxy

Bug #1699872 reported by KennyA
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
calibre
New
Undecided
Unassigned

Bug Description

After updating to Calibre 3.0.0, the new calibre-server component is no longer working behind my apache proxy.

Here is the command I'm using to start the server:
/opt/calibre/bin/calibre-server --url-prefix /books --port=8085 --daemonize --log=/home/kenny/calibre-log.txt --userdb /home/kenny/calibre-auth/users.sqlite --enable-auth /home/kenny/Calibre/

And here is the message that shows up in my browser:
Failed to communicate with "interface-data/books-init?library_id=Calibre&sort=timestamp.desc&1498158240926", with status: [404] Not Found

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 404 Not Found
Not Found
The requested URL /interface-data/books-init was not found on this serv

Here is the output from my calibre-log.txt:
Unhandled exception in state: State: _job_done Client: 127.0.0.1:52440 Request: GET /books/interface-data/init?1498156900307 HTTP/1.0
Traceback (most recent call last):
  File "site-packages/calibre/srv/loop.py", line 518, in tick
  File "site-packages/calibre/srv/loop.py", line 278, in _job_done
  File "site-packages/calibre/srv/pool.py", line 35, in run
  File "site-packages/calibre/srv/http_response.py", line 439, in run_request_handler
  File "site-packages/calibre/srv/routes.py", line 306, in dispatch
  File "site-packages/calibre/srv/code.py", line 236, in interface_data
  File "site-packages/calibre/srv/code.py", line 77, in get_basic_query_data
  File "site-packages/calibre/srv/utils.py", line 475, in get_library_data
  File "site-packages/calibre/srv/utils.py", line 462, in get_db
  File "site-packages/calibre/srv/handler.py", line 67, in get_library
  File "site-packages/calibre/srv/library_broker.py", line 93, in get
  File "site-packages/calibre/srv/library_broker.py", line 102, in init_library
  File "site-packages/calibre/srv/library_broker.py", line 35, in init_library
  File "site-packages/calibre/db/legacy.py", line 48, in create_backend
  File "site-packages/calibre/db/backend.py", line 384, in __init__
  File "site-packages/calibre/db/schema_upgrades.py", line 19, in __init__
  File "site-packages/calibre/db/backend.py", line 842, in execute
  File "src/cursor.c", line 236, in resetcursor
ReadOnlyError: ReadOnlyError: attempt to write a readonly database

And some relevant info from Apache:
10.0.5.2 - - [22/Jun/2017:14:34:57 -0400] "GET /books/ HTTP/1.1" 304 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
10.0.5.2 - - [22/Jun/2017:14:34:57 -0400] "GET /books/auto-reload-port?1498156497837 HTTP/1.1" 200 1 "https://artorinix.com/books/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
10.0.5.2 - - [22/Jun/2017:14:34:57 -0400] "GET /books/allow-console-print?1498156497842 HTTP/1.1" 200 1 "https://artorinix.com/books/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
10.0.5.2 - - [22/Jun/2017:14:34:57 -0400] "GET /books/interface-data/init?1498156497883 HTTP/1.1" 404 21 "https://artorinix.com/books/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"

These are the relevant portions from my Apache configuration file:

# Specific proxy settings for Calibre's server
   RewriteEngine on
   RewriteRule ^/books/(.*) http://localhost:8085/books/$1 [proxy]
   RewriteRule ^/books http://localhost:8085 [proxy]
   SetEnv force-proxy-request-1.0 1
   SetEnv proxy-nokeepalive 1

Revision history for this message
KennyA (digimars) wrote :

Upgraded to 3.1.1 this morning (seeing all the content server fixes) however I'm still having the same issue.

Revision history for this message
Kovid Goyal (kovid) wrote :

The url prefix issue is fixed. The other error you describe about the readonly database is not a bug in calibre. You will ned to check the permissions on the metadta.db file in your calibre library.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.