problem with calendarserver_upgrade command on ubuntu 15.10

Asked by Battant on 2016-04-17

Hello,

My confuguration :
ubuntu 15.10 64 bit
package calendarserver
ptoblem with calendarserver_upgrade command

step to reproduce :
1. install calendarserver on ubuntu 15.10
2. Enter this command in a terminal
calendarserver_upgrade
Traceback (most recent call last):
  File "/usr/bin/calendarserver_upgrade", line 32, in <module>
    from calendarserver.tools.upgrade import main
  File "/usr/lib/python2.7/dist-packages/calendarserver/tools/upgrade.py", line 36, in <module>
    from calendarserver.tools.cmdline import utilityMain, WorkerService
  File "/usr/lib/python2.7/dist-packages/calendarserver/tools/cmdline.py", line 21, in <module>
    from calendarserver.tap.caldav import CalDAVServiceMaker, CalDAVOptions
  File "/usr/lib/python2.7/dist-packages/calendarserver/tap/caldav.py", line 77, in <module>
    from txdav.common.datastore.upgrade.migrate import UpgradeToDatabaseStep
  File "/usr/lib/python2.7/dist-packages/txdav/common/datastore/upgrade/migrate.py", line 44, in <module>
    from txdav.common.datastore.file import CommonDataStore as FileStore, TOPPATHS
  File "/usr/lib/python2.7/dist-packages/txdav/common/datastore/file.py", line 33, in <module>
    from twisted.python import hashlib
ImportError: cannot import name hashlib

I would like to send a complete bug report but I don't know how to determin wich package content the calendarserver_upgrade command.

Could you help me to fixe this issue

Best regards

Battant

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu calendarserver Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
2016-04-21
Last query:
2016-04-21
Last reply:
2016-04-21

Try prefixing the command with sudo

Battant (mparchet) said : #2

Hello,

sorry it's don't work

sudo calendarserver_upgrade
Traceback (most recent call last):
  File "/usr/bin/calendarserver_upgrade", line 32, in <module>
    from calendarserver.tools.upgrade import main
  File "/usr/lib/python2.7/dist-packages/calendarserver/tools/upgrade.py", line 36, in <module>
    from calendarserver.tools.cmdline import utilityMain, WorkerService
  File "/usr/lib/python2.7/dist-packages/calendarserver/tools/cmdline.py", line 21, in <module>
    from calendarserver.tap.caldav import CalDAVServiceMaker, CalDAVOptions
  File "/usr/lib/python2.7/dist-packages/calendarserver/tap/caldav.py", line 77, in <module>
    from txdav.common.datastore.upgrade.migrate import UpgradeToDatabaseStep
  File "/usr/lib/python2.7/dist-packages/txdav/common/datastore/upgrade/migrate.py", line 44, in <module>
    from txdav.common.datastore.file import CommonDataStore as FileStore, TOPPATHS
  File "/usr/lib/python2.7/dist-packages/txdav/common/datastore/file.py", line 33, in <module>
    from twisted.python import hashlib
ImportError: cannot import name hashlib

Could you help me please to fond this python exception cause and fix this bug ?

Best regards

Battant

Manfred Hampl (m-hampl) said : #3

Do you have the package python-twisted-core installed?

Battant (mparchet) said : #4

Hello,

I have upgrade my ubuntu version
My new configuration is
ubuntu 16.04 LTS
package calendarserver 7.0

I have installed the package python-twisted-core 16,0.0-1

the terminal output :

sudo calendarserver_upgrade
[sudo] password for mparchet:
/usr/lib/python2.7/dist-packages/twext/python/__pycache__/_cffi_twext_python_sacl_xe128630fxbbd600c.c:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
2016-04-21 14:59:06+0100 Root ACL: <?xml version='1.0' encoding='UTF-8'?>
<acl xmlns='DAV:'>
  <ace>
    <principal>
      <all/>
    </principal>
    <grant>
      <privilege>
        <read/>
      </privilege>
      <privilege>
        <read-current-user-privilege-set/>
      </privilege>
    </grant>
    <protected/>
  </ace>
</acl>
2016-04-21 14:59:06+0100 Nav ACL: <?xml version='1.0' encoding='UTF-8'?>
<acl xmlns='DAV:'>
  <ace>
    <principal>
      <authenticated/>
    </principal>
    <grant>
      <privilege>
        <read/>
      </privilege>
      <privilege>
        <read-current-user-privilege-set/>
      </privilege>
    </grant>
    <protected/>
  </ace>
</acl>
Traceback (most recent call last):
  File "/usr/bin/calendarserver_upgrade", line 9, in <module>
    load_entry_point('CalendarServer==7.0a1+unknown', 'console_scripts', 'calendarserver_upgrade')()
  File "/usr/lib/python2.7/dist-packages/calendarserver/tools/upgrade.py", line 243, in main
    utilityMain(options["config"], makeService, reactor, customServiceMaker, patchConfig=_patchConfig, onShutdown=_onShutdown, verbose=options["debug"])
  File "/usr/lib/python2.7/dist-packages/calendarserver/tools/cmdline.py", line 121, in utilityMain
    service = maker.makeService(options)
  File "/usr/lib/python2.7/dist-packages/calendarserver/tap/caldav.py", line 795, in makeService
    service = serviceMethod(options)
  File "/usr/lib/python2.7/dist-packages/calendarserver/tap/caldav.py", line 1418, in makeService_Utility
    toolServiceCreator, None, uid=uid, gid=gid
  File "/usr/lib/python2.7/dist-packages/calendarserver/tap/caldav.py", line 1626, in storageService
    uid=overrideUID, gid=overrideGID
  File "/usr/lib/python2.7/dist-packages/calendarserver/tap/util.py", line 160, in pgServiceFromConfig
    initDB=config.Postgres.Init,
  File "/usr/lib/python2.7/dist-packages/txdav/base/datastore/subpostgres.py", line 282, in __init__
    self._pgCtl = locateCommand("pg_ctl", pgCtl)
  File "/usr/lib/python2.7/dist-packages/txdav/base/datastore/subpostgres.py", line 279, in locateCommand
    "Unable to locate {} command: {}".format(name, cmd)
txdav.common.icommondatastore.InternalDataStoreError: Unable to locate pg_ctl command: pg_ctl

1. Could you help me to install python.h ?

Could you help me to fix this issue ?

Best regards

Battant

Manfred Hampl (m-hampl) said : #5

Let me check your OS environment first.

What is now the output of these commands:

uname -a
lsb_release -crid
sudo dpkg --audit
apt-cache policy calendarserver

Battant (mparchet) said : #6

Hello,

Here is the terminal output

uname -a
Linux mparchet-W240EU-W250EUQ-W270EUQ 4.4.0-18-generic #34-Ubuntu SMP Wed Apr 6 14:01:02 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

sudo dpkg --audit
no result

apt-cache policy calendarserver
calendarserver:
  Installed: 7.0+dfsg-2
  Candidate: 7.0+dfsg-2
  Version table:
 *** 7.0+dfsg-2 100
        100 /var/lib/dpkg/status
     7.0+dfsg-1 500
        500 http://archive.ubuntu.csg.uzh.ch/ubuntu xenial/universe amd64 Packages

Could you help me please ?

Thanks for your support

Best regards

Battant

Best Manfred Hampl (m-hampl) said : #7

Ok. No unmatched or broken dependencies.

As far as I can see from your error message and the related python source, the calendarserver_upgrade job tries to use a command "pg_ctl" to communicate with a postgres database, but such command nowadays does not exist in the PATH directories.

This still seems to be Bug #1399975

Battant (mparchet) said : #8

Thanks Manfred Hampl, that solved my question.