Score:0

Calibre E-book Content Server not working on Ubuntu 22.04

cn flag

Background Info:

I've used Calibre for many, many years. I use the content server to allow access to my libraries over my local network. However, sometime in December the content server stopped working. I first thought that a firewall setting may have been changed. But checking the firewall, routers and routing tables shows the port I run the content server is are open. I didn't really pursue this issue as I found that starting the calibre server as my regular user gave me access. However, I have become frustrated with the lack of access to add or modify my library while sitting at my workstation on which calibre is run. I like the easy access that running calibre desktop gives me. Today I decided to tackle this issue and learned that Calibre works on the network if ran with sudo or as root. However, running it as my standard user (which I have always done) does not work. So I expect this is a permission issue...

System: Ubuntu 22.04 with latest updates (I run apt update and apt upgrade every morning). Calibre: Versions from 6.10 on have had this issue. I am currently on 6.14.

Python: I have ran Calibre with python versions 3.7 - 3.11 using update-alternatives and have the same results.

Query: What do I need to do to be able to run calibre's content server as my regular user account instead of using sudo?

Terrance avatar
id flag
Probably the first time you launched Calibre as a root user it changed all the ownership of the `~/.config/calibre` directory and its contents to `root` instead of your user. If that directory and its contents are owned by `root` you will not be able to launch it correctly. Show the output of `ls -al ~/.config/calibre`
user693336 avatar
cn flag
Sorry, I had a medical procedure and was offline for a few days. Thanks for the reply. I listed the files in the ~/.config/calibre directory and they all show they are owned by my standard user account. So the permission issue is not with the ~/.config/calibre directory. Any other ideas?
Terrance avatar
id flag
Maybe check the permissions of both the `calibre` and `calibre-server` apps. `ls -al /opt/calibre/calibre-server` and `ls -al /opt/calibre/calibre`
user693336 avatar
cn flag
The permissions on both (and everything under /opt) are owner and group is root. permissions are -rwxr-xr-x, I believe that's owner can read, write, and execute, group can read and execute, and others can read and execute. These are the same permissions for other things in /opt like my web browser which I can run as my regular user. For completeness: ls -al /opt/calibre/calibre-server -rwxr-xr-x 1 root root 14472 Mar 9 17:24 /opt/calibre/calibre-server, ls -al /opt/calibre/calibre -rwxr-xr-x 1 root root 14472 Mar 9 17:24 /opt/calibre/calibre
Terrance avatar
id flag
One other question and then I am officially out of ideas here. Both calibre and calibre-server work fine for my user account without any issues. What Kernel version are you running? Ubuntu 22.04.2 LTS defaults to the 5.19 Kernel on a clean install, and unfortunately I bumped into issues with it where drivers would fail in the 5.19, then work if I reinstalled the driver, then fail again. It was very unpredictable. I went back to just the 5.15 Kernel and have not had any issues. Beyond the Kernel, I am out of ideas. Sorry about that!
user693336 avatar
cn flag
The kernel version via uname -r is 5.15.0-67-generic. Here I should say that I upgraded to 22.04 from 20.04. I do run apt update and apt upgrade daily. I keep that last three kernel version on the system as I have had issues with some of the software I use almost daily like Quartus II and ModelSim. I will try rolling back to another kernel version and update this post with the results. Thank you so much Terrance for you help!
user693336 avatar
cn flag
Solved - After weeks of messing with this, I solved the issue tonight! In the Advanced Setting for the Content Server, the max size for a single HTTP header was set to 0.0. The however didn't affect the server when run from the terminal. I set this value to 2 Kb first and then played with the value and settled on 10kb. But anything from > 2Kb seemed to work just fine. Still, I increased it to provide some headroom. I should note that I have no idea how this value was changed and why the issue occurred right after an update to a version back around December.
Terrance avatar
id flag
You should write that up as an answer. I'll totally upvote it! Good job!!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.