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

Undefined index: share_name at \/var\/www\/html\/owncloud\/lib\/private\/Share20\/DefaultShareProvider.php#863 #28285

Closed
JC10a opened this issue Jul 3, 2017 · 34 comments
Labels
bug-analysis p2-high Escalation, on top of current planning, release blocker sev3-medium status/STALE
Milestone

Comments

@JC10a
Copy link

JC10a commented Jul 3, 2017

Steps to reproduce

  1. php occ files:scan --all
    OR
  2. check owncloud.log

Expected behaviour

There are a lot of errors in the log and the occ filescan doesn't work. A lot of errors. I think for some reason the share_name index isn't in the $data variable in the DefaultShareProvider.php (check line 863)

Actual behaviour

Tell us what happens instead

Server configuration

Operating system:
Cent OS 7 (7.3.1611)

Web server:
Apache 2.4.6

Database:
mysql 14.14 Distrib 5.6.36

PHP version:
php 5.6.30

ownCloud version: (see ownCloud admin page)
10.0.2 (stable)

Updated from an older ownCloud or fresh install:
from 9.1.2 (stable) (9.1.6 after update I think) to 10.0.2

Where did you install ownCloud from:
http://download.owncloud.org/download/repositories/10.0.2/CentOS_7/ce:10.0.repo

Signing status (ownCloud 9.0 and above):
"https://gist.github.com/dc75la/a23c6b866adce8ee1c45bc17c92ceb78"
(because of a bug with column length: 256 set to 255)

The content of config/config.php:
$CONFIG = array (
'instanceid' => '--scrambled--',
'passwordsalt' => '--scrambled--',
'trusted_domains' =>
array (
0 => '--scrambled--',
1 => '--scrambled--',
),
'datadirectory' => '/home/--scrambled--',
'overwrite.cli.url' => 'https://--scrambled--',
'dbtype' => 'mysql',
'version' => '10.0.2.1',
'installed' => true,
'mail_smtpmode' => 'sendmail',
'mail_smtphost' => '--scrambled--',
'mail_smtpport' => '25',
'mail_from_address' => '--scrambled--',
'mail_domain' => '--scrambled--',
'loglevel' => '0',
'mail_smtpauthtype' => '--scrambled--',
'maintenance' => false,
'secret' => '--scrambled--',
'theme' => '',
'updatechecker' => false,
'trashbin_retention_obligation' => 'auto, auto',
'dbname' => '--scrambled--',
'dbhost' => 'localhost:3306',
'dbuser' => '--scrambled--',
'dbpassword' => '--scrambled--',
// 'memcache.local' => '\OC\Memcache\APCu',
// );
'filelocking.enabled' => true,
'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
// 'memcache.local' => '\OC\Memcache\Redis',
'redis' => array(
'host' => '127.0.0.1',
'port' => 6379,
'timeout' => 0,
),
);

List of activated apps:
Enabled:

  • comments: 0.3.0
  • configreport: 0.1.1
  • dav: 0.2.9
  • federatedfilesharing: 0.3.0
  • federation: 0.1.0
  • files: 1.5.1
  • files_external: 0.7.0
  • files_pdfviewer: 0.8.2
  • files_sharing: 0.10.0
  • files_trashbin: 0.9.0
  • files_versions: 1.3.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • market: 0.1.0
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • templateeditor: 0.1
  • updatenotification: 0.2.1
    Disabled:
  • encryption
  • external
  • files_antivirus
  • notifications
  • theme-example
  • user_external

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

Are you using encryption: yes/no
no

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

Logs

Web server error log

no errors related to the share_name error

ownCloud log (data/owncloud.log)

A lot of {"reqId":"WUgLRmyBEqVmVQy7zQ1zkwAAAAw","level":3,"time":"2017-06-19T17:35:02+00:00","remoteAddr":"--scrambled--","user":"--scrambled--","app":"PHP","method":"PROPFIND","url":"/owncloud/remote.php/dav/files/--scrambled--/","message":"Undefined index: share_name at /var/www/html/owncloud/lib/private/Share20/DefaultShareProvider.php#863"}
Messages

@PVince81
Copy link
Contributor

PVince81 commented Jul 3, 2017

can you check that the column "oc_share.name" does exist ?

@JC10a
Copy link
Author

JC10a commented Jul 3, 2017

No, the column name doesn't exists.

mysql> show columns from oc_share;
+---------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| share_type | smallint(6) | NO | | 0 | |
| share_with | varchar(255) | YES | | NULL | |
| uid_owner | varchar(64) | NO | | | |
| parent | int(11) | YES | | NULL | |
| item_type | varchar(64) | NO | MUL | | |
| item_source | varchar(255) | YES | | NULL | |
| item_target | varchar(255) | YES | | NULL | |
| file_source | int(11) | YES | MUL | NULL | |
| file_target | varchar(512) | YES | | NULL | |
| permissions | smallint(6) | NO | | 0 | |
| stime | bigint(20) | NO | | 0 | |
| accepted | smallint(6) | NO | | 0 | |
| expiration | datetime | YES | | NULL | |
| token | varchar(32) | YES | MUL | NULL | |
| mail_send | smallint(6) | NO | | 0 | |
| uid_initiator | varchar(64) | YES | | NULL | |
+---------------+--------------+------+-----+---------+----------------+
17 rows in set (0,07 sec)

@PVince81
Copy link
Contributor

PVince81 commented Jul 3, 2017

So there's your problem.

The column should have been created when updating to 10.0.2. How did you update ?

The migration in question is class Version20170320173955. You can check the oc_migrations table to
see whether it runs.

You could also try running occ migrations:migrate core to run missing migrations, just in case.

@JC10a
Copy link
Author

JC10a commented Jul 3, 2017

I just downloaded the repo and run yum update to update the owncloud software. It wasn't flawless, I had problems with the old repository at that time. But I manage to fix it to the current version.

Is there a way to check the complete database for missing columns ? Or at least were can I find the specs so I can add the column myself?

The occ migrations:migrate core doesn't output anything (and table isn't altered) but occ migrations:status core gives:

App: core
>> Version Table Name: oc_migrations
>> Migrations Namespace: OC\Migrations
>> Migrations Directory: /owncloud/core/Migrations
>> Previous Version: 20170418154659
>> Current Version: 20170516100103
>> Next Version: Already at latest migration step
>> Latest Version: 20170516100103
>> Executed Migrations: 10
>> Executed Unavailable Migrations: 10
>> Available Migrations: 10
>> New Migrations: 10

@JC10a
Copy link
Author

JC10a commented Jul 7, 2017

What are the specification for the oc_share.name column ? Or where can I find the complete database schema ?

@JC10a
Copy link
Author

JC10a commented Jul 17, 2017

The column is added after the command occ migrations:execute core 20170320173955. So my problem is solved for now.

But is there a way to check if there are more missing columns (integrity check for the database)?

@PVince81
Copy link
Contributor

there is currently no way to check for a full integrity of the database because with the migrations approach, there is no full definition of the DB schema.

The main question here is why this one migration didn't run for you guys in the first place.

Can you guys do a select * from oc_migrations where version='20170320173955'; ?
If the oc_share.name column is missing, then the migration entry above should be missing too.
If the column exists, the migration should be there.

The upgrade code decides what migrations to run based on what's in that oc_migrations table, so the mystery so far is why it decided to not run it.

cc @DeepDiver1975

@JC10a
Copy link
Author

JC10a commented Jul 17, 2017

Ok. I don't know what went wrong at that time.

I've checked the oc_migrations table and the row 'core,20170320173955' was there already, maybe that's why the occ migrations:migrate core didn't work for me.

The share_name column exists so the case may be closed for me. But the issue could be changed to feature request because I think it would be nice to have an integrity check for the database.

Thanks for the support and quick responses!

@hdijkema
Copy link

I had the same problem after upgrading from 7.0 -> 8.0 -> 8.1 -> (...) -> 10.0.

migrations:execute core 20170320173955

solved my problem too.

@tomneedham tomneedham added this to the development milestone Sep 5, 2017
@tomneedham tomneedham added the p1-urgent Critical issue, need to consider hotfix with just that issue label Sep 5, 2017
@VicDeo
Copy link
Member

VicDeo commented Sep 5, 2017

@hdijkema could you please recall the exact version you had before 10.0 in your upgrade path?

@VicDeo
Copy link
Member

VicDeo commented Sep 5, 2017

Needs special conditions, not reproducible in the wild
Before 9.1.2 and 9.1.6 has the same oc_share structure:

CREATE TABLE `oc_share` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `share_type` smallint(6) NOT NULL DEFAULT '0',
  `share_with` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `uid_owner` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `uid_initiator` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `parent` int(11) DEFAULT NULL,
  `item_type` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `item_source` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `item_target` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `file_source` int(11) DEFAULT NULL,
  `file_target` varchar(512) COLLATE utf8_bin DEFAULT NULL,
  `permissions` smallint(6) NOT NULL DEFAULT '0',
  `stime` bigint(20) NOT NULL DEFAULT '0',
  `accepted` smallint(6) NOT NULL DEFAULT '0',
  `expiration` datetime DEFAULT NULL,
  `token` varchar(32) COLLATE utf8_bin DEFAULT NULL,
  `mail_send` smallint(6) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `item_share_type_index` (`item_type`,`share_type`),
  KEY `file_source_index` (`file_source`),
  KEY `token_index` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

After 10.0.2:

CREATE TABLE `oc_share` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `share_type` smallint(6) NOT NULL DEFAULT '0',
  `share_with` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `uid_owner` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `uid_initiator` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `parent` int(11) DEFAULT NULL,
  `item_type` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `item_source` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `item_target` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `file_source` int(11) DEFAULT NULL,
  `file_target` varchar(512) COLLATE utf8_bin DEFAULT NULL,
  `permissions` smallint(6) NOT NULL DEFAULT '0',
  `stime` bigint(20) NOT NULL DEFAULT '0',
  `accepted` smallint(6) NOT NULL DEFAULT '0',
  `expiration` datetime DEFAULT NULL,
  `token` varchar(32) COLLATE utf8_bin DEFAULT NULL,
  `mail_send` smallint(6) NOT NULL DEFAULT '0',
  `share_name` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `item_share_type_index` (`item_type`,`share_type`),
  KEY `file_source_index` (`file_source`),
  KEY `token_index` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin

@hdijkema
Copy link

hdijkema commented Sep 5, 2017

It was a standard debian jessie installation (with non standard postgresql 9.4 I think).

$OC_Version = array(7,0,4,2);
$OC_VersionString = '7.0.4';
$OC_Edition = '';
$OC_Channel = 'stable';
$OC_Build = '2014-12-08T18:35:45+00:00';

@VicDeo
Copy link
Member

VicDeo commented Sep 5, 2017

@hdijkema sorry, I mean right before 10.0

@hdijkema
Copy link

hdijkema commented Sep 5, 2017

Oh, that be the latest 9.1 version.

Here are all the versons I installed to upgrade from 7.0.4 to 10.0.2

-rw-r--r-- 1 www-data www-data 23826749 Nov  8  2016 owncloud-8.0.16.tar.bz2
-rw-r--r-- 1 www-data www-data 24595002 Feb  1  2017 owncloud-8.1.12.tar.bz2
-rw-r--r-- 1 www-data www-data 27974620 Apr 18 21:26 owncloud-8.2.11.tar.bz2
-rw-r--r-- 1 www-data www-data 28522993 May 30 19:08 owncloud-9.0.10.tar.bz2
-rw-r--r-- 1 www-data www-data 29134671 May 30 19:16 owncloud-9.1.6.tar.bz2
-rw-r--r-- 1 www-data www-data 30963258 May 30 19:25 owncloud-10.0.2.tar.bz2

@VicDeo
Copy link
Member

VicDeo commented Sep 5, 2017

@hdijkema thanks!
Do you use memcached/redis?

@hdijkema
Copy link

hdijkema commented Sep 5, 2017

I'm using redis since 10.0.2. Had some trouble getting it to work (i.e. any memory caching backend), but that was due to the fact that I ran php 5.6 in apache2 and php 7 on my CLI (of which I wasn't aware). After I synchronized the PHP versions it worked fine.

See also #28777

Maybe the upgrade went partly wrong because of this issue? Although I upgraded using the CLI, so that would be all using php7.

@VicDeo
Copy link
Member

VicDeo commented Sep 6, 2017

Still no idea.

deo@jah-mobile:~/public_html/from909> php occ upgrade -vvv
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
2017-09-06T18:23:12+00:00 Set log level to debug
2017-09-06T18:23:12+00:00 Repair step: Repair MySQL database engine
2017-09-06T18:23:12+00:00 Repair step: Repair MySQL collation
2017-09-06T18:23:12+00:00 Repair info: All tables already have the correct collation -> nothing to do
2017-09-06T18:23:12+00:00 Repair step: Repair SQLite autoincrement
2017-09-06T18:23:12+00:00 Repair step: Repair duplicate entries in oc_lucene_status
2017-09-06T18:23:12+00:00 Repair info: lucene_status table does not exist -> nothing to do
2017-09-06T18:23:12+00:00 Repair step: Upgrade app code from the marketplace
2017-09-06T18:23:12+00:00 Repair warning: Market app is unavailable for updating of apps. Enable with: occ app:enable market
2017-09-06T18:23:12+00:00 Updating database schema
2017-09-06T18:23:15+00:00 Updated database
2017-09-06T18:23:15+00:00 Updating <federatedfilesharing> ...
2017-09-06T18:23:15+00:00 Updated <federatedfilesharing> to 0.3.0
2017-09-06T18:23:15+00:00 Updating <files_pdfviewer> ...
2017-09-06T18:23:15+00:00 Updated <files_pdfviewer> to 0.8.2
2017-09-06T18:23:15+00:00 Updating <files_texteditor> ...
2017-09-06T18:23:15+00:00 Updated <files_texteditor> to 2.2
2017-09-06T18:23:15+00:00 Updating <gallery> ...
2017-09-06T18:23:15+00:00 Updated <gallery> to 16.0.2
2017-09-06T18:23:15+00:00 Updating <provisioning_api> ...
2017-09-06T18:23:15+00:00 Updated <provisioning_api> to 0.5.0
2017-09-06T18:23:15+00:00 Updating <updatenotification> ...
2017-09-06T18:23:15+00:00 Updated <updatenotification> to 0.2.1
2017-09-06T18:23:15+00:00 Updating <federation> ...
2017-09-06T18:23:15+00:00 Updated <federation> to 0.1.0
2017-09-06T18:23:15+00:00 Updating <files> ...
2017-09-06T18:23:15+00:00 Updated <files> to 1.5.1
2017-09-06T18:23:15+00:00 Updating <activity> ...
2017-09-06T18:23:16+00:00 Updated <activity> to 2.3.4
2017-09-06T18:23:16+00:00 Updating <dav> ...
2017-09-06T18:23:17+00:00 Repair step: Fix component of birthday calendars
2017-09-06T18:23:17+00:00 Repair info: 1 birthday calendars updated.
2017-09-06T18:23:17+00:00 Updated <dav> to 0.2.9
2017-09-06T18:23:17+00:00 Updating <files_sharing> ...
2017-09-06T18:23:17+00:00 Updated <files_sharing> to 0.10.0
2017-09-06T18:23:17+00:00 Updating <files_trashbin> ...
2017-09-06T18:23:17+00:00 Updated <files_trashbin> to 0.9.0
2017-09-06T18:23:17+00:00 Updating <files_versions> ...
2017-09-06T18:23:17+00:00 Updated <files_versions> to 1.3.0
2017-09-06T18:23:17+00:00 Updating <comments> ...
2017-09-06T18:23:17+00:00 Updated <comments> to 0.3.0
2017-09-06T18:23:17+00:00 Updating <notifications> ...
2017-09-06T18:23:18+00:00 Updated <notifications> to 0.3.0
2017-09-06T18:23:18+00:00 Updating <systemtags> ...
2017-09-06T18:23:18+00:00 Updated <systemtags> to 0.3.0
2017-09-06T18:23:18+00:00 Repair step: Repair mime types
2017-09-06T18:23:18+00:00 Repair step: Generate ETags for file where no ETag is present.
2017-09-06T18:23:18+00:00 Repair info: ETags have been fixed for 0 files/folders.
2017-09-06T18:23:18+00:00 Repair step: Clean tags and favorites
2017-09-06T18:23:18+00:00 Repair info: 0 tags of deleted users have been removed.
2017-09-06T18:23:18+00:00 Repair info: 0 tags for delete files have been removed.
2017-09-06T18:23:18+00:00 Repair info: 0 tag entries for deleted tags have been removed.
2017-09-06T18:23:18+00:00 Repair info: 0 tags with no entries have been removed.
2017-09-06T18:23:18+00:00 Repair step: Drop old database tables
2017-09-06T18:23:18+00:00 Drop old database tables
2017-09-06T18:23:18+00:00 
                                                    2017-09-06T18:23:18+00:00  Done
 28/28 [============================] 100%2017-09-06T18:23:18+00:00 
2017-09-06T18:23:18+00:00 Repair step: Drop old background jobs
2017-09-06T18:23:18+00:00 Repair step: Remove getetag entries in properties table
2017-09-06T18:23:18+00:00 Repair info: Removed 0 unneeded "{DAV:}getetag" entries from properties table.
2017-09-06T18:23:18+00:00 Repair step: Repair outdated OCS IDs
2017-09-06T18:23:18+00:00 Repair step: Repair invalid shares
2017-09-06T18:23:18+00:00 Repair step: Remove old share propagation app entries
2017-09-06T18:23:18+00:00 Repair step: Fix permissions so avatars can be stored again
2017-09-06T18:23:18+00:00 Fix permissions so avatars can be stored again
                                                    2017-09-06T18:23:18+00:00  Done
 2/2 [============================] 100%2017-09-06T18:23:18+00:00 
2017-09-06T18:23:18+00:00 Repair step: Move user avatars outside the homes to the new location
2017-09-06T18:23:18+00:00 Repair step: Remove shares of a users root folder
2017-09-06T18:23:18+00:00 Repair step: Repair unmerged shares
2017-09-06T18:23:18+00:00 Starting code integrity check...
2017-09-06T18:24:05+00:00 Finished code integrity check
2017-09-06T18:24:05+00:00 Update successful
2017-09-06T18:24:05+00:00 Maintenance mode is kept active
2017-09-06T18:24:05+00:00 Reset log level
deo@jah-mobile:~/public_html/from909> mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 39
Server version: 5.6.37 openSUSE package

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use from909
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> describe oc_share;
+---------------+--------------+------+-----+---------+----------------+
| Field         | Type         | Null | Key | Default | Extra          |
+---------------+--------------+------+-----+---------+----------------+
| id            | int(11)      | NO   | PRI | NULL    | auto_increment |
| share_type    | smallint(6)  | NO   |     | 0       |                |
| share_with    | varchar(255) | YES  |     | NULL    |                |
| uid_owner     | varchar(64)  | NO   |     |         |                |
| uid_initiator | varchar(64)  | YES  |     | NULL    |                |
| parent        | int(11)      | YES  |     | NULL    |                |
| item_type     | varchar(64)  | NO   | MUL |         |                |
| item_source   | varchar(255) | YES  |     | NULL    |                |
| item_target   | varchar(255) | YES  |     | NULL    |                |
| file_source   | int(11)      | YES  | MUL | NULL    |                |
| file_target   | varchar(512) | YES  |     | NULL    |                |
| permissions   | smallint(6)  | NO   |     | 0       |                |
| stime         | bigint(20)   | NO   |     | 0       |                |
| accepted      | smallint(6)  | NO   |     | 0       |                |
| expiration    | datetime     | YES  |     | NULL    |                |
| token         | varchar(32)  | YES  | MUL | NULL    |                |
| mail_send     | smallint(6)  | NO   |     | 0       |                |
| share_name    | varchar(64)  | YES  |     | NULL    |                |
+---------------+--------------+------+-----+---------+----------------+
18 rows in set (0.00 sec)

@PVince81
Copy link
Contributor

PVince81 commented Sep 8, 2017

@VicDeo I suggest trying setting up OC 7 and then upgrading all the way.

But I must say that my personal OC instance exists since OC 4.5 and I'm now on 10.0.3RC1 and didn't have any issues with the introduction of migrations.

I wonder if maybe during the upgrade some migration failed and aborted without displaying an error, and for some reason maybe the upgrade still continued ?!

@PVince81
Copy link
Contributor

I tried simulating an exception within a migration during an upgrade. The upgrade failed properly, so it'S not an issue about a silent failure where migrations aren't all run.

@PVince81
Copy link
Contributor

Did you guys had to run occ upgrade several times in OC 10 for the upgrade to work @dc75la and @hdijkema ?

If yes, then it would get use closer to the potential issue: if an upgrade was run and failed, it is likely that the database was in a "in-between" state where the migrations could not resume properly. But then I don't see why OC would report a successful upgrade without having run all the migrations.

@PVince81 PVince81 modified the milestones: development, planned Sep 18, 2017
@PVince81
Copy link
Contributor

More mysteries from the neighbor ticket, more people having it: #28695.

If there is a situation where migrations are getting skipped, it could explain both tickets. Still need to find out when it is happening and how to reproduce this.

A dump of oc_migrations after a failed upgrade would be very useful.

@PVince81 PVince81 modified the milestones: planned, development Nov 22, 2017
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label needs info is set and there were no updates for 14 days. Feel free to reopen this issue if you deem it appropriate.

@cplewnia
Copy link

Hello,

I experienced this issue as well. In my case I recently became responsible for the administration of an existing owncloud 9.1.4 installation, which someone else set up some time ago. Thus, I do not know what was done to this owncloud before.

I decided to move the installation to a different machine and, then, to upgrade it from owncloud 9.1.4 to 10.0.4 in one step by following the Manual ownCloud Upgrade guide. I did this yesterday. The upgrade was not completely flawless. To be precise: for some reasons (I dont remember and unfortunately have not logged it) it recommended me to perform a filescan which I did. After the update the web interface appeared to be fine and my owncloud desktop client (version 2.3.4 for Windows) was synching with my account without any error. However, others were experiencing problems with the owncloud desktop client's sync. For example, one user reported that he is having 501 internal server errors (version 2.4 for Mac). The users use various operating systems and various client versions.

The owncloud.log contained many lines with:

{ ... ,"message":"Undefined index: share_name at /path/to/owncloud/lib/private/Share20/DefaultShareProvider.php#1002" }

A select * from oc_migrations where version='20170320173955'; yielded:

+------+----------------+
| app  | version        |
+------+----------------+
| core | 20170320173955 |
+------+----------------+
1 row in set (0.00 sec)

The dump of the oc_migration table is as follows:

-- MySQL dump 10.15  Distrib 10.0.31-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: owncloud
-- ------------------------------------------------------
-- Server version       10.0.31-MariaDB-0ubuntu0.16.04.2

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `oc_migrations`
--

DROP TABLE IF EXISTS `oc_migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oc_migrations` (
  `app` varchar(177) COLLATE utf8_bin NOT NULL,
  `version` varchar(14) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`app`,`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `oc_migrations`
--

LOCK TABLES `oc_migrations` WRITE;
/*!40000 ALTER TABLE `oc_migrations` DISABLE KEYS */;
INSERT INTO `oc_migrations` VALUES ('core','20170101010100'),('core','20170101215145'),('core','20170111103310'),('core','20170213215145'),('core','20170214112458'),('core','20170221114437'),('core','20170221121536'),('core','20170315173825'),('core','20170320173955'),('core','20170418154659'),('core','20170516100103'),('core','20170526104128'),('core','20170605143658'),('core','20170711191432'),('core','20170804201253'),('core','20170928120000'),('core','20171026130750'),('dav','20170116150538'),('dav','20170116170538'),('dav','20170202213905'),('dav','20170202220512'),('dav','20170427182800'),('dav','20170519091921'),('dav','20170526100342'),('dav','20170711193427'),('dav','20170927201245'),('federatedfilesharing','20170804201125'),('federatedfilesharing','20170804201253'),('files_external','20170814051424'),('files_sharing','20170804201125'),('files_sharing','20170804201253'),('files_sharing','20170830112305'),('files_trashbin','20170804201125'),('files_trashbin','20170804201253'),('notifications','20170801085340'),('notifications','20170801152524');
/*!40000 ALTER TABLE `oc_migrations` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-01-11  8:49:45

@pquerner
Copy link

pquerner commented Jan 23, 2018

The database field was missing for us too, after migration from 9.1.6 to 10.0.4.
We followed the manual upgrade "power user" and it went smooth. Didnt take but a minute.

We added the field manually and #28068 (comment) is not visible anylonger. So far we dont see other failures. I didnt check for same failures like cplewenia is having. (Before and after our "fix" to add the missing database field manually)

@PVince81
Copy link
Contributor

PVince81 commented Feb 7, 2018

Question: did you guys ever have a failed upgrade ? If yes, did you not revert the database to the backup state ?

It is likely that some migrations believe that a table already exists due to previous/partial migration and now they do not operate at all. Would be good to confirm this.

@JC10a
Copy link
Author

JC10a commented Feb 7, 2018 via email

@PVince81 PVince81 modified the milestones: QA, development Feb 13, 2018
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@PVince81
Copy link
Contributor

Please note that reverting the OC code to an older version without reverting the database to said version is not supported. The database needs to be in the previous pre-upgrade state when rolling back.

If the problem happened for you the first time without any rollback, please reopen.

@voroyam
Copy link
Contributor

voroyam commented May 14, 2018

Error reported again on central:

OS: Gentoo
ownCloud Update: upgrade through package-manager
PHP 7.1
Apache2

Doctrine\DBAL\Schema\SchemaException: 
There is no column with name 'fileid' on table 'oc_properties'.
Update failed

https://central.owncloud.org/t/upgrade-from-9-x-to-10-0-7-fail-there-is-no-column-with-name-fileid-on-table-oc-properties/12837

copied from this #29061 (comment)
becaus it's closed

@voroyam voroyam reopened this May 14, 2018
@PVince81 PVince81 modified the milestones: 10.0.8, backlog Jun 11, 2018
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@lock
Copy link

lock bot commented Jul 30, 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 Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug-analysis p2-high Escalation, on top of current planning, release blocker sev3-medium status/STALE
Projects
None yet
Development

No branches or pull requests

9 participants