Path for db schema referenced by bootstrapdb.py doesn't exist

Bug #1341801 reported by quickezed
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
calendarserver (Ubuntu)
Triaged
High
Unassigned

Bug Description

After installing the calendarserver package, the python file "bootstrapdatabase.py"[0] fails to run due to it referencing an invalid file path. This invalid file path is defined on line 28 of "bootstrapdatabase.py":

SCHEMAFILE = "/usr/share/pyshared/txdav/common/datastore/sql_schema/current.sql"

The path "/usr/share/pyshared/txdav" does not exist. The correct path for "current.sql" is actually:
/usr/lib/python2.7/dist-packages/txdav/common/datastore/sql_schema/current.sql

Further information:
1) System version: Ubuntu 14.04 LTS
2) calendarserver version: 5.2+dfsg-1
3) I expected "bootstrapdatabase.py" to execute successfully.
4) "bootstrapdatabase.py" failed to run due to a file it references not existing. See above for the specifics.

[0] /usr/lib/python2.7/dist-packages/calendarserver/tools/bootstrapdatabase.py

Tags: patch
description: updated
description: updated
Revision history for this message
TJ (tj) wrote :

The (faulty) path is introduced in "debian/patches/debianize-bootstrapdatabase.py.patch". The path should not be hard-coded it should be calculated at runtime to accommodate the package-install-time path translation from "/usr/share/pyshared to "/usr/lib/pythonX.Y/"

Changed in calendarserver (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
TJ (tj) wrote :

Revised patch: Use proper Python path separator

Revision history for this message
TJ (tj) wrote :

Revise patch: Iterate all package paths checking for file existence (copes with alternate site-paths such as "/usr/local/pythonX.Y/site-packages/")

Revision history for this message
quickezed (quickezed-deactivatedaccount) wrote :

I can confirm this latest patch works. When executed, bootstrapdatabase.py can correctly locate the schema file.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Possible fix using runtime-calculated path" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
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.