core icon indicating copy to clipboard operation
core copied to clipboard

Main page returns 404 Not Found after upgrading to 9.0.2-1.1

Open dniku opened this issue 10 years ago • 13 comments

Steps to reproduce

  1. On Debian Jessie, perform the following upgrade: Upgrade: owncloud-deps-php5:armhf (9.0.1-3.1, 9.0.2-1.1), owncloud:armhf (9.0.1-3.1, 9.0.2-1.1), owncloud-files:armhf (9.0.1-1.1, 9.0.2-1.1)
  2. cd /var/www/owncloud && sudo -u www-data ./occ upgrade
  3. sudo vim config/config.php and remove the line maintenance => true
  4. Navigate to the main page in your browser and see Error 404.

Server configuration

Operating system: fully upgraded Debian Jessie ARM:

$ uname -srv
Linux 3.10.80 #1 SMP PREEMPT Sat Jun 20 10:47:49 GMT 2015

Web server:

$ sudo apachectl -V
Server version: Apache/2.4.17 (Debian)

Database:

$ mysql --version
mysql  Ver 15.1 Distrib 10.0.23-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2

PHP version:

$ php --version
PHP 5.6.20-0+deb8u1 (cli) (built: Apr 27 2016 18:21:41) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

ownCloud version: 9.0.2-1.1 from Debian repository

Updated from an older ownCloud or fresh install: updated

Update log:

$ sudo aptitude update && sudo aptitude upgrade
Ign http://ftp.ru.debian.org jessie InRelease
Hit http://ftp.ru.debian.org jessie Release.gpg                                                    
Hit http://ftp.ru.debian.org jessie Release                                                        
Get: 1 http://ftp.debian.org jessie-updates InRelease [142 kB]                                     
Ign http://download.owncloud.org  InRelease                                                                                    
Hit http://ftp.ru.debian.org jessie/main armhf Packages                                                       
Hit http://security.debian.org jessie/updates InRelease                          
Hit http://download.owncloud.org  Release.gpg
Hit http://ftp.ru.debian.org jessie/contrib armhf Packages
Hit http://ftp.ru.debian.org jessie/non-free armhf Packages                          
Hit http://ftp.ru.debian.org jessie/contrib Translation-en                           
Hit http://ftp.ru.debian.org jessie/main Translation-en                              
Hit http://download.owncloud.org  Release                                            
Hit http://ftp.ru.debian.org jessie/non-free Translation-en    
Get: 2 http://ftp.debian.org jessie-updates/main armhf Packages/DiffIndex [3472 B]
Get: 3 http://ftp.debian.org jessie-updates/contrib armhf Packages [32 B]
Get: 4 http://ftp.debian.org jessie-updates/non-free armhf Packages/DiffIndex [736 B]   
Get: 5 http://ftp.debian.org jessie-updates/contrib Translation-en [14 B]
Get: 6 http://ftp.debian.org jessie-updates/main Translation-en/DiffIndex [1720 B]
Get: 7 http://ftp.debian.org jessie-updates/non-free Translation-en/DiffIndex [736 B]
Hit http://security.debian.org jessie/updates/main armhf Packages
Hit http://security.debian.org jessie/updates/contrib armhf Packages
Hit http://download.owncloud.org  Packages   
Hit http://security.debian.org jessie/updates/non-free armhf Packages
Hit http://security.debian.org jessie/updates/contrib Translation-en
Hit http://security.debian.org jessie/updates/main Translation-en
Hit http://security.debian.org jessie/updates/non-free Translation-en
Ign http://download.owncloud.org  Translation-en
Fetched 149 kB in 12s (11.8 kB/s)                                                                                                                                           

The following packages will be upgraded: 
  owncloud owncloud-deps-php5 owncloud-files 
3 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 19.7 MB of archives. After unpacking 130 kB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://download.owncloud.org/download/repositories/stable/Debian_8.0/  owncloud-files 9.0.2-1.1 [19.7 MB]
Get: 2 http://download.owncloud.org/download/repositories/stable/Debian_8.0/  owncloud-deps-php5 9.0.2-1.1 [4248 B]                                                         
Get: 3 http://download.owncloud.org/download/repositories/stable/Debian_8.0/  owncloud 9.0.2-1.1 [2388 B]                                                                   
Fetched 19.7 MB in 7s (2495 kB/s)                                                                                                                                           
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "ru_RU.UTF-8",
        LC_MONETARY = "ru_RU.UTF-8",
        LC_COLLATE = "ru_RU.UTF-8",
        LC_ADDRESS = "fr_FR.UTF-8",
        LC_TELEPHONE = "fr_FR.UTF-8",
        LC_MESSAGES = "POSIX",
        LC_NAME = "fr_FR.UTF-8",
        LC_MEASUREMENT = "ru_RU.UTF-8",
        LC_IDENTIFICATION = "fr_FR.UTF-8",
        LC_NUMERIC = "ru_RU.UTF-8",
        LC_PAPER = "fr_FR.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 50178 files and directories currently installed.)
Preparing to unpack .../owncloud-files_9.0.2-1.1_all.deb ...
Unpacking owncloud-files (9.0.2-1.1) over (9.0.1-1.1) ...
Preparing to unpack .../owncloud-deps-php5_9.0.2-1.1_all.deb ...
owncloud-deps-php5: occ maintenance:mode --on
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
Maintenance mode enabled
Unpacking owncloud-deps-php5 (9.0.2-1.1) over (9.0.1-3.1) ...
Conf owncloud already disabled
Preparing to unpack .../owncloud_9.0.2-1.1_all.deb ...
Unpacking owncloud (9.0.2-1.1) over (9.0.1-3.1) ...
Setting up owncloud-files (9.0.2-1.1) ...
Setting up owncloud-deps-php5 (9.0.2-1.1) ...
Enabling conf owncloud.
To activate the new configuration, you need to run:
  service apache2 reload
apache2_invoke rewrite: already enabled
apache2_invoke owncloud: already enabled
Leaving server in maintenance mode. Please run occ upgrade manually.

See https://doc.owncloud.org/server/9.0/admin_manual/maintenance/upgrade.html

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
Maintenance mode enabled
Setting up owncloud (9.0.2-1.1) ...

Current status: 0 (-3) upgradable.

$ sudo -u www-data ./occ upgrade
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
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: tasks
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 0.8.1
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Reset log level

Where did you install ownCloud from:

$ cat /etc/apt/sources.list.d/owncloud.list 
deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /

Signing status (ownCloud 9.0 and above): what is it?

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.

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
$ sudo -u www-data php occ app:list
Enabled:
  - activity: 2.2.1
  - comments: 0.2
  - dav: 0.1.6
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_pdfviewer: 0.8.1
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 14.5.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
Disabled:
  - calendar
  - contacts
  - encryption
  - external
  - files_external
  - tasks
  - user_external
  - user_ldap

The content of config/config.php:

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
$ sudo -u www-data php occ config:list system
{
    "system": {
        "instanceid": "** EDITED **",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            ** EDITED **
        ],
        "datadirectory": "** EDITED **",
        "overwrite.cli.url": "https:\/\/localhost",
        "dbtype": "mysql",
        "version": "9.0.2.2",
        "installed": true,
        "forcessl": true,
        "mail_smtpmode": "php",
        "loglevel": 0,
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "theme": "",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "** EDITED **",
        "mail_domain": "** EDITED **",
        "updatechecker": false,
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "trashbin_retention_obligation": "auto"
    }
}

Are you using external storage, if yes which one: only an external hard drive

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Chrome Version 50.0.2661.86 (64-bit)

Operating system: Kubuntu 16.04

Logs

Web server error log

error.log contains nothing relevant. access.log:

192.168.1.1 - - [09/May/2016:16:05:21 +0300] "GET /owncloud/index.php/ HTTP/1.1" 302 843 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36"
domain.zone:443 192.168.1.1 - - [09/May/2016:16:05:21 +0300] "GET /owncloud/index.php/ HTTP/1.1" 302 843 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36"
192.168.1.1 - - [09/May/2016:16:05:22 +0300] "GET /owncloud/apps/files/ HTTP/1.1" 404 580 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36"
domain.zone:443 192.168.1.1 - - [09/May/2016:16:05:22 +0300] "GET /owncloud/apps/files/ HTTP/1.1" 404 580 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36"

ownCloud log (data/owncloud.log)

Nothing relevant.

Browser log

Nothing relevant.

dniku avatar May 09 '16 13:05 dniku

Can you post your .htaccess file?

nickvergessen avatar May 09 '16 14:05 nickvergessen

If I understand correctly that you mean the one in /var/www/owncloud/, here it is:

$ cat /var/www/owncloud/.htaccess 
<IfModule mod_headers.c>
  <IfModule mod_setenvif.c>
    <IfModule mod_fcgid.c>
       SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
       RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
       SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
  </IfModule>

  <IfModule mod_env.c>
    # Add security and privacy related headers
    Header set X-Content-Type-Options "nosniff"
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Robots-Tag "none"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-Download-Options "noopen"
    Header set X-Permitted-Cross-Domain-Policies "none"
    SetEnv modHeadersAvailable true
  </IfModule>

  # Add cache control for CSS and JS files
  <FilesMatch "\.(css|js)$">
    Header set Cache-Control "max-age=7200, public"
  </FilesMatch>
</IfModule>
<IfModule mod_php5.c>
  php_value upload_max_filesize 513M
  php_value post_max_size 513M
  php_value memory_limit 512M
  php_value mbstring.func_overload 0
  php_value always_populate_raw_post_data -1
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_php7.c>
  php_value upload_max_filesize 513M
  php_value post_max_size 513M
  php_value memory_limit 512M
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]

  # Rewrite rules for `front_controller_active`
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$
  RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  RewriteCond %{REQUEST_FILENAME} !/remote.php
  RewriteCond %{REQUEST_FILENAME} !/public.php
  RewriteCond %{REQUEST_FILENAME} !/cron.php
  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  RewriteCond %{REQUEST_FILENAME} !/status.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  RewriteCond %{REQUEST_FILENAME} !/updater/
  RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
</IfModule>
<IfModule mod_mime.c>
  AddType image/svg+xml svg svgz
  AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
  ModPagespeed Off
</IfModule>
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php
<IfModule mod_rewrite.c>
  RewriteRule . index.php [PT,E=PATH_INFO:$1]
  RewriteBase /
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
</IfModule>

dniku avatar May 09 '16 15:05 dniku

I'd like to emphasize that when I navigate to

https://domain.zone/owncloud

I am redirected to

https://domain.zone/owncloud/apps/files/

and that's where Apache throws Not Found: The requested URL /index.php was not found on this server..

Indeed, there is no index.php in the apps/files directory either on my server or in this repo.

dniku avatar May 09 '16 22:05 dniku

There are reports of HTTP 403, not 404, in the forum.

Is there at least a hotfix that can bring my installation back to life for the time being?

dniku avatar May 09 '16 22:05 dniku

@Pastafarianist

You have a wrong configured overwrite.cli.url leading to a broken RewriteBase causing this issue.

See https://github.com/owncloud/core/issues/24426#issuecomment-216814100 how to fix your config.

@de-live-gdev

https://owncloud.org/faq/#upgradeyet

ghost avatar May 10 '16 04:05 ghost

Fixed by:

  1. Editing overwrite.cli.url from https:\/\/localhost to https://domain.zone/owncloud in /var/www/owncloud/config/config.php
  2. Editing RewriteBase in /var/www/owncloud/.htaccess from / to /owncloud.

dniku avatar May 10 '16 08:05 dniku

Hi, thanks for your help. My english is not good enough to fully understand everything that's written above, and my owncloud looks still down. so after the update i did this :

  • add an inexistant line in /var/www/owncloud/config/config.php --> 'overwrite.cli.url' => 'https://myurl.com/owncloud',
  • add an inexistant line in /var/www/owncloud/.htaccess (under ) --> RewriteBase /owncloud

this doesn't work after apache2 restart

edit : those lines where not in the files, doesn't that meen that something is going wrong about that ? and are they at the correct place in the file ?

Someone have an idea about that ? thanks a lot

dragful avatar May 10 '16 08:05 dragful

@dragful Please specify "this doesn't work"

ghost avatar May 10 '16 08:05 ghost

i only have a 404 error "not found" it's like nothing changed

dragful avatar May 10 '16 08:05 dragful

now it's working again, something happens between owncloud and gitlab-ce, but i don't know what ... after removing gitlab and changing .htaccess and config.php it's working again thanks a lot

dragful avatar May 11 '16 14:05 dragful

I have updated my Owncloud server this morning, upon restart when i try to login to owncloud I get The requested URL /owncloud/ was not found on this server. I’m not sure where to start with resolving this, any help would be appreciated, OS is ubuntu 14.04, Owncloud was on a recent version of 8 sorry I dont have the exact version, but it was updated a a month or so ago, I suspect it has updated to version 9 I have had the server running for at least 9 months with very few issues, I am new to Ubuntu so please bare with me

gregm123 avatar Jun 09 '16 08:06 gregm123

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.

(This is an automated comment from GitMate.io.

ownclouders avatar Dec 21 '17 01:12 ownclouders

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[bot] avatar Jul 31 '19 10:07 lock[bot]