Core: missing databasefield "publicuri" in oc_dav_shares after upgrade to 10.0.0 (stable) from 9.1.5

Created on 27 Apr 2017  ยท  18Comments  ยท  Source: owncloud/core

Using ubuntu 14.04 and the official repo:
http://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/

I upgraded from 9.1.5 to 10.0.0 (stable).
I also upgraded to php5.6.

The "occ upgrade" went fine without any issues. I had also run the "repair" command to possibly fix the issue.

The problem is the calendar app. After upgrading to the version for 10.0.0. it shows no calendars, only the rotating "load icon".
Checking the ajax-calls it seems that the call to "/remote.php/dav/calendars/mario/" fails with

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Doctrine\DBAL\Exception\InvalidFieldNameException</s:exception>
  <s:message>An exception occurred while executing 'SELECT `publicuri` FROM `oc_dav_shares` WHERE (`resourceid` = ?) AND (`access` = ?)' with params ["1", 4]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'publicuri' in 'field list'</s:message>
</d:error>

checking the database this field seems to be missing:

mysql> describe oc_dav_shares;                                                                                                                                        โ”‚ยทยทยท
+--------------+---------------------+------+-----+---------+----------------+                                                                                        โ”‚ยทยทยท
| Field        | Type                | Null | Key | Default | Extra          |                                                                                        โ”‚ยทยทยท
+--------------+---------------------+------+-----+---------+----------------+                                                                                        โ”‚ยทยทยท
| id           | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |                                                                                        โ”‚ยทยทยท
| principaluri | varchar(255)        | YES  | MUL | NULL    |                |                                                                                        โ”‚ยทยทยท
| type         | varchar(255)        | YES  |     | NULL    |                |                                                                                        โ”‚ยทยทยท
| access       | smallint(6)         | YES  |     | NULL    |                |                                                                                        โ”‚ยทยทยท
| resourceid   | int(10) unsigned    | NO   |     | NULL    |                |                                                                                        โ”‚ยทยทยท
+--------------+---------------------+------+-----+---------+----------------+                                                                                        โ”‚ยทยทยท
5 rows in set (0.00 sec)       

I found an migration-Script in

apps/dav/appinfo/Migrations/Version20170116150538.php

that should add this field, but it seems that is was not running or it hasn'tnt added the field.

Bug statuSTALE

Most helpful comment

Fixed this with:
ALTER TABLE oc_dav_shares ADD publicuri VARCHAR(255) NOT NULL AFTER principaluri;

All 18 comments

If you add the field manually as stated in the php file (the same as "principaluri") then the calander app seems working; calendar items are shown as before.
However, sychronisation with CalDav Syncronizer still seems broken.
What should be the content of this field? Is that specified anywhere?

Fixed this with:
ALTER TABLE oc_dav_shares ADD publicuri VARCHAR(255) NOT NULL AFTER principaluri;

@dennisbaaten I don't know if it's mentioned anywhere in the changelog, but by the looks of it the dav-urls have changed.
I fixed my DavDroid installation by recreating my account using https://cloud.example.com/remote.php/dav/ as base url instead of just https://cloud.example.com/

I was just working on the Davdroid issue too....
These redirects work:
Redirect 301 /.well-known/carddav /remote.php/dav
Redirect 301 /.well-known/caldav /remote.php/dav

Correct! Just discovered this myself. The URL-part "caldav" changed to "dav" (in case of the Calendar)

It looks like groups may have broken with DavDroid + OC 10.0.0 as well.... but I need to sleep :\

Correct! Just discovered this myself. The URL-part "caldav" changed to "dav" (in case of the Calendar)

dav was added the old urls are still valid - you can still use caldav.

@VicDeo I tried to patch directly from you commit, but it fails in several chunks as well as that in my installation the database.xml file is missing.
I have nothing changed by hand before, just updated from the regular repos.
I just added the field manually in the database. Calendars are now shown and I also could add a new entry on my iPhone and the entry showed up in the web-calendar. I will have an eye on this and hope your fix will make it into the next version.
Thanks to all for the help and you effort on this.
Mario.

please test #27756

Patch didn't work for me. Still can't use the calendar app.

UPDATE: manual removing and reinstalling the app (probably together with the patch) fixed it now.

Also got this problem after upgrading from 9 to 10.
The above fix:

ALTER TABLE oc_dav_shares ADD publicuri VARCHAR(255) NOT NULL AFTER principaluri;

worked for me.

@mkeller0815 my commit doesn't change database.xml
It consists of
1 new file apps/dav/appinfo/Migrations/Version20170427182800.php
1 changed file apps/dav/appinfo/info.xml the only change here is a version number. It is bumped to start migration

For all reading this: please use +:smile: button to express your happiness after successful manual DB patching. Fixing with a direct database query is just a workaround and doesn't solve the issue for other users in future.

But I would be very thankful for testing pull request https://github.com/owncloud/core/pull/27756 first and leaving some feedback in the pull request

Just a note to the "changed" CalDAV / CardDAV URL and the part here https://github.com/owncloud/core/issues/27754#issuecomment-297946173:

dav was added the old urls are still valid - you can still use caldav.

There are more and more people reporting that the old URLs are not working anymore. There is now a new bugreport about that in https://github.com/owncloud/core/issues/27778

If anyone can provide more info please post them there.

fixed with #27756

I just upgraded to version 10 and can't get the calendar icon to show up. Tried the ALTER TABLE oc_dav_shares ADD publicuri VARCHAR(255) NOT NULL AFTER principaluri; command listed above but the database already contained that field. So far the experience has been quite negative: it would have been useful to inform for example that one needs to upgrade PHP and that this process is itself nightmarish.

@Sequential-circuits

Tried the ALTER TABLE oc_dav_shares ADD publicuri VARCHAR(255) NOT NULL AFTER principaluri; command listed above but the database already contained that field.

Then i think its unrelated to this issue.

it would have been useful to inform for example that one needs to upgrade PHP

The release notes contains that information.

https://doc.owncloud.org/server/10.0/admin_manual/release_notes.html

Personally i'm always having a look at release notes of a software i'm using before i'm doing a upgrade to a new major release.

If the release notes pointed out above is not that clear you can also request more clear notes about that at https://github.com/owncloud/documentation/issues

and that this process is itself nightmarish.

IMHO this is not the job of a web application. If the process to upgrade PHP on your used linux distro is nightmarish then you might want to complain to your distro.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PVince81 picture PVince81  ยท  4Comments

gxgani picture gxgani  ยท  5Comments

HLeemans picture HLeemans  ยท  4Comments

jnweiger picture jnweiger  ยท  4Comments

fridaynext picture fridaynext  ยท  5Comments