Server: Unknown column 'calendartype' (table calendarobjects)

Created on 12 Nov 2018  路  10Comments  路  Source: nextcloud/server

As discovered when testing https://github.com/nextcloud/contacts/pull/706, it's not possible to create a contact on latest master. Apparently this is a regression of https://github.com/nextcloud/server/pull/10059.

Raw DAV response (HTTP500)

<?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 `id`, `uri`, `lastmodified`, `etag`, `calendarid`, `size`, `calendardata`, `componenttype`, `classification` FROM `oc_calendarobjects` WHERE (`calendarid` = ?) AND (`uri` = ?) AND (`calendartype` = ?)' with params ["18", "contacts-5942F193-088E-41FE-AABD-8044A15194E1.vcf.ics", 0]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'calendartype' in 'where clause'</s:message>
</d:error>

This column was added in #10593, but the migration was never run:

> select * from oc_migrations where app = 'dav' and version = '1006Date20180628111625';
Empty set (0.00 sec)

cc @georgehrke @nickvergessen

1. to develop bug dav regression

All 10 comments

Very simple guess: it didn't run because #10059 didn't increase the app version?

I guess the app-version change went missing on a rebase.

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/6163 ( There is no column with name 'user_type' on table 'oc_circles_members'.), https://github.com/nextcloud/server/issues/758 (drop old calendar and contacts tables), https://github.com/nextcloud/server/pull/11668 (convert source column in calendarsubscription table to (long) text), https://github.com/nextcloud/server/issues/155 (Obsolete table: authtoken?), and https://github.com/nextcloud/server/issues/11541 (User table header).

Well the other reason is that the migration was not the newest.
So when you had already the 1007 or the 1008 migration executed, the 1006 is skipped I think.

@nickvergessen It just checks what migrations have been run and which not: https://github.com/nextcloud/server/blob/master/lib/private/DB/MigrationService.php#L258

@ChristophWurst Did you check if simply increasing the app-version helps?

I don't get this regression on a fresh installation.

Yep, according to the migrations table the migration was run

But you said in the original report that the migration was not run:

but the migration was never run:

?

*after increasing the app version, ofc ;)

12447 increases the app version

Was this page helpful?
0 / 5 - 0 ratings