Skip to content

[Bug]: TypeError: fileInfo1[key].localeCompare is not a function - Error while opening an image on browser #2564

Open
@NeptuneHub

Description

⚠️ This issue respects the following points: ⚠️

Bug description

From PC (windows) /Smartphone (Android) chrome browser, only on the directory /Camera of user admin, I can see the image/video in the folder (the thumbs) but when I click on it to expand I have a black windows and the error below.

Image/video in other folder of the same user are ok.
Image/video in other folder of other user are ok.
Priviledge and ownership of the image/video seems the same of both image viewed and not viewed:
-rwxrwxr-x 1 www-data www-data

The same image/video on Android app is open without any problem.

I try by deleting nextcloud, reinstalling it, re-put the image folder in it, re-create the previwe, but the problem persist.
I try by deleting the chrome cache, by opening an incognito windows, but the problem persist.

The folder is the main folder with a big number of photo and video, but I have another user with another big folder that don't have this problem. So I'm not recognizing any pattern for now.

Logs and error

Chrome console log (error):

viewer-main.mjs?v=b70227db-0:24502 Could not open file /Camera/IMG_20240517_095548884_HDR_AE.jpg TypeError: fileInfo1[key].localeCompare is not a function
    at sortCompare (viewer-main.mjs?v=b70227db-0:23115:116)
    at viewer-main.mjs?v=b70227db-0:24549:56
    at Array.sort (<anonymous>)
    at VueComponent.openFileInfo (viewer-main.mjs?v=b70227db-0:24549:39)
    at async VueComponent.openFile (viewer-main.mjs?v=b70227db-0:24495:9)

Chrome network log (seems not error in it):

Request URL:
https://store2.silverycat.de/remote.php/dav/files/admin/Camera/IMG_20240517_095548884_HDR_AE.jpg
Request Method:
PROPFIND
Status Code:
207 Multi-Status
Remote Address:
216.247.153.177:443
Referrer Policy:
no-referrer

Describe your Environment

  • Kubernetes distribution: K3S with 3 node, 1 Raspberry PI 5 (ARM) and 2 intel i5 node. Nextcloud run on the Raspberry PI 5.

  • Helm Version (or App that manages helm):

  • Helm Chart Version: version.BuildInfo{Version:"v3.15.2", GitCommit:"1a500d5625419a524fdae4b33de351cc4f58ec35", GitTreeState:"clean", GoVersion:"go1.22.4"}

  • values.yaml:

image:
  repository: nextcloud
  flavor: apache
  tag: stable # in wat the 29.0.6
  pullPolicy: Always

nodeSelector:
  kubernetes.io/hostname: ubuntu1

# Number of replicas to be deployed
replicaCount: 1
ingress:
  enabled: true
  className: traefik
  annotations:
      cert-manager.io/cluster-issuer: letsencrypt-production
      acme.cert-manager.io/http01-edit-in-place: "true"
  tls:
     - secretName: <secret>
       hosts:
         - <mydomain>
nextcloud:
  host: <mydomain>
  username: admin
  password: <mypassword>
  configs: {}

nginx:
  enabled: false
  image:
    repository: nginx
    tag: alpine
    pullPolicy: IfNotPresent
  containerPort: 80
persistence:
  enabled: true
  annotations: {}
  storageClass: "manual" #"smb" #"local-path"
  existingClaim: nextcloud-config-pvc
  nextcloudData:
    enabled: true
    annotations: {}
    storageClass: "manual"
    existingClaim: nextcloud-server-pvc

phpClientHttpsFix:
  enabled: true
  protocol: https

resources:
  requests:
    memory: "512Mi"    # Start with a conservative estimate
    cpu: "500m"      # This is 0.5 CPU core
  limits:
    memory: "2Gi"    # Allow up to 2 GiB of memory usage
    cpu: "1500m"         # Allow up to 2 CPU cores
	
startupProbe:
  enabled: true
  initialDelaySeconds: 120
  failureThreshold: 50

lifecycle:
  postStartCommand: ["/bin/bash", "-c", "apt update -y && apt install ffmpeg -y"]    

I'm using local-path PVC on the root disk (an SSD attached by USB 3).
Only app installed on top of the helm chart are imagepreview and memories.

Also this is the config.php:

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  '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,
    ),
  ),
  'overwriteprotocol' => 'https',
  'upgrade.disable-web' => true,
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '<mydomain>',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'sqlite3',
  'version' => '29.0.6.1',
  'overwrite.cli.url' => 'https://localhost',
  'dbname' => 'nextcloud',
  'installed' => true,
  'instanceid' => 'oc1fa7yyp42d',
  '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',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'enable_previews' => true,
  'jpeg_quality' => '60',
  'preview_max_x' => '1024',
  'preview_max_y' => '1024',
  'preview_max_scale_factor' => 1.5,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\MP3',
    1 => 'OC\\Preview\\TXT',
    2 => 'OC\\Preview\\MarkDown',
    3 => 'OC\\Preview\\OpenDocument',
    4 => 'OC\\Preview\\Krita',
    5 => 'OC\\Preview\\Imaginary',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\Movie',
    8 => 'OC\\Preview\\MKV',
    9 => 'OC\\Preview\\MP4',
    10 => 'OC\\Preview\\AVI',
    11 => 'OC\\Preview\\JPEG',
    12 => 'OC\\Preview\\PNG',
    13 => 'OC\\Preview\\GIF',
    14 => 'OC\\Preview\\BMP',
    15 => 'OC\\Preview\\XBitmap',
    16 => 'OC\\Preview\\HEIC',
    17 => 'OC\\Preview\\TIFF',
    18 => 'OC\\Preview\\Image',
    19 => 'OC\\Preview\\FFmpeg',
  ),
  'preview_ffmpeg_path' => '/usr/bin/ffmpeg',
  'preview_imaginary_url' => 'http://imaginary.imaginary.svc.cluster.local:9000',
  'filelocking.enabled' => false,
  'allow_local_remote_servers' => true,
  'memories.ffmpeg_path' => '/usr/bin/ffmpeg',
  'loglevel' => 0,
  'maintenance' => false,
);

Steps to reproduce

I wasn't able to reproduce a pattern: Just clicking on an image/video on a specific folder in the brower and it open a black windows instead of the image/video itself.

Expected behavior

When you click on the image you should view the "bigger version", if you click on a video, it should start the video reproduction.

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

SQlite

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending approval or rejection. This issue is pending approval.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions