Skip to content

Filename with special character "ä" triggers stat: cannot statx when using occ files:scan #29418

Closed

Description

@chrnaum

File "Test_ä.md" triggers "stat: cannot statx '/var/www/html/data/admin/files/Test_.md': No such file or directory" when using command "sudo docker exec --user www-data nextcloudtest_app_1 php occ files:scan admin" in ssh.

This happnes form 22.1.1 on. 22.1.0 is not affected.

Steps to reproduce

deploy stack "nextcloudtest"

version: '2'

services:
  dbtest:
    image: yobasystems/alpine-mariadb:latest
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: unless-stopped
    volumes:
      - /home/pi/nextclouddbtest:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=rootpasswordtest
      - MYSQL_PASSWORD=passwordtest
      - MYSQL_DATABASE=nextcloudtest
      - MYSQL_USER=nextcloudtest

  app:
    image: nextcloud:22.1.1
    ports:
      - 8081:80
    links:
      - dbtest
    volumes:
      - /home/pi/nextcloudtest:/var/www/html
    restart: unless-stopped
    environment:
      - MYSQL_DATABASE=nextcloudtest
      - MYSQL_USER=nextcloudtest
      - MYSQL_PASSWORD=passwordtest
      - MYSQL_HOST=dbtest
      - NEXTCLOUD_DATA_DIR=/var/www/html/data

In browser:
Create admin account, finish installation
Create testfile "Test_ä.md"

In ssh run:
sudo docker exec --user www-data nextcloudtest_app_1 php occ files:scan admin

Expected behaviour

Output 22.1.0 without error:

Starting scan for user 1 out of 1 (admin)
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 5       | 29    | 00:00:01     |
+---------+-------+--------------+

Actual behaviour

Output 22.1.1 with error:

Starting scan for user 1 out of 1 (admin)
stat: cannot statx '/var/www/html/data/admin/files/Test_.md': No such file or directory
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 5       | 29    | 00:00:00     |
+---------+-------+--------------+

Server configuration

Operating system:
Raspberry Pi 4
Raspbian GNU/Linux 10 (buster)
Kernerl: 5.10.63-v7l+

Docker version 20.10.9, build c2ea9bc

Web server:

Database:
yobasystems/alpine-mariadb:latest

PHP version:

Nextcloud version:
22.1.1

Updated from an older Nextcloud/ownCloud or fresh install:
fresh install

Where did you install Nextcloud from:
docker hub

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

Activity

  1. added
    0. Needs triage
    on Oct 23, 2021
  2. ei23fxg commented on Nov 3, 2021

    @ei23fxg
  3. solracsf commented on Nov 4, 2021

    @solracsf
    Member

    Can't reproduce on 22.2.0

    $ touch data/test/files/Test_ä.md
    
    $ ./occ files:scan --all
    Starting scan for user 1 out of 1 (test)
    +---------+-------+--------------+
    | Folders | Files | Elapsed time |
    +---------+-------+--------------+
    | 9       | 13    | 00:00:00     |
    +---------+-------+--------------+
    
    $ occ status
      - installed: true
      - version: 22.2.0.2
      - versionstring: 22.2.0
      - edition:
    

    File is then visible on the WebUI.

  4. changed the title [-]nextcloud 22.1.1: file with special character "ä" triggers "stat: cannot statx" when using "occ files:scan"[/-] [+]Filename with special character "ä" triggers `stat: cannot statx` when using `occ files:scan`[/+] on Nov 4, 2021
  5. chrnaum commented on Nov 4, 2021

    @chrnaum
    Author

    Just checked with nextcloud:latest (22.2.0.2)
    Here, issue still exists.
    I'm using Raspberry Pi OS Lite, which is 32bit, btw.
    I create the testfile in Nextcloud, therefore it is visible from the beginning.

    pi@raspberrypi:~ $ sudo docker exec --user www-data nextcloudtest_app_1 php occ files:scan admin
    Starting scan for user 1 out of 1 (admin)
    stat: cannot statx '/var/www/html/data/admin/files/Test_.md': No such file or directory
    +---------+-------+--------------+
    | Folders | Files | Elapsed time |
    +---------+-------+--------------+
    | 5 | 29 | 00:00:00 |
    +---------+-------+--------------+

    pi@raspberrypi:~ $ sudo docker exec --user www-data nextcloudtest_app_1 php occ status

    • installed: true
    • version: 22.2.0.2
    • versionstring: 22.2.0
    • edition:
  6. pzzszk commented on Nov 12, 2021

    @pzzszk

    I have the exact same issue before & after upgrading to Version 22.2.1.2.

    When issuing the command "./occ files:scan --all" everything works fine, except for the one file with a £ (pound sterling) symbol in the filename. The folders (or groups folders) application code seems to have 'normalised' the file name and dropped the £ symbol from the filename prior to issuing the "stat". Therefore, it can't find the file & it issues the warning.

    This issue has already been raised in nextcloud/groupfolders/issues/1665

    My error message is:
    stat: cannot stat '/mnt/md0/nextcloud/data/__groupfolders/1/Accounts/Expenditure/Expenses - SF/Foodbank receipt - 2020-12-09 - Tesco 1 x 20 Vouchers.pdf': No such file or directory

    The 'real filename' for the above file is ".......Tesco 1 x £20 Vouchers.pdf"

    Hope this helps with the investigation.

  7. tigermick commented on Nov 14, 2021

    @tigermick

    Hi,
    I have the same issue too ...
    Before, no problem with the sames files ... but recently (maybe since updating to version 22) , when I try to do occ files:scan, I have a stat error for all file with é è à â ê ... specials characters ... in the file name.
    Same problem with recent 22.2.2 version

  8. chrnaum commented on Nov 19, 2021

    @chrnaum
    Author

    Error still present in 22.2.3.0

  9. chrnaum commented on Dec 6, 2021

    @chrnaum
    Author

    Fixed with 23.0.0.10.

    pi@raspberrypi:~ $ sudo docker exec --user www-data nextcloud_app_1 php occ status

    • installed: true
    • version: 23.0.0.10
    • versionstring: 23.0.0
    • edition:
    • maintenance: false
    • needsDbUpgrade: false
    • productname: Nextcloud
    • extendedSupport: false
  10. fschrempf commented on Dec 16, 2021

    @fschrempf

    I'm guessing that this was fixed with #29605!? Just for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagebugneeds info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions