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

Several issues during upgrade from OC 8.2.5 to NC 9 #120

Closed
aronovgj opened this issue Jun 15, 2016 · 12 comments
Closed

Several issues during upgrade from OC 8.2.5 to NC 9 #120

aronovgj opened this issue Jun 15, 2016 · 12 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@aronovgj
Copy link

aronovgj commented Jun 15, 2016

Steps to reproduce

  • Backup owncloud folder
  • Remove owncloud folder
  • Unzip Nextcloud
  • Fix permissions
  • Restore config.php
  • Change nginx root to match Nextcloud

Expected behaviour

Everything should work properly, especially files, calendar and contacts

Actual behaviour

I'm running into several issues that I already had upgrading to owncloud 9. The whole story chronologically further below.

Server configuration

Operating system:
Mint 17.3

Web server:
nginx 1.4.6 (in test environment but 1.11.1 in productive environment. No difference)

Database:
MySQL 5.5.49

PHP version:
PHP 5.5.9

Nextcloud version: (see Nextcloud admin page)
9

Updated from an older Nextcloud/ownCloud or fresh install:
Owncloud 8.2.5

Where did you install Nextcloud from:
https://download.nextcloud.com/server/releases/nextcloud-9.0.50.zip

Signing status (Nextcloud 9.0 and above):

No errors have been found.

List of activated apps:

Enabled:
  - activity: 2.2.1
  - calendar: 0.8.2
  - contacts: 0.5.0.0
  - direct_menu: 0.8.0
  - documents: 0.11.1
  - files: 1.4.4
  - files_external: 0.5.2
  - files_pdfviewer: 0.8
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - firstrunwizard: 1.1
  - galleryplus: 15.0.0
  - logreader: 1.1.2
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - templateeditor: 0.1
  - updater: 0.6
  - user_external: 0.4

The content of config/config.php:

 "system": {
        "instanceid": "ocro13eb0f5c",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost"
        ],
        "datadirectory": "\/home\/me\/owncloud\/data",
        "overwrite.cli.url": "http:\/\/xxx.xxx.xxx.xxx",
        "overwriteprotocol": "",
        "dbtype": "mysql",
        "version": "9.0.50.0",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "filelocking.enabled": "true",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "CEST",
        "installed": true,
        "maintenance": false,
        "asset-pipeline.enabled": false,
        "theme": "",
        "loglevel": 1,
        "logfile": "\/var\/log\/owncloud.log",
        "log_rotate_size": 10485760,
        "trashbin_retention_obligation": "auto",
        "mail_from_address": "me",
        "mail_smtpmode": "smtp",
        "mail_domain": "me.net",
        "mail_smtpsecure": "ssl",
        "mail_smtpport": "465",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "mail.me.net",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "ldapIgnoreNamingRules": false
    },

/etc/nginx/conf.d/default.conf

upstream php-handler {
 # server 127.0.0.1:9000;
  server unix:/var/run/php5-fpm.sock;
}

server {
  listen 80;
  server_name localhost;
  # enforce https
  return 301 https://$server_name$request_uri;
}


server {
  listen 443 ssl;
  server_name localhost;

  ssl_certificate /etc/apache2/ssl/apache.crt;
  ssl_certificate_key /etc/apache2/ssl/apache.key;

  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_prefer_server_ciphers on;
  # ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  ssl_stapling on;
  ssl_stapling_verify on;
  resolver 8.8.8.8 8.8.4.4 valid=300s;


  # Add headers to serve security related headers
  add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  add_header X-Content-Type-Options nosniff;
  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-XSS-Protection "1; mode=block";
  add_header X-Robots-Tag none;

  # Path to the root of your installation
  root /var/www/nextcloud;
  # set max upload size
  client_max_body_size 10G;
  fastcgi_buffers 64 4K;

  # Disable gzip to avoid the removal of the ETag header
  gzip off;

  # Uncomment if your server is build with the ngx_pagespeed module
  # This module is currently not supported.
  #pagespeed off;

  index index.php;
  error_page 403 /core/templates/403.php;
  error_page 404 /core/templates/404.php;

  rewrite ^/.well-known/carddav /remote.php/carddav/ permanent;
  rewrite ^/.well-known/caldav /remote.php/caldav/ permanent;

  # The following 2 rules are only needed for the user_webfinger app.
  # Uncomment it if you're planning to use this app.
  #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

  location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
  }

  location ~ ^/(build|tests|config|lib|3rdparty|templates|data)/ {
    deny all;
  }

  location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
    deny all;
  }

  location / {

    rewrite ^/remote/(.*) /remote.php last;

    rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

    try_files $uri $uri/ =404;
  }

  # cache_purge (with $http_cookies we have unique keys for the user)
  fastcgi_cache_key $http_cookie$request_method$host$request_uri;
  fastcgi_cache_use_stale error timeout invalid_header http_500;
  fastcgi_ignore_headers Cache-Control Expires Set-Cookie;

  location ~ \.php(?:$|/) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param HTTPS on;
    fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
    fastcgi_pass php-handler;
    fastcgi_intercept_errors on;
    fastcgi_read_timeout 300;

    if (!-f $document_root$fastcgi_script_name) {
        return 404;
    }

  }
  # Adding the cache control header for js and css files
  # Make sure it is BELOW the location ~ \.php(?:$|/) { block
  location ~* \.(?:css|js)$ {
    add_header Cache-Control "public, max-age=7200";
    # Add headers to serve security related headers
    add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    # Optional: Don't log access to assets
    access_log off;
  }

  # Optional: Don't log access to other assets
  location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|swf)$ {
    access_log off;
  }
}

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

The story

After doing all the "steps to reproduce" stuff I do this:

sudo -u www-data php /var/www/nextcloud/occ upgrade
I get errors looking much like here:
http://github.com/owncloud/core/issues/23867

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/apcu.so' - /usr/lib/php5/20121212/apcu.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/imagick.so' - /usr/lib/php5/20121212/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/memcached.so' - /usr/lib/php5/20121212/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/redis.so' - /usr/lib/php5/20121212/redis.so: cannot open shared object file: No such file or directory in Unknown on line 0
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
Set log level to debug
Turned on maintenance mode
{"reqId":"q34bGPnLwEoynKZcDODk","remoteAddr":"","app":"core","message":"starting upgrade from 8.2.5.2 to 9.0.50.0","level":0,"time":"2016-06-14T15:09:29+02:00","method":"--","url":"--","user":"--"}
Checking whether the database schema can be updated (this can take a long time depending on the database size)
Checked database schema update
Checking updates of apps
Checked database schema update for apps
Updating database schema
Updated database
Disabled 3rd-party app: calendar
Disabled 3rd-party app: contacts
Disabled 3rd-party app: direct_menu
Disabled 3rd-party app: documents
Disabled 3rd-party app: galleryplus
Disabled 3rd-party app: logreader
Disabled 3rd-party app: updater
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 0.8.1
Update 3rd-party app: calendar
Update 3rd-party app: contacts
Update 3rd-party app: direct_menu
Update 3rd-party app: documents
Update 3rd-party app: galleryplus
Update 3rd-party app: logreader
{"reqId":"q34bGPnLwEoynKZcDODk","remoteAddr":"","app":"federation","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\TableExistsException\",\"Message\":\"An exception occurred while executing 'CREATE TABLE `oc_trusted_servers` (`id` INT AUTO_INCREMENT NOT NULL, `url` VARCHAR(512) NOT NULL COMMENT 'Url of trusted server', `url_hash` VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'sha1 hash of the url without the protocol', `token` VARCHAR(128) DEFAULT NULL COMMENT 'token used to exchange the shared secret', `shared_secret` VARCHAR(256) DEFAULT NULL COMMENT 'shared secret used to authenticate', `status` INT DEFAULT 2 NOT NULL COMMENT 'current status of the connection', `sync_token` VARCHAR(512) DEFAULT NULL COMMENT 'cardDav sync token', UNIQUE INDEX url_hash (`url_hash`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\\n\\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_trusted_servers' already exists\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(116): Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(945): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'CREATE TABLE `o...')\\n#2 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/db\\\/mdb2schemamanager.php(167): Doctrine\\\\DBAL\\\\Connection->query('CREATE TABLE `o...')\\n#3 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/db\\\/mdb2schemamanager.php(70): OC\\\\DB\\\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\\\DBAL\\\\Schema\\\\Schema))\\n#4 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/db.php(172): OC\\\\DB\\\\MDB2SchemaManager->createDbFromStructure('\\\/var\\\/www\\\/nextcl...')\\n#5 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/installer.php(586): OC_DB::createDbFromStructure('\\\/var\\\/www\\\/nextcl...')\\n#6 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/installer.php(556): OC_Installer::installShippedApp('federation')\\n#7 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/updater.php(334): OC_Installer::installShippedApps(true)\\n#8 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/updater.php(212): OC\\\\Updater->doUpgrade('9.0.50.0', '8.2.5.2')\\n#9 \\\/var\\\/www\\\/nextcloud\\\/core\\\/command\\\/upgrade.php(246): OC\\\\Updater->upgrade()\\n#10 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Command\\\/Command.php(259): OC\\\\Core\\\\Command\\\\Upgrade->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#11 \\\/var\\\/www\\\/nextcloud\\\/core\\\/command\\\/base.php(158): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#12 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(840): OC\\\\Core\\\\Command\\\\Base->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#13 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(192): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(OC\\\\Core\\\\Command\\\\Upgrade), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#14 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(123): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#15 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/console\\\/application.php(145): Symfony\\\\Component\\\\Console\\\\Application->run(NULL, NULL)\\n#16 \\\/var\\\/www\\\/nextcloud\\\/console.php(88): OC\\\\Console\\\\Application->run()\\n#17 \\\/var\\\/www\\\/nextcloud\\\/occ(11): require_once('\\\/var\\\/www\\\/nextcl...')\\n#18 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":49}","level":3,"time":"2016-06-14T15:10:39+02:00","method":"--","url":"--","user":"--"}
federation: An exception occurred while executing 'CREATE TABLE `oc_trusted_servers` (`id` INT AUTO_INCREMENT NOT NULL, `url` VARCHAR(512) NOT NULL COMMENT 'Url of trusted server', `url_hash` VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'sha1 hash of the url without the protocol', `token` VARCHAR(128) DEFAULT NULL COMMENT 'token used to exchange the shared secret', `shared_secret` VARCHAR(256) DEFAULT NULL COMMENT 'shared secret used to authenticate', `status` INT DEFAULT 2 NOT NULL COMMENT 'current status of the connection', `sync_token` VARCHAR(512) DEFAULT NULL COMMENT 'cardDav sync token', UNIQUE INDEX url_hash (`url_hash`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_trusted_servers' already exists
{"reqId":"q34bGPnLwEoynKZcDODk","remoteAddr":"","app":"dav","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\TableExistsException\",\"Message\":\"An exception occurred while executing 'CREATE TABLE `oc_addressbooks` (`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, `principaluri` VARCHAR(255) DEFAULT NULL, `displayname` VARCHAR(255) DEFAULT NULL, `uri` VARCHAR(255) DEFAULT NULL, `description` VARCHAR(255) DEFAULT NULL, `synctoken` INT UNSIGNED DEFAULT 1 NOT NULL, UNIQUE INDEX addressbook_index (`principaluri`, `uri`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\\n\\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_addressbooks' already exists\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(116): Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(945): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'CREATE TABLE `o...')\\n#2 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/db\\\/mdb2schemamanager.php(167): Doctrine\\\\DBAL\\\\Connection->query('CREATE TABLE `o...')\\n#3 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/db\\\/mdb2schemamanager.php(70): OC\\\\DB\\\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\\\DBAL\\\\Schema\\\\Schema))\\n#4 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/db.php(172): OC\\\\DB\\\\MDB2SchemaManager->createDbFromStructure('\\\/var\\\/www\\\/nextcl...')\\n#5 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/installer.php(586): OC_DB::createDbFromStructure('\\\/var\\\/www\\\/nextcl...')\\n#6 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/installer.php(556): OC_Installer::installShippedApp('dav')\\n#7 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/updater.php(334): OC_Installer::installShippedApps(true)\\n#8 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/updater.php(212): OC\\\\Updater->doUpgrade('9.0.50.0', '8.2.5.2')\\n#9 \\\/var\\\/www\\\/nextcloud\\\/core\\\/command\\\/upgrade.php(246): OC\\\\Updater->upgrade()\\n#10 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Command\\\/Command.php(259): OC\\\\Core\\\\Command\\\\Upgrade->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#11 \\\/var\\\/www\\\/nextcloud\\\/core\\\/command\\\/base.php(158): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#12 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(840): OC\\\\Core\\\\Command\\\\Base->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#13 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(192): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(OC\\\\Core\\\\Command\\\\Upgrade), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#14 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(123): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#15 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/console\\\/application.php(145): Symfony\\\\Component\\\\Console\\\\Application->run(NULL, NULL)\\n#16 \\\/var\\\/www\\\/nextcloud\\\/console.php(88): OC\\\\Console\\\\Application->run()\\n#17 \\\/var\\\/www\\\/nextcloud\\\/occ(11): require_once('\\\/var\\\/www\\\/nextcl...')\\n#18 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":49}","level":3,"time":"2016-06-14T15:10:39+02:00","method":"--","url":"--","user":"--"}
dav: An exception occurred while executing 'CREATE TABLE `oc_addressbooks` (`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, `principaluri` VARCHAR(255) DEFAULT NULL, `displayname` VARCHAR(255) DEFAULT NULL, `uri` VARCHAR(255) DEFAULT NULL, `description` VARCHAR(255) DEFAULT NULL, `synctoken` INT UNSIGNED DEFAULT 1 NOT NULL, UNIQUE INDEX addressbook_index (`principaluri`, `uri`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_addressbooks' already exists
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Reset log level
{"reqId":"q34bGPnLwEoynKZcDODk","remoteAddr":"","app":"PHP","message":"PHP Startup: Unable to load dynamic library '\/usr\/lib\/php5\/20121212\/redis.so' - \/usr\/lib\/php5\/20121212\/redis.so: cannot open shared object file: No such file or directory at Unknown#0","level":3,"time":"2016-06-14T15:10:44+02:00","method":"--","url":"--","user":"--"}

I tried to drop the tables that are mentioned in the exception but then it just throws the same exceptions on other tables.
I just ignore it as suggested on github.

Next thing is this:
http://github.com/owncloud/core/issues/23610

After doing this I can access my files:

update oc_appconfig set configvalue = 'dav/appinfo/v1/caldav.php' where appid = 'core' and configkey = 'remote_caldav';
update oc_appconfig set configvalue = 'dav/appinfo/v1/caldav.php' where appid = 'core' and configkey = 'remote_calendar';
update oc_appconfig set configvalue = 'dav/appinfo/v1/carddav.php' where appid = 'core' and configkey = 'remote_carddav';
update oc_appconfig set configvalue = 'dav/appinfo/v1/carddav.php' where appid = 'core' and configkey = 'remote_contacts';
update oc_appconfig set configvalue = 'dav/appinfo/v1/webdav.php' where appid = 'core' and configkey = 'remote_files';
update oc_appconfig set configvalue = 'dav/appinfo/v1/webdav.php' where appid = 'core' and configkey = 'remote_webdav';
update oc_appconfig set configvalue = 'dav/appinfo/v2/remote.php' where appid = 'core' and configkey = 'remote_dav';
update oc_appconfig set configvalue = 'dav/appinfo/v1/publicwebdav.php' where appid = 'core' and configkey = 'public_webdav';
update oc_appconfig set configvalue = 'dav/appinfo/v2/remote.php' where appid = 'core' and configkey = 'remote_dav';

MySQL looks like this afterwards:
select * from oc_appconfig where configvalue like '%appinfo%';

+-------+-----------------+---------------------------------+
| appid | configkey       | configvalue                     |
+-------+-----------------+---------------------------------+
| core  | public_webdav   | dav/appinfo/v1/publicwebdav.php |
| core  | remote_caldav   | dav/appinfo/v1/caldav.php       |
| core  | remote_calendar | dav/appinfo/v1/caldav.php       |
| core  | remote_carddav  | dav/appinfo/v1/carddav.php      |
| core  | remote_contacts | dav/appinfo/v1/carddav.php      |
| core  | remote_files    | dav/appinfo/v1/webdav.php       |
| core  | remote_webdav   | dav/appinfo/v1/webdav.php       |
+-------+-----------------+---------------------------------+

After activating calendar app I get this when i try to access it:

2016/06/14 15:24:26 [error] 3383#0: *64 upstream sent invalid status "0" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "PROPFIND /remote.php/dav HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost"

Thats how it looks like:
http://www.pic-upload.de/view-30937703/2.png.html
the circle won't stop spinning.

After activating contacts I get this when I try to access it:

2016/06/14 15:33:46 [error] 3391#0: *143 upstream sent invalid status "0" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /remote.php/dav/addressbooks HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost"
2016/06/14 15:33:46 [error] 3391#0: *109 upstream sent invalid status "0" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "PROPFIND /remote.php/dav/addressbooks HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost"

Thats how it looks like:
http://www.pic-upload.de/view-30937702/1.png.html

The calendar/contacts issue looks similar to other issues but not quite the same. For example some can not see only one calendar. I can't see any calendars at all.

@LukasReschke LukasReschke added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jun 15, 2016
@schiessle
Copy link
Member

The oc_trusted_servers was introduced with ownCloud/Nextcloud 9. So it can't already exists before you started the migration. This also explains while the same error happens on the next table if you drop oc_trusted_servers. It sounds like for some reasons the migration script tries to create the new tables multiple times... Never saw this before.

@aronovgj
Copy link
Author

aronovgj commented Jun 16, 2016

It may be that I forgot to restore the db after the upgrade failed the first time, when OC9 was just released. That was quite a long time ago, so I don't remember. If we can just ignore the exceptions (as said in the oc issue that I linked), then so be it. There is this calendar and contacts problem though that really prevents me from upgrading.
If you need more info, please tell me.

@LukasReschke
Copy link
Member

The problems with upstream sent invalid status is likely caused by your NGINX config, please update it to match the required one for Nextcloud / ownCloud 9. That should solve your issue.

Please use https://help.nextcloud.com if you require more help on that.

@aronovgj
Copy link
Author

Thats my config now: the error in the log is still the same and I still can not access calendar or contacts.

upstream php-handler {
 # server 127.0.0.1:9000;
  server unix:/var/run/php5-fpm.sock;
}

server {
  listen 80;
  server_name localhost;
  # enforce https
  return 301 https://$server_name$request_uri;
}


server {
  listen 443 ssl;
  server_name localhost;


  ssl_certificate /etc/apache2/ssl/apache.crt;
  ssl_certificate_key /etc/apache2/ssl/apache.key;

      # Add headers to serve security related headers
    # Before enabling Strict-Transport-Security headers please read into this
    # topic first.
    # add_header Strict-Transport-Security "max-age=15768000;
    # includeSubDomains; preload;";
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;

    # Path to the root of your installation
    root /var/www/nextcloud/;

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    # The following 2 rules are only needed for the user_webfinger app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
    # last;

    location = /.well-known/carddav { return 301
     $scheme://$host/remote.php/dav; }
    location = /.well-known/caldav { return 301
     $scheme://$host/remote.php/dav; }

    location /.well-known/acme-challenge { }

    # set max upload size
    client_max_body_size 512M;
    fastcgi_buffers 64 4K;

    # Disable gzip to avoid the removal of the ETag header
    gzip off;

    # Uncomment if your server is build with the ngx_pagespeed module
    # This module is currently not supported.
    #pagespeed off;

    error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;

    location / {
        rewrite ^ /index.php$uri;
    }

    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
        deny all;
    }
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
        deny all;
    }

    location ~
    ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        #Avoid sending the security headers twice
        fastcgi_param modHeadersAvailable true;
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;
        fastcgi_intercept_errors on;
        #fastcgi_request_buffering off;
    }

    location ~ ^/(?:updater|ocs-provider)(?:$|/) {
        try_files $uri/ =404;
        index index.php;
    }

    # Adding the cache control header for js and css files
    # Make sure it is BELOW the PHP block
    location ~* \.(?:css|js)$ {
        try_files $uri /index.php$uri$is_args$args;
        add_header Cache-Control "public, max-age=7200";
        # Add headers to serve security related headers (It is intended to
        # have those duplicated to the ones above)
        # Before enabling Strict-Transport-Security headers please read into
        # this topic first.
        # add_header Strict-Transport-Security "max-age=15768000;
        #  includeSubDomains; preload;";
        add_header X-Content-Type-Options nosniff;
        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        # Optional: Don't log access to assets
        access_log off;
    }

    location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
        try_files $uri /index.php$uri$is_args$args;
        # Optional: Don't log access to other assets
        access_log off;
    }
}

Nginx told me however that it does not know the directive fastcgi_request_buffering. I had to disable it.

unknown directive "fastcgi_request_buffering" in /etc/nginx/conf.d/default.conf:93

To me it seems like a Mysql issue.

@aronovgj
Copy link
Author

Also I don't feel like the forum is very helpful:
https://help.nextcloud.com/t/several-issues-known-from-oc/565

@4oo4
Copy link

4oo4 commented Jun 17, 2016

I'm also having this issue, I'm really confused by it.

I upgraded successfully from OC 8.2.5 to NC 9.0, and as part of that the Calendar and Tasks apps got upgraded. I had this working perfectly right after the upgrade last night, but now I'm unable to access any of my calendar/tasks data through the web app this morning. For some reason I can still access it all normally through my DAV clients.

Would this have anything to do with these apps being merged into the core? I'm just really confused why it was working for me and then stopped. I was thinking this was a part of those apps themselves getting upgrades, before remembering that they were working OK after they were upgraded.

Luckily I still have my OC instance and don't have much new data in NC, so I'll try to run the upgrade again and try to figure out what causes it to stop working.

Is there a proper way to migrate those two apps over? I was reading about the occ commands for dav:migrate-calendars and wasn't sure if that might have been something that I need to do. I ran that and it didn't seem to have any effect.

@LukasReschke
Copy link
Member

LukasReschke commented Jun 17, 2016

I upgraded successfully from OC 8.2.5 to NC 9.0, and as part of that the Calendar and Tasks apps got upgraded. I had this working perfectly right after the upgrade last night, but now I'm unable to access any of my calendar/tasks data through the web app this morning. For some reason I can still access it all normally through my DAV clients.

In case of calendar: Have you marked the calendar as active on the left by clicking on it?

@4oo4
Copy link

4oo4 commented Jun 17, 2016

Do you mean activating the app in the Admin Apps panel? I did re-enable all my apps after the upgrade. Unless you're referring to clicking to show the calendars within the app? I can't see my calendars to do that, all I get is the loading icon.

@aronovgj
Copy link
Author

migrate-calendars did not help me, already tried it.

@tessus
Copy link

tessus commented Aug 2, 2016

Any news on this topic? I've been wanting to upgrade to a newer version as well, but I have been reading up on this topic and the contacts/calendar apps are just not working after upgrading 8.2.x to a newer oc or nc (thus I'm still on oc 8.2.7).

Also the newer contacts/calendar apps lack basic functionality and are pretty much unusable. I did a writeup and gave ample feedback here owncloud/contacts#435, but have been ignored and shot down by the oc devs.

@aronovgj
Copy link
Author

@tessus The non-solution was to export contacts and calendar, delete the whole database, setup a fresh nextcloud, recreate the database by syncing everything to the server and import calendar and contacts. That was possible because only 3 users are using it.

@tessus
Copy link

tessus commented Oct 11, 2016

@aronovgj Unfortunately I don't have that option. I have to many users.

I also tried (for testing purposes) to export from oc 8.2.7 into a vcf file and import it on nextloud 10.0.1. The result was a mess. The names are mostly correct, but the addresses are screwed up, so this wouldn't even be a solution, if I had only one user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

5 participants