Error is not showing up in logfiles

Hey, I’m currently transferring my Nextcloud that was running in a Docker Compose to a Proxmox LXC container. To do this, I transferred the database, data files, config folder and templates folder (ref: Restoring backup — Nextcloud latest Administration Manual latest documentation). After that, I changed some values in the config.php to make it work with the new Postgres database. Somewhere in this process, I made some mistakes and that’s why I’m looking for help here.
To be more specific:
Right now, when I access the website, I get the following error message:

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.

And I search for this “server log” so I can analyze the problem.

Some basic information:
The LXC runs on Alpine with nginx as the web server.
config file:

cat /usr/share/webapps/nextcloud/config/config.php

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/share/webapps/nextcloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/usr/share/webapps/nextcloud/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'password' => '',
    'port' => 6379,
  ),
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'xxx',
    1 => 'nextcloud',
  ),
  'datadirectory' => '/mnt/raid/nextcloud/data',
  'dbtype' => 'pgsql',
  'version' => '29.0.3.4',
  //'overwrite.cli.url' => 'https://xxx',
  //'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'info',
  'mail_domain' => 'xxx',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxx',
  'mail_smtpport' => 'xxx',
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'maintenance' => false,
  'log_type' => 'syslog',
  'loglevel' => 0,
  'syslog_tag' => 'Nextcloud',
  'default_phone_region' => 'DE',
  'theme' => '',
);

nextcloud config:

cat /etc/php81/php-fpm.d/nextcloud.conf

[global]
; Error log file
; Default Value: log/php-fpm.log
error_log = /var/log/nextcloud/php-fpm.log

; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
log_level = warning

; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
emergency_restart_threshold = 10

; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated.  This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
emergency_restart_interval = 1m

; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
process_control_timeout = 10s


[nextcloud]
user = nextcloud
group = www-data

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses on a
;                            specific port;
;   '/path/to/unix/socket' - to listen on a unix socket (the path is *not*
;                            relative to chroot!)
; Note: This value is mandatory.
listen = /run/nextcloud/fastcgi.sock

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
;                 mode is set to 0666
listen.mode  = 0660

; Choose how the process manager will control the number of child processes.
; Possible Values:
;   static   ... a fixed number of child processes.
;   dynamic  ... the number of child processes are set dynamically.
;   ondemand ... no children are created at startup; children will be forked
;                when new requests will connect.
; Note: This value is mandatory.
pm = ondemand

; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 10

; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 120s

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 500

; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page.
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set
pm.status_path =

; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set
ping.path = /ping

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0

; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0

; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
; Note: the path is *not* relative to chroot.
;slowlog = /var/log/nextcloud/php-fpm.slow.log

; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
;   php_value/php_flag             - you can set classic ini defines which can
;                                    be overwritten from PHP call 'ini_set'.
;   php_admin_value/php_admin_flag - these directives won't be overwritten by
;                                     PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
;
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
;
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/lib/php7.x)

; Allow HTTP file uploads.
php_admin_flag[file_uploads] = true

; Maximal size of a file that can be uploaded via web interface.
php_admin_value[memory_limit] = 512M
php_admin_value[post_max_size] = 513M
php_admin_value[upload_max_filesize] = 513M

; Where to store temporary files.
php_admin_value[session.save_path] = /var/tmp/nextcloud
php_admin_value[sys_temp_dir] = /var/tmp/nextcloud
php_admin_value[upload_tmp_dir] = /var/tmp/nextcloud

; Log errors to specified file.
php_admin_flag[log_errors] = on
php_admin_value[error_log] = /var/log/nextcloud/php.error.log

; OPcache error_log file name. Empty string assumes "stderr"
php_admin_value[opcache.error_log] = /var/log/nextcloud/php.error.log

; Output buffering is a mechanism for controlling how much output data
; (excluding headers and cookies) PHP should keep internally before pushing that
; data to the client. If your application's output exceeds this setting, PHP
; will send that data in chunks of roughly the size you specify.
; This must be disabled for ownCloud.
php_admin_flag[output_buffering] = false

; Overload(replace) single byte functions by mbstring functions.
; This must be disabled for ownCloud.
php_admin_flag[mbstring.func_overload] = false

; Never populate the $HTTP_RAW_POST_DATA variable.
; http://php.net/always-populate-raw-post-data
php_admin_value[always_populate_raw_post_data] = -1

; Disable certain functions for security reasons.
; http://php.net/disable-functions
php_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_open,curl_multi_exec,show_source

; Set recommended settings for OpCache.
; https://docs.nextcloud.com/server/13/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
php_admin_flag[opcache.enable] = true
php_admin_flag[opcache.enable_cli] = true
php_admin_flag[opcache.save_comments] = true
php_admin_value[opcache.interned_strings_buffer] = 8
php_admin_value[opcache.max_accelerated_files] = 10000
php_admin_value[opcache.memory_consumption] = 128
php_admin_value[opcache.revalidate_freq] = 1

Logsfiles:


/var/log/nextcloud/php-fpm.log

EMPTY


/var/log/nextcloud/php.error.log

EMPTY


/var/log/nginx/access.log

192.168.178.201 - - [27/Jul/2024:13:51:33 +0000] "GET / HTTP/1.1" 500 301 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "-"

/var/log/nginx/error.log

EMPTY


/mnt/raid/nextcloud/data/nextcloud.log

EMPTY


/var/log/messages

Jul 27 13:54:35 nextcloud auth.notice su: + tty1 root:nextcloud
Jul 27 13:55:04 nextcloud user.debug : Will stop /usr/sbin/php-fpm81
Jul 27 13:55:04 nextcloud user.debug : Will stop PID 854
Jul 27 13:55:04 nextcloud user.debug : Sending signal 15 to PID 854
Jul 27 13:55:04 nextcloud auth.notice su: + tty1 root:nextcloud
Jul 27 14:00:00 nextcloud cron.info crond[472]: USER root pid 939 cmd run-parts /etc/periodic/15min
Jul 27 14:00:00 nextcloud cron.info crond[472]: USER root pid 940 cmd run-parts /etc/periodic/hourly
Jul 27 14:00:00 nextcloud auth.notice su: + none root:nextcloud
Jul 27 14:15:00 nextcloud cron.info crond[472]: USER root pid 1008 cmd run-parts /etc/periodic/15min
Jul 27 14:15:00 nextcloud auth.notice su: + none root:nextcloud

Am I looking in the wrong place?
Thanks in advance for your help :slight_smile:

You configured your server to log in syslog:

I don’t even know if your container CAN write to syslog. You must have had something in mind when you configured it that way.
I would at least recommend logging to a file with loglevel 2 (0 is absolutely overkill and just makes it very hard to filter out the errors at all):

//  'log_type' => 'syslog',
  'loglevel' => 2,
//  'syslog_tag' => 'Nextcloud',

then you will find the log file (from the time of the change) with the default name nextcloud.log in your data directory.

quod erat demonstrandum :wink:


Much and good luck,
ernolf

Thanks for the quick reply :slight_smile:
The idea with the syslog was to avoid permission problems with files. I also assumed that I would then be able to see the logs with the following command:

tail -f /var/log/messages | grep nextcloudd

I have adjusted the config file. The file is created, but unfortunately has no content.

ls -la

-rw-r--r--    1 nextclou www-data         0 Jul 27 17:18 nextcloud.log

If so, then without errors (“Nextcloud” instead of “nextcloudd”) in the right file (/var/log/syslog on Ubuntu), so:

tail -f /var/log/syslog | grep Nextcloud

or simply

grep Nextcloud /var/log/syslog

does that give a useful echo?


It is self-explanatory that a log file has no content when it is newly created. First, events that can be logged must be triggered.


ernolf

ah sorry, there was a typo when writing the post. The content is / was:

Jul 27 13:54:35 nextcloud auth.notice su: + tty1 root:nextcloud
Jul 27 13:55:04 nextcloud user.debug : Will stop /usr/sbin/php-fpm81
Jul 27 13:55:04 nextcloud user.debug : Will stop PID 854
Jul 27 13:55:04 nextcloud user.debug : Sending signal 15 to PID 854
Jul 27 13:55:04 nextcloud auth.notice su: + tty1 root:nextcloud
Jul 27 14:00:00 nextcloud cron.info crond[472]: USER root pid 939 cmd run-parts /etc/periodic/15min
Jul 27 14:00:00 nextcloud cron.info crond[472]: USER root pid 940 cmd run-parts /etc/periodic/hourly
Jul 27 14:00:00 nextcloud auth.notice su: + none root:nextcloud
Jul 27 14:15:00 nextcloud cron.info crond[472]: USER root pid 1008 cmd run-parts /etc/periodic/15min
Jul 27 14:15:00 nextcloud auth.notice su: + none root:nextcloud

However, the nextcloud.log file has still no content even after restarting and refreshing the website several times

I’m not quite sure where the installation went wrong, but I started again from the beginning after the occ commands didn’t work either.
and lo and behold. everything works. even the logs :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.