Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-22-2017, 09:12 AM   #1
tesep
Junior Member
tesep began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: Sony PRS-350
calibredb cli needs admin rights (sudo)

Hi,

I have problems using calibredb. When I run it without sudo it fails silently (not returning any results), only when I use sudo it succeeds:

Code:
sudo calibredb list --fields="title,author_sort,tags,cover" --for-machine
I tried to repair the rights to my database-file as well as the executables, but that didn’t change anything.

Any idea how to fix this?

I’m on macOS 10.12 Sierra.

Last edited by tesep; 07-22-2017 at 02:22 PM.
tesep is offline   Reply With Quote
Old 07-22-2017, 01:11 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,057
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
sudo need implies there are current user 'rights' issues somewhere in the chain.

The Library (RW)
the Executables (need x permission)
the (CSV) output destination folder (RW)
theducks is offline   Reply With Quote
Advert
Old 07-22-2017, 01:37 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Pass the correct --with-library argument to it.
kovidgoyal is offline   Reply With Quote
Old 07-22-2017, 02:19 PM   #4
tesep
Junior Member
tesep began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: Sony PRS-350
Thanks for your answers!

After running the following command it works great!

Code:
chmod u+x calibredb
tesep is offline   Reply With Quote
Old 07-23-2017, 08:13 AM   #5
tesep
Junior Member
tesep began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: Sony PRS-350
I just noticed that "calibredb" (without sudo) always fails silently when calibre GUI is open. When the GUI is closed sudo is not needed.

Any idea why this happens? Would be good at least to have a error message if the db is blocked!
tesep is offline   Reply With Quote
Advert
Old 07-23-2017, 10:14 AM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,057
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Since 3.x, you can not run the CLI and the GUI at the same time. It is in the release notes and has been mentioned here at MR dozens of times.

I do hate silent fails, though. But is it really 'silent'? Or is the Console output just lost because of a shell script?
theducks is offline   Reply With Quote
Old 07-23-2017, 07:07 PM   #7
tesep
Junior Member
tesep began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: Sony PRS-350
Sorry if this has been answered before, I searched in the forum but didn’t find any results to my question.

Hard to tell for me why there is no output.
tesep is offline   Reply With Quote
Old 07-24-2017, 01:36 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Because there was a bug: https://github.com/kovidgoyal/build-...bb3229e0fff372

In the next calibre release, this will show the error message you expected to see.
Quote:
Another calibre program such as calibre-server or the main calibre program is running. Having multiple programs that can make changes to a calibre library running at the same time is a bad idea. calibredb can connect directly to a running calibre content server, to make changes through it, instead. See the documentation of the --with-library option for details.
eschwartz is offline   Reply With Quote
Old 07-24-2017, 02:54 PM   #9
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,515
Karma: 78910202
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Is it also a bug that running calibredb via sudo works?

Sent from my Nexus 7 using Tapatalk
PeterT is offline   Reply With Quote
Old 07-24-2017, 11:24 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by PeterT View Post
Is it also a bug that running calibredb via sudo works?

Sent from my Nexus 7 using Tapatalk
No, the single instance check is per user.
kovidgoyal is offline   Reply With Quote
Old 07-28-2017, 04:05 AM   #11
tesep
Junior Member
tesep began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: Sony PRS-350
Do the devs:
Can’t you let calls to "calibredb list" through? As they are not writing anything they can do no harm.
I am writing a desktop ebook-browser right now which uses the calibre-cli and closing calibre all the time really impairs the usability.
tesep is offline   Reply With Quote
Old 07-28-2017, 04:17 AM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
list is not readonly, any database access is not readonly, since database schemas are upgraded on any connection. You dont need to shutdown calibre, simply run the calibre content server and have calibredb connect to it.
kovidgoyal is offline   Reply With Quote
Old 08-04-2017, 03:06 AM   #13
tesep
Junior Member
tesep began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: Sony PRS-350
I still don’t really see the purpose in this – worst case you get wrong data back. But I guess 99% most users will call calibredb or use calibre to edit the db, once at a time.

I want to make a minimalist ebook browser which uses the calibre db. Having to close down calibre all the time when you want to add a book makes it hardly usable. Also then making it necessary to run a content server, which is overkill if you just want to browse your own ebooks.

So my alternative now is probably getting the data directly from the SQLite db…
tesep is offline   Reply With Quote
Reply

Tags
calibre, cli, terminal


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add multiple multiple formats via the calibredb cli cadaeibfed Library Management 2 07-06-2017 06:41 AM
cannot add book to calibredb using CLI bump Calibre 2 04-04-2014 01:33 AM
CLI: calibredb add_custom_column ilovejedd Library Management 8 10-19-2012 02:35 AM
calibredb catalog CLI error ilovejedd Library Management 4 02-06-2012 10:26 AM


All times are GMT -4. The time now is 08:39 AM.


MobileRead.com is a privately owned, operated and funded community.