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

MariaDB 10.2.7: Install broken on master due to database column options #28695

Closed
tomneedham opened this issue Aug 15, 2017 · 44 comments
Closed
Assignees
Labels
db:mysql p2-high Escalation, on top of current planning, release blocker settings:installation
Milestone

Comments

@tomneedham
Copy link
Member

tomneedham commented Aug 15, 2017

Summary

Symptom:

An exception occurred while executing 
'ALTER TABLE oc_calendarsubscriptions CHANGE `lastmodified` lastmodified INT UNSIGNED DEFAULT NULL NOT NULL'

Reason: MariaDB v10.2.7+ is not supported by doctrine/dbal prior to v2.7.0
OC 10.0.4 - Fix on top of older doctrine/dbal: #29240
OC 10.4.0 - doctrine/dbal updated to v2.8.0: #36290
Quick older doctrine/dbal patch: #28695 (comment)

Initial report:

Master as of today 15/8/17

PHP 7.1.8-2+ubuntu16.04.1+deb.sury.org+4
10.2.7-MariaDB-10.2.7+maria~xenial

  1. I setup a new laptop, with apache, git, node, mariadb, php7.1.
  2. Git cloned core, ran make
  3. Setup db, user
  4. ran install via occ
tomneedham@tomneedham-X453MA:/var/www/html$ sudo -u www-data ./occ maintenance:install -vv --database=mysql --database-name=owncloud --database-host=localhost --database-user=owncloud --database-pass=owncloud --admin-user=Tom --admin-pass=Tom
ownCloud is not installed - only a limited number of commands are available
Error while trying to create admin user: 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'

Obviously we cant have default=null and NOT NULL....!

Traced this to line https://github.com/owncloud/core/blob/master/core/Migrations/Version20170101215145.php#L213

Dav install migration is here: https://github.com/owncloud/core/blob/master/apps/dav/appinfo/Migrations/Version20170116150538.php#L387 and only specifies unsigned => true.

I think this should have been in the dav app migrations.... de295ca

Weirdly I can't reproduce on another machine.

Could this be related to now having the 8/9 => 10 migrations in core, which include the setup for the dav app. So, during install, we are 'installing' dav before dav has had a change to do its setup?? Maybe....? Brain is still thinking this through.

@PVince81 @DeepDiver1975 ?

@tomneedham
Copy link
Member Author

screen shot 2017-08-15 at 12 42 56

I added in logging to show the migrations being performed. You can see it is running the 8/9 => 10 migrations, despite this being a fresh 10 install. This means the 8/9 migratuions are 'installing' the dav app despite it not being installed yet, which is tricking future core migrations into thinking we are just doing an update here and hence modifying the dav tables, which are not actually up to date yet.

@tomneedham

This comment has been minimized.

@tomneedham

This comment has been minimized.

@PVince81

This comment has been minimized.

@PVince81 PVince81 added p2-high Escalation, on top of current planning, release blocker bug-analysis labels Aug 16, 2017
@hanwentao

This comment has been minimized.

@PVince81

This comment has been minimized.

@PVince81 PVince81 modified the milestones: planned, development Aug 30, 2017
@TheFiZi

This comment has been minimized.

@fsantiago07044

This comment has been minimized.

@TheFiZi

This comment has been minimized.

@PVince81

This comment has been minimized.

@fsantiago07044

This comment has been minimized.

@TheFiZi

This comment has been minimized.

@fsantiago07044

This comment has been minimized.

@fri-K

This comment has been minimized.

@PVince81

This comment has been minimized.

@PVince81

This comment has been minimized.

@wcz-txp

This comment has been minimized.

@fsantiago07044

This comment has been minimized.

@PVince81

This comment has been minimized.

@VicDeo VicDeo changed the title Install broken on master due to database column options MariaDB 10.2: Install broken on master due to database column options Sep 23, 2017
@PVince81

This comment has been minimized.

@PVince81 PVince81 modified the milestones: development, planned Nov 6, 2017
@VicDeo
Copy link
Member

VicDeo commented Nov 6, 2017

@PVince81 failing tests are not related to OC. It seems all default values are quoted in MariaDB now, not only null.
E.g. DEFAULT -1 is stored as '-1' . When diff is computed '-1' <> -1 and it produces alter table statement with DEFAULT -1 once again.
It makes no harm in comparison with NOT NULL DEFAULT NULL.
But should be fixed anyway...

@enoch85

This comment has been minimized.

@PVince81

This comment has been minimized.

@PVince81
Copy link
Contributor

PVince81 commented Nov 8, 2017

@enoch85 ok, we found a solution. This will be in 10.0.4 RC1 that will be released in the coming days. Would be cool if you could test it with your VM once it's there.

@PVince81 PVince81 closed this as completed Nov 8, 2017
@enoch85

This comment has been minimized.

@clayrisser

This comment has been minimized.

@VicDeo

This comment has been minimized.

@PVince81

This comment has been minimized.

@clayrisser

This comment has been minimized.

@PVince81

This comment has been minimized.

@clayrisser

This comment has been minimized.

@PVince81

This comment has been minimized.

@clayrisser

This comment has been minimized.

@VicDeo
Copy link
Member

VicDeo commented Nov 14, 2017

@jamrizzi the fact is that none of PHP applications that use Doctrine library as a database abstraction layer are compatible with MariaDB 10.2.7 and above due to breaking changes introduced in this MariaDB version.

ownCloud 10.0.4 has a workaround to support MariaDB 10.2.7+ while Doctrine still has no support for it at the moment. It is being discussed for a while in Doctrine and has been not added to it's codebase yet.

See #28695 (comment) for details (including an easy hotfix).

@clayrisser

This comment has been minimized.

@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
@VicDeo VicDeo changed the title MariaDB 10.2: Install broken on master due to database column options MariaDB 10.2.7: Install broken on master due to database column options Feb 2, 2021
@owncloud owncloud deleted a comment from tomneedham Feb 2, 2021
@owncloud owncloud deleted a comment from tomneedham Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
db:mysql p2-high Escalation, on top of current planning, release blocker settings:installation
Projects
None yet
Development

No branches or pull requests