Public bug reported:

Hi

there are a number of things wrong with the current calendarserver
package (7.0+dfsg-2) on Ubuntu 16.04 LTS server.

1. calendarserver can only work with a database backend, support for the
files backend has been dropped upstream according to the docs. Yet,
there is no dependency on any database, in particular postgresql.

2. The twisted framework seems to be missing gcc: "unable to execute
'x86_64-linux-gnu-gcc': No such file or directory" when starting
caldavd. Not sure if fatal, may need python-dev to be installed as well.

3. There appears to be no method or script to create the required DB
user and define the schema for the database. In past versions (<6.0)
there was a  calendarserver_bootstrap_database script. When you start
caldavd now you will get an error in /var/log/caldavd/error.log:

" pg8000.core.ProgrammingError: (u'FATAL', u'3D000', u'database "caldav"
does not exist', u'postinit.c', u'826', u'InitPostgres', u'', u'')"

I managed to modify Apple's original bootstrap_database script (attached) and 
use it to create a working calendar server.  This is the original script:
https://svn.calendarserver.org/repository/calendarserver/CalendarServer/tags/release/CalendarServer-5.3/calendarserver/tools/bootstrapdatabase.py

Apart from the iOS paths there are a couple of things that need addressing for 
a port to Linux:
a. The database user should be "caldavd" not "caldav", to match the one in 
/etc/caldavd/caldavd.plist
b. The script assumes communication via UNIX sockets. With the default 
Postgresql config this means that the script must be run by the right user for 
authentication to succeed. Problem is that the script requires 2 different 
users.

    i. postgres to create the caldavd user and database
   ii. caldavd to set the database schema in the newly created database

So the createuser and createdb need to be run as postgres, and the PSQL
commands as caldavd :-(

In my case I solved it by turning off exit-on-error and running the
script as these two users.

Happy fixing.

** Affects: calendarserver (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: calendarserver

** Attachment added: "Dirty fix for bootstrapping DB"
   
https://bugs.launchpad.net/bugs/1600252/+attachment/4697439/+files/bootstrapdatabase.py

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1600252

Title:
  calendarserver package broken

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/calendarserver/+bug/1600252/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to