Skip to content

Error updating schema on upgrade to 10.0.3/Ubuntu 16.04 ALTER TABLE oc_calendarsubscriptions #29445

Closed

Description

@ees1bk

Upgrade to 10.0.0.3 on Ubuntu failed with following issue:
Updating database schema
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_calendarsubscriptions CHANGE lastmodified lastmodified INT UNSIGNED DEFAULT NULL NOT NULL': SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'lastmodified'

Steps to reproduce

  1. Use apt-get dist-upgrade to install update 10.0.3
  2. Visit web interface URL
  3. Click "upgrade" button

Expected behaviour

Upgrade should happen and normal service resume

Actual behaviour

This error:
Updating database schema
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_calendarsubscriptions CHANGE lastmodified lastmodified INT UNSIGNED DEFAULT NULL NOT NULL': SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'lastmodified'

Server configuration

Ubuntu 16.04

Apache 2

MySQL (I assume)

php7

10.0.3
Updated from an older ownCloud or fresh install:
Upgrade

Where did you install ownCloud from:
Owncloud's own repos
Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.
Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.
Not accessible.
or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

ownCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
"system": {
"maintenance": false,
"instanceid": "ocy9nuzuyxxw",
"datadirectory": "/export/vol/owncloud/data",
"mail_domain": "bevteccom.co.uk",
"mail_smtpmode": "smtp",
"mail_smtphost": "192.168.200.10",
"mail_smtpport": 25,
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"gabrielle.bevteccom.co.uk",
"gabrielle"
],
"overwrite.cli.url": "http://gabrielle/owncloud",
"dbtype": "mysql",
"version": "9.1.6.2",
"logtimezone": "UTC",
"installed": true,
"theme": "",
"loglevel": 2,
"trashbin_retention_obligation": "auto",
"updatechecker": false,
"dbname": "owncloud",
"dbhost": "127.0.0.1",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE"
}
}

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

Activity

  1. ees1bk commented on Nov 3, 2017

    @ees1bk
    Author

    Same happens using occ upgrade from the command line:
    2017-11-03T17:17:35+00:00 Repair info: App was not updated: provisioning_api
    2017-11-03T17:17:35+00:00 Repair info: App was not updated: systemtags
    2017-11-03T17:17:35+00:00 Repair info: App was not updated: templateeditor
    2017-11-03T17:17:35+00:00 Repair info: App was not updated: updatenotification
    2017-11-03T17:17:35+00:00 Updating database schema
    2017-11-03T17:17:36+00:00 Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_calendarsubscriptions CHANGE lastmodified lastmodified INT UNSIGNED DEFAULT NULL NOT NULL':

    SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'lastmodified'
    2017-11-03T17:17:36+00:00 Update failed
    2017-11-03T17:17:36+00:00 Maintenance mode is kept active
    2017-11-03T17:17:36+00:00 Reset log level

  2. ees1bk commented on Nov 3, 2017

    @ees1bk
    Author

    Used the suggested fix provided by TheFiZi commented on 24 Sep
    on #28695
    and have progressed beyond the stuck point.

    I am using MariaDB-10.2 as my provider of MySQL.

  3. ghost closed this as completedon Nov 3, 2017
  4. lock commented on Aug 1, 2019

    @lock

    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.

  5. locked as resolved and limited conversation to collaborators on Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions