Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ees1bk opened this issue Nov 3, 2017 · 4 comments

Comments

@ees1bk
Copy link

ees1bk commented Nov 3, 2017

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) ...
@ees1bk
Copy link
Author

ees1bk commented Nov 3, 2017

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

@ees1bk
Copy link
Author

ees1bk commented Nov 3, 2017

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.

@ghost
Copy link

ghost commented Nov 3, 2017

As you have found #28695 which is still open and duplicated by the issue here i'm closing this for now.

The breaking change of MariaDB 10.2.7+ will be worked around with the upcoming oC 10.0.4 with #29240

If you can't wait for oC 10.0.4 you might want to try to patch the files manually with https://github.com/owncloud/core/pull/29240/files (One new files and 5 added lines to an existing file).

@ghost ghost closed this as completed Nov 3, 2017
@lock
Copy link

lock bot commented Aug 1, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants