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

Database table seems broken after consecutive upgrades #309

Closed
Zibc opened this issue Nov 6, 2018 · 5 comments · Fixed by #310
Closed

Database table seems broken after consecutive upgrades #309

Zibc opened this issue Nov 6, 2018 · 5 comments · Fixed by #310

Comments

@Zibc
Copy link

Zibc commented Nov 6, 2018

Steps to reproduce

  1. enable activity app
  2. find out some functionnalities are broken

Expected behaviour

Functionnalities should not be broken

Actual behaviour

unable to run occ db:convert-filecache-bigint: it throws an exception:
[Doctrine\DBAL\Schema\SchemaException]
There is no column with name ‘object_id’ on table ‘oc_activity’.
-> there is indeed no such column in the database table

unable to remove events from calendar because of the same reason
calendar throws error code 500 because of that every once in a while

the table looks like this:

Name 	Type 	Collation 	Attributes 	Null 	Default 	Comments 	Extra
1 	activity_idPrimary 	int(11) 			No 	None 		AUTO_INCREMENT
2 	timestampIndex 	int(11) 			No 	0 		
3 	priority 	int(11) 			No 	0 		
4 	type 	varchar(255) 	utf8_bin 		Yes 	NULL 		
5 	userIndex 	varchar(64) 	utf8_bin 		Yes 	NULL 		
6 	affecteduserIndex 	varchar(64) 	utf8_bin 		No 	None 		
7 	appIndex 	varchar(255) 	utf8_bin 		No 	None 		
8 	subject 	varchar(255) 	utf8_bin 		No 	None 		
9 	subjectparams 	varchar(255) 	utf8_bin 		No 	None 		
10 	message 	varchar(255) 	utf8_bin 		Yes 	NULL 		
11 	messageparams 	varchar(255) 	utf8_bin 		Yes 	NULL 		
12 	file 	varchar(255) 	utf8_bin 		Yes 	NULL 		
13 	link 	varchar(255) 	utf8_bin 		Yes 	NULL 		

Server configuration

Operating system: debian 8

Web server: apache

Database: MySQL

PHP version: 5.6

Nextcloud version: 13

Where did you install Nextcloud from: upgrade from 12 on same server

Signing status:

List of activated apps:

Nextcloud configuration:

What should I do to fix the database ?

@nickvergessen
Copy link
Member

Well this happened for some people if the app was disabled between nextcloud 9 and 10 or an earlier step I think.

but we can add a workaround to ensure the column is created

@Zibc
Copy link
Author

Zibc commented Nov 7, 2018

That was quick!

Is there any chance to this fix coming also as a possible update for the current 13 and 14 versions of nextcloud ? I haven't updated to 14 yet, but I plan to do so.

I can also add manually the column is this fixes the issue, but with what properties ?

Thanks for quick reaction again guys!

@nickvergessen
Copy link
Member

I will backport it to 14, so it will come with the next release of 14

@Zibc
Copy link
Author

Zibc commented Nov 7, 2018

what about 13 ? although I know it will soon be in "end of life"

@nickvergessen
Copy link
Member

The columns are:

ALTER TABLE `oc_activity` ADD `object_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL;
ALTER TABLE `oc_activity` ADD `object_id` bigint(20) NOT NULL DEFAULT '0';

I'm not sure about 13, people had the app disabled for a long time already. So they can also just leave it disabled until the 14 update ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants