[Solved] URGENT - Internal Server Error

Nextcloud version: 25.0.7.1
Operating system and version: Ubuntu 20.04
Apache version: Apache 2.4.41
PHP version: 7.4.3

My issue:
I have been using nextcloud for several years (https://cloud.valecloud.tk); until a few days ago everything worked fine, but it’s been a few days that when I try to access the following message is shown:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

No updates or other actions have been performed.

I can’t access so I can’t report the the output of my Nextcloud log in Admin > Logging, but the output of the command sudo tail -f /var/www/html/nextcloud-data/nextcloud.log when I try to access is:

{
  "reqId": "fRIIOHyA8YkbxwcPibVO",
  "level": 3,
  "time": "2023-07-11T08:23:19+00:00",
  "remoteAddr": "82.57.166.122",
  "user": "--",
  "app": "core",
  "method": "GET",
  "url": "/favicon.ico",
  "message": "Redis server went away",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
  "version": "25.0.7.1",
  "exception": {
    "Exception": "RedisException",
    "Message": "Redis server went away",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/nextcloud/lib/private/Memcache/Redis.php",
        "line": 48,
        "function": "get",
        "class": "Redis",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/App/InfoParser.php",
        "line": 58,
        "function": "get",
        "class": "OC\\Memcache\\Redis",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/App/AppManager.php",
        "line": 507,
        "function": "parse",
        "class": "OC\\App\\InfoParser",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/App/AppManager.php",
        "line": 522,
        "function": "getAppInfo",
        "class": "OC\\App\\AppManager",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/legacy/OC_App.php",
        "line": 571,
        "function": "getAppVersion",
        "class": "OC\\App\\AppManager",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/legacy/OC_App.php",
        "line": 875,
        "function": "getAppVersion",
        "class": "OC_App",
        "type": "::"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/legacy/OC_Util.php",
        "line": 1219,
        "function": "shouldUpgrade",
        "class": "OC_App",
        "type": "::"
      },
      {
        "file": "/var/www/html/nextcloud/lib/public/Util.php",
        "line": 580,
        "function": "needUpgrade",
        "class": "OC_Util",
        "type": "::"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/legacy/OC_Template.php",
        "line": 115,
        "function": "needUpgrade",
        "class": "OCP\\Util",
        "type": "::"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/legacy/OC_Template.php",
        "line": 78,
        "function": "initTemplateEngine",
        "class": "OC_Template",
        "type": "::"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/legacy/OC_Template.php",
        "line": 323,
        "function": "__construct",
        "class": "OC_Template",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/index.php",
        "line": 74,
        "function": "printExceptionErrorPage",
        "class": "OC_Template",
        "type": "::"
      }
    ],
    "File": "/var/www/html/nextcloud/lib/private/Memcache/Redis.php",
    "Line": 48,
    "CustomMessage": "--"
  }
}

The output of config.php file in /var/www/html/nextcloud/config is:

<?php
$CONFIG = array (
  'instanceid' => 'XXX',
  'skeletondirectory' => '',
  'default_language' => 'it',
  'default_locate' => 'it',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'passwordsalt' => 'XXX',
  'secret' => 'XXX',
  'trusted_domains' => 
  array (
    0 => 'cloud.valecloud.tk',
  ),
  'datadirectory' => '/var/www/html/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '25.0.7.1',
  'overwrite.cli.url' => 'http://cloud.valecloud.tk',
  'dbname' => 'XXX',
  'dbhost' => 'XXX',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXX',
  'dbpassword' => 'XXX',
  'installed' => true,
  'mail_smtpmode' => 'XXX',
  'mail_smtpsecure' => 'XXX',
  'mail_sendmailmode' => 'XXX',
  'mail_from_address' => 'XXX',
  'mail_domain' => 'XXX',
  'mail_smtpauthtype' => 'XXX',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'XXX',
  'mail_smtpport' => 'XXX',
  'mail_smtpname' => 'XXX',
  'mail_smtppassword' => 'XXX',
  'maintenance' => false,
  'updater.release.channel' => 'stable',
  'theme' => '',
  'loglevel' => 0,
  'default_phone_region' => 'IT',
  'app_install_overwrite' => 
  array (
    0 => 'apporder',
    1 => 'audioplayer_sonos',
    2 => 'impersonate',
    3 => 'video_converter',
  ),
  'updater.secret' => 'XXX',
  'allow_local_remote_servers' => true,
);
?>

Please help me… it’s urgent!!!

This might be the cause:

Check your redis server (Logfiles, is it running, stuck etc.)

2 Likes

How? I’m a beginner

The output of the command sudo systemctl status redis-server is:

redis-server.service - Advanced key-value store
     Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
     Active: active (exited) since Tue 2023-07-11 09:54:43 CEST; 2h 22min ago
       Docs: http://redis.io/documentation,
             man:redis-server(1)
      Tasks: 0 (limit: 9276)
     Memory: 0B
     CGroup: /system.slice/redis-server.service

lug 11 09:54:43 valerio-beelink systemd[1]: Starting LSB: redis-server - Persistent key-value db...
lug 11 09:54:43 valerio-beelink systemd[1]: Started LSB: redis-server - Persistent key-value db.

Last lines of the /var/log/redis/redis-server.log are:

1093:M 10 Jul 2023 10:14:58.706 * 1 changes in 900 seconds. Saving...
1093:M 10 Jul 2023 10:14:58.709 * Background saving started by pid 9714
9714:C 10 Jul 2023 10:14:59.192 * DB saved on disk
9714:C 10 Jul 2023 10:14:59.194 * RDB: 0 MB of memory used by copy-on-write
1093:M 10 Jul 2023 10:14:59.213 * Background saving terminated with success
1093:signal-handler (1688976925) Received SIGTERM scheduling shutdown...
1093:M 10 Jul 2023 10:15:25.203 # User requested shutdown...
1093:M 10 Jul 2023 10:15:25.203 * Saving the final RDB snapshot before exiting.
1093:M 10 Jul 2023 10:15:25.469 * DB saved on disk
1093:M 10 Jul 2023 10:15:25.469 * Removing the pid file.
1093:M 10 Jul 2023 10:15:25.469 # Redis is now ready to exit, bye bye...

It seems the logs are stuck at yesterday… very strange!!!

Run

sudo systemctl restart redis-server

much luck!

2 Likes

Great… it works. Thank you very much :grinning:

1 Like

Well. This helps of course. But the redis Container continues to shut down itself unregularly. I Cannot find Out why. Anybody can help me with that?

Someone plz help me i am using nextcloud last 6 months all the working great but now last 6 days its showing { INTERNAL SERVER ERROR } when i want to access my cloud space .

I’ll also attached screenshot of error and when i am enter this cmd { sudo systemctl status redis-server } ishowing a error { Failed to restart redis-serve.service: Unit redis-serve.service not found. }.

HELP ME .

Someone plz help me i am using nextcloud last 6 months all the working great but now last 6 days its showing { INTERNAL SERVER ERROR } when i want to access my cloud space .

I’ll also attached screenshot of error and when i am enter this cmd { sudo systemctl status redis-server } ishowing a error { Failed to restart redis-serve.service: Unit redis-serve.service not found. }.

HELP ME .

in /config/config.php I removed the memcache lines and next cloud loaded for me so later on I can attend to the mamcache issue later.

‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.distributed’ => ‘\OC\Memcache\Memcached’,
‘memcache.locking’ => ‘\OC\Memcache\Memcached’,

Hi @Sameer ,

Please open a new thread and use → this support template ← , since every setup is different, instead of reopening already solved old topics.

ernolf