"404 The requested URL was not found on this server." after system update in ubuntu 22.04

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5):

Nextcloud version 3.4.2-1ubuntu1
Using Qt 5.15.3, built against Qt 5.15.2
Using Qt platform plugin 'xcb'
Using 'OpenSSL 3.0.2 15 Mar 2022'
Running on Ubuntu 22.04.2 LTS, x86_64

Apache or nginx version (eg, Apache 2.4.25): Server version: Apache/2.4.52 (Ubuntu) Server built: 2023-03-08T17:32:01
PHP version (eg, 7.4): PHP 8.2.4 (cli) (built: Mar 16 2023 14:34:48) (NTS)

The issue you are facing:
Everything was working without issue up until a very-delayed system update with sudo apt update/upgrade -y

Is this the first time you’ve seen this error? (Y/N): yes

Steps to replicate it:

  1. Have a perfectly running nextcloud
  2. Make a blind update
  3. When trying to access it through the usual https://localhost/index.php/
  4. Get the following message

Not Found

The requested URL was not found on this server.


Apache/2.4.52 (Ubuntu) Server at localhost Port 80

The output of your Nextcloud log in Admin > Logging:
I`m not able to access it.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'passwordsalt' => =====REDACTED======
  'secret' => =====REDACTED======
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'ludoviko.me',
    2 => '192.168.0.25',
    3 => '66.131.197.88',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '25.0.4.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => =====REDACTED======
  'installed' => true,
  'instanceid' => 'oc3nbxn74y0h',
  'maintenance' => false,
  'app_install_overwrite' => 
  array (
    0 => 'files_reader',
    1 => 'files_ebookreader',
  ),
  'mail_from_address' => 'ludoviko',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'gmx.com',
  'mail_smtpsecure' => 'tls',
  'mail_smtphost' => 'mail.gmx.com',
  'mail_smtpport' => '587',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'kuatolives@gmx.com',
  'mail_smtppassword' => '=====REDACTED======',
  'theme' => '',
  'loglevel' => 2,
);

The output of your Apache/nginx/system log in /var/log/____:

[Sun Apr 09 09:43:20.865124 2023] [ssl:warn] [pid 1050] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 09 09:43:21.137419 2023] [ssl:warn] [pid 1158] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 09 09:43:21.142880 2023] [mpm_prefork:notice] [pid 1158] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Sun Apr 09 09:43:21.142903 2023] [core:notice] [pid 1158] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 09 09:50:42.404397 2023] [ssl:warn] [pid 1059] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 09 09:50:42.662753 2023] [ssl:warn] [pid 1152] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 09 09:50:42.676593 2023] [mpm_prefork:notice] [pid 1152] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Sun Apr 09 09:50:42.676615 2023] [core:notice] [pid 1152] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 09 11:53:02.414207 2023] [mpm_prefork:notice] [pid 1152] AH00170: caught SIGWINCH, shutting down gracefully
[Sun Apr 09 11:53:02.532645 2023] [ssl:warn] [pid 65539] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 09 11:53:02.582292 2023] [ssl:warn] [pid 65540] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 09 11:53:02.588648 2023] [mpm_prefork:notice] [pid 65540] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Sun Apr 09 11:53:02.588750 2023] [core:notice] [pid 65540] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 09 12:23:10.280033 2023] [php:error] [pid 65548] [client 127.0.0.1:49472] script '/var/www/html/index.php' not found or unable to stat

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

todays nextcloud.log at /var/snap/nextcloud/current/logs is empty.
Pasting logs up to yesterday (when it was working) https://pastebin.com/LQhqfN1z

Thanks for your help!!!
:smiling_face_with_three_hearts:
:heart:

Is this file indeed present? What are the owner and permissions on it?

Did the system update include a major change in PHP version?

1 Like

It appears you upgraded Nextcloud as well not just your OS. It also appears you’re running Nextcloud from a snap.

Alright.

NC snaps contain their own Apache web server. Your included Apache logs seem to suggest you have perhaps another Apache installed. Namely the references to more conventional apache defaults like /var/www which I don’t believe should appear at all with the snap apache for for Nextcloud. From your posted NC config I’d expect something more like /snap/nextcloud/current/htdocs

Did you find that apache log in /var/log or was it somewhere under /snap/nextcloud? I’d confirm you’re not also running/have installed apache outside of the snap?

Not sure why an independent web server would suddenly appear after an OS upgrade but perhaps the upgrade also installed something that was dependent on you having a web server installed so it installed it not realizing you have a web server installed devoted to NC.

2 Likes

image

Its possible, this machine was shut down for a couple of months, so everything was outdated by that amount of time.

You might be onto something. It is possible that there was another apache running, but before this update, it did not interfere with the normal functioning of nextcloud.

The log comes from /var/log/apache2, I am pasting the one within the snap:

Do you have both Nextcloud snap and Apache installed (via apt, etc.) on the same server? There would be a port conflict between the two Apache instances unless you changed some ports.

1 Like

I think I might be having nextcloud desktop installed via apt but i`m positive the nexcloud is from snap (how can I check if I have residual installation from some previous attempt to install nextcloud months ago?). I might have attempted to run something else at some point (a discourse forum, possibly) but at that moment and up until yesterday that updated the system this fact did not interfere with normal functioning.

So tell me if this approach might work

  1. Check if there is a non-snap version of apache running
  2. If yes, remove it
  3. Resucitate somehow the apache from the snap package?

Or there is something else that might be looking for?

Mental note: never ever update something that is working without issues.

That’s a bad philosophy.

apt search apache2 or dpkg --get-selections | grep apache

apt remove apache2

Rebooting the server should do it, if that was the issue.

2 Likes

Yesss! I uninstalled apache2 and rebooted and now it`s back online, thanks everyone!

1 Like