Need help to set up config

hello community,

I think my config is not error-free as I’m having two symptoms:

  • my mobiles often don’t show the recently taken and uploaded photos
  • if I delete a file in the web UI, it shows an error: “Delete file” action failed. But if I refresh the page, the file is actually gone because already deleted.

I have the impression that my memory cache is not set up correctly. But can’t figure it out.
I have MySQL + Redis + NC as docker containers.

Nextcloud version : 30.0.1
Operating system and version : Raspberry Pi OS, 64bit kernel, 32bit Userspace
nginx version : 1.18.0-6.1
PHP version : 8.2.24 inside docker container

Error in the log (not sure it’s related):

DbalException
An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'deleted_by' in 'field list'

config.php:

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
//  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.local' => '\OC\Memcache\Redis',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'enable_previews' => true,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\MarkDown',
    2 => 'OC\\Preview\\OpenDocument',
    3 => 'OC\\Preview\\PDF',
    4 => 'OC\\Preview\\MSOffice2003',
    5 => 'OC\\Preview\\MSOfficeDoc',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\Image',
    8 => 'OC\\Preview\\Photoshop',
    9 => 'OC\\Preview\\TIFF',
    10 => 'OC\\Preview\\SVG',
    11 => 'OC\\Preview\\Font',
    12 => 'OC\\Preview\\MP3',
    13 => 'OC\\Preview\\Movie',
    14 => 'OC\\Preview\\MKV',
    15 => 'OC\\Preview\\MP4',
    16 => 'OC\\Preview\\AVI',
    17 => 'OC\\Preview\\HEIC',
  ),
  'upgrade.disable-web' => true,
  'instanceid' => 'abcdefghijklmopqrstuvwxyz',
  'passwordsalt' => 'abcdefghijklmopqrstuvwxyz',
  'secret' => 'abcdefghijklmopqrstuvwxyz',
  'overwriteprotocol' => 'https',
//  'overwrite.cli.url' => 'http://192.168.x.x:8090',
  'overwrite.cli.url' => 'https://xxxx.ddns.org:2555',
  'overwritehost' => 'xxx.ddns.net:2555',
  'overwritehost' => 'xxx.ddns.net:2555',
  'trusted_proxies' => 
  array (
    2 => '127.0.0.1',
    3 => '192.168.x.xx',
  ),
  'trusted_domains' => 
  array (
    0 => '192.168.x.xx',
    1 => 'xxx.duckdns.org',
    2 => 'xxx.duckdns.org:2556',
    3 => 'xxx.ddns.net',
    4 => 'xxx.ddns.net:2555',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '30.0.1.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextcloud-db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'abcdefghijklmopqrstuvwxyz',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'xxx',
  'mail_domain' => 'web.de',
  'mail_smtphost' => 'smtp.web.de',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'abcdefghijklmopqrstuvwxyz',
  'loglevel' => 2,
  'maintenance' => false,
  'maintenance_window_start' => 4,
  'default_phone_region' => 'DE',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => '',
    'port' => 6379,
  ),
  'memories.db.triggers.fcu' => true,
  'memories.exiftool' => '/var/www/html/custom_apps/memories/bin-ext/exiftool-aarch64-glibc',
  'memories.vod.path' => '/var/www/html/custom_apps/memories/bin-ext/go-vod-aarch64',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'memories.exiftool_no_local' => true,
  'preview_max_x' => 4096,
  'preview_max_y' => 4096,
  'preview_max_scale_factor' => 1,
  'memories.gis_type' => 1,
);

docker compose file:

  nextcloud-db:
    container_name: nextcloud-db
    image: yobasystems/alpine-mariadb
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
      #ports:
      #      - 9022:3306
    volumes:
      - /home/pi/docker/nextcloud/mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=xxx
      - MYSQL_DATABASE=nextcloud
      - MYSQL_PASSWORD=yyyy
      - MYSQL_USER=zzzz
    networks:
      - nextcloud_backend
      
  redis:
    container_name: redis
    image: redis
    restart: unless-stopped
    command: redis-server
    volumes:
      - /home/pi/docker/nextcloud/redis:/data
    networks:
      - nextcloud_backend

  nextcloud-app:
    container_name: nextcloud-app
    image: nextcloud:30.0.1
    restart: unless-stopped
    depends_on:
      - nextcloud-db
      - redis
    ports:
      - 8090:80
    volumes:
      - /home/pi/docker/nextcloud/nc:/var/www/html 
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=zzzz
      - MYSQL_PASSWORD=yyyy
      - MYSQL_HOST=nextcloud-db
      - NEXTCLOUD_ADMIN_USER=abcdef
      - NEXTCLOUD_ADMIN_PASSWORD="qwerty"
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - TZ=Europe/Berlin
    networks:
      - nextcloud_backend

I have the impression that redis is not configured properly. could it be?

I’ve now added the column on my own:

sudo docker exec -it nextcloud-db mysql -uroot -pxxx -e "use nextcloud; alter table oc_files_trash add deleted_by varchar(64);"

the error message doesn’t appear after that, files are being deleted properly

Hi @Alexander_Koch,

Obviously this migration step was not executed correctly after update to 30:

That is OK for the column but that did not check the oc_migrations table.

Here the required steps to fix everything:

  • switch your nextcloud (temporarily) into debug mode:

    occ config:system:set --type=boolean --value=true -- debug
    
  • run this command (which is only available in debug mode) to check the migration status:

    occ migrations:status -- files_trashbin
    

    or/and query this in the databse

    SELECT * FROM oc_migrations WHERE app = 'files_trashbin';
    
  • eventualy execute the migration by hand, in order to registrate it in the oc_migrations table

    occ migrations:execute -- files_trashbin 1020Date20240403003535
    
  • check again with previous step or look directly in the oc_mihgrations table

  • when everything looks good, switch off debug mode:

    occ config:system:set --type=boolean --value=false -- debug
    

Much and good luck,
ernolf

hmm, status shows:

    >> Version Table Name:                                 oc_migrations
    >> Migrations Namespace:                               OCA\Files_Trashbin\Migration
    >> Migrations Directory:                               /var/www/html/apps/files_trashbin/lib/Migration
    >> Previous Version:                                   1010Date20200630192639
    >> Current Version:                                    1020Date20240403003535
    >> Next Version:                                       Already at latest migration step
    >> Latest Version:                                     1020Date20240403003535
    >> Executed Migrations:                                2
    >> Executed Unavailable Migrations:                    2
    >> Available Migrations:                               2
    >> New Migrations:                                     2
    >> Pending Migrations:                                 None`

seems, the migration should have been done, but it wasn’t? sounds a bit weird.