Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: NodeWrittenEvent isn't triggering metadata generation #50627

Open
5 of 8 tasks
ervin09 opened this issue Feb 3, 2025 · 2 comments
Open
5 of 8 tasks

[Bug]: NodeWrittenEvent isn't triggering metadata generation #50627

ervin09 opened this issue Feb 3, 2025 · 2 comments

Comments

@ervin09
Copy link

ervin09 commented Feb 3, 2025

⚠️ This issue respects the following points: ⚠️

Bug description

sudo -u wwwrun php /srv/www/htdocs/nextcloud/occ info:file ./42800D26-43EA-418A-B920-60C5B5ED184D/files/log.1.txt
log.1.txt
  fileid: 292126
  mimetype: text/plain
  modified: January 30, 2025, 3:30:08 PM UTC
  not encrypted
  size: 19 B
  etag: 4b46ff4e2eb1d2f6ac23d73a5d6df09b

The following users have access to the file

42800D26-43EA-418A-B920-60C5B5ED184D:
  /42800D26-43EA-418A-B920-60C5B5ED184D/files/log.1.txt: full permissions
    home storage
kantine:/data/nc_data # sudo -u wwwrun php /srv/www/htdocs/nextcloud/occ -vvv metadata:get 292126

In MetadataRequestService.php line 87:

  [OCP\FilesMetadata\Exceptions\FilesMetadataNotFoundException]


Exception trace:
  at /srv/www/htdocs/nextcloud/lib/private/FilesMetadata/Service/MetadataRequestService.php:87
 OC\FilesMetadata\Service\MetadataRequestService->getMetadataFromFileId() at /srv/www/htdocs/nextcloud/lib/private/FilesMetadata/FilesMetadataManager.php:141
 OC\FilesMetadata\FilesMetadataManager->getMetadata() at /srv/www/htdocs/nextcloud/core/Command/FilesMetadata/Get.php:108
 OC\Core\Command\FilesMetadata\Get->execute() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /srv/www/htdocs/nextcloud/lib/private/Console/Application.php:213
 OC\Console\Application->run() at /srv/www/htdocs/nextcloud/console.php:102
 require_once() at /srv/www/htdocs/nextcloud/occ:11

metadata:get [--as-array] [--refresh] [--reset] [--] <fileId> [<userId>]

Steps to reproduce

We're trying to get the list of users who have created / altered files recently.
uploading a file as seen above, (log.1.txt) then running the commands on top , does not provide feedback for the creator of the file.

we did test another file , created some time ago, there seems to be activity on it like delete, update , etc.
problem is that there is no pattern to this , some files work , and some not. can we have someone to look at this.

this is indipendent if the file is managed under group folders or in personal folder.

the below is an example of how it should work, but also that example is somehow broken.

Expected behavior

kantine:/data/nc_data # sudo -u wwwrun php /srv/www/htdocs/nextcloud/occ info:file "__groupfolders/45/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf"
_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf
  fileid: 288717
  mimetype: application/pdf
  modified: December 9, 2024, 1:12:13 PM UTC
  not encrypted
  size: 731 KB
  etag: 49c6a6881634c67689484e8d22191e54
  mounted at: /

The following users have access to the file

031AF9F9-C245-4FD8-9545-E28B8E152232:
  /031AF9F9-C245-4FD8-9545-E28B8E152232/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: full permissions
    groupfolder 45
056BF000-C6E0-48A6-9AB6-000BDA3BB11A:
  /056BF000-C6E0-48A6-9AB6-000BDA3BB11A/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
08D103FC-E99A-4FAB-967B-5FD23ED6D6C8:
  /08D103FC-E99A-4FAB-967B-5FD23ED6D6C8/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
13DE32CA-CFA4-4AC9-A9B4-9CD2B8089E9D:
  /13DE32CA-CFA4-4AC9-A9B4-9CD2B8089E9D/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
2D634688-1068-4B0E-9EAC-2D7A6D059E63:
  /2D634688-1068-4B0E-9EAC-2D7A6D059E63/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
42800D26-43EA-418A-B920-60C5B5ED184D:
  /42800D26-43EA-418A-B920-60C5B5ED184D/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: full permissions
    groupfolder 45
5BD45350-CA08-4B4F-B8CC-26038FC529C6:
  /5BD45350-CA08-4B4F-B8CC-26038FC529C6/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: full permissions
    groupfolder 45
75FC774A-9FDA-4B67-8006-F5C6C0DBB4A3:
  /75FC774A-9FDA-4B67-8006-F5C6C0DBB4A3/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
7C0FD544-F248-4E2E-8489-5F09654E0761:
  /7C0FD544-F248-4E2E-8489-5F09654E0761/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
83F1C3EB-5B62-4017-A33B-1702580ECF21:
  /83F1C3EB-5B62-4017-A33B-1702580ECF21/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
860B2C5D-A450-45F6-89ED-9E392B9ABCA0:
  /860B2C5D-A450-45F6-89ED-9E392B9ABCA0/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
975DD133-AB5A-4EAF-92AF-689B5D8F8126:
  /975DD133-AB5A-4EAF-92AF-689B5D8F8126/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
9AC63D7C-04D5-443F-9DAC-1259044E4422:
  /9AC63D7C-04D5-443F-9DAC-1259044E4422/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
BED69887-E814-4462-85C9-9DDF2F68C33D:
  /BED69887-E814-4462-85C9-9DDF2F68C33D/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
C07E08A7-9232-4C9D-9692-9AA40FAAF20C:
  /C07E08A7-9232-4C9D-9692-9AA40FAAF20C/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
C532DE17-B1DE-4C88-A302-8D04E810D660:
  /C532DE17-B1DE-4C88-A302-8D04E810D660/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
F10E223E-E450-4BE8-8A47-19EAD756AD58:
  /F10E223E-E450-4BE8-8A47-19EAD756AD58/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
admin:
  /admin/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: full permissions
    groupfolder 45
Support_jananisri.s:
  /Support_jananisri.s/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
Support_muhammed.n:
  /Support_muhammed.n/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
Support_sasi.m:
  /Support_sasi.m/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
Support_naveenraj.n:
  /Support_naveenraj.n/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
Support_prahitha.t:
  /Support_prahitha.t/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
B52FB32A-014A-48EC-8584-21126B72E0A4:
  /B52FB32A-014A-48EC-8584-21126B72E0A4/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
E14C1073-E137-4BAB-9C60-8172E8A80EE7:
  /E14C1073-E137-4BAB-9C60-8172E8A80EE7/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
Support_abhirami.s:
  /Support_abhirami.s/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
3E4CAF33-5ED0-4146-85C2-9AB8C21C45FE:
  /3E4CAF33-5ED0-4146-85C2-9AB8C21C45FE/files/Support/Deliveries/PDC 3.1.0/PROD_20241206_29df7778/Executed_Processed/_PDC_Update_Procedure_PDC3.1.0_-PROD_07-Dec-2024.pdf: read, update, delete
    groupfolder 45
kantine:/data/nc_data # sudo -u wwwrun php /srv/www/htdocs/nextcloud/occ -vvv metadata:get 288717

In MetadataRequestService.php line 87:

  [OCP\FilesMetadata\Exceptions\FilesMetadataNotFoundException]


Exception trace:
  at /srv/www/htdocs/nextcloud/lib/private/FilesMetadata/Service/MetadataRequestService.php:87
 OC\FilesMetadata\Service\MetadataRequestService->getMetadataFromFileId() at /srv/www/htdocs/nextcloud/lib/private/FilesMetadata/FilesMetadataManager.php:141
 OC\FilesMetadata\FilesMetadataManager->getMetadata() at /srv/www/htdocs/nextcloud/core/Command/FilesMetadata/Get.php:108
 OC\Core\Command\FilesMetadata\Get->execute() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /srv/www/htdocs/nextcloud/lib/private/Console/Application.php:213
 OC\Console\Application->run() at /srv/www/htdocs/nextcloud/console.php:102
 require_once() at /srv/www/htdocs/nextcloud/occ:11

metadata:get [--as-array] [--refresh] [--reset] [--] <fileId> [<userId>]

Nextcloud Server version

29

Operating system

Other

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

None

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

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

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

Configuration report

kantine:/srv/www/htdocs/nextcloud # sudo -u wwwrun php occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "kantine.domain.com",
            "192.168.21.155",
            "nextcloud.domain.com",
            "claudius.domain.com"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.11.1",
        "overwritehost": "claudius.domain.com",
        "overwrite.cli.url": "https:\/\/claudius.domain.com",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "loglevel": 1,
        "default_phone_region": "DE",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR",
            "HTTP_X_FORWARDED"
        ],
        "maintenance": false,
        "theme": "",
        "logtimezone": "UTC",
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "updater.server.url": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "ldapUserCleanupInterval": 5,
        "auth.bruteforce.protection.enabled": false,
        "skeletondirectory": "\/srv\/www\/htdocs\/domain_skeleton",
        "activity_expire_days": 36,
        "activity_use_cached_mountpoints": true,
        "app_install_overwrite": [
            "twainwebscan",
            "onlyoffice"
        ],
        "allow_local_remote_servers": true,
        "defaultapp": "",
        "maintenance_window_start": "23"
    }
}

List of activated Apps

sudo -u wwwrun php occ app:list
Enabled:
  - activity: 2.21.1
  - admin_audit: 1.19.0
  - bruteforcesettings: 2.9.0
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contactsinteraction: 1.10.0
  - dav: 1.30.1
  - deck: 1.13.3
  - documentserver_community: 0.1.20
  - external: 5.4.1
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.1
  - files_downloadlimit: 2.0.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - groupfolders: 17.0.9
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - nextcloud_announcements: 1.18.0
  - notifications: 2.17.0
  - oauth2: 1.17.1
  - onlyoffice: 9.5.0
  - password_policy: 1.19.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - support: 1.12.0
  - systemtags: 1.19.0
  - tasks: 0.16.1
  - theming: 2.4.0
  - theming_customcss: 1.18.0
  - twofactor_backupcodes: 1.18.0
  - updatenotification: 1.19.1
  - user_ldap: 1.20.0
  - viewer: 2.3.0
  - workflowengine: 2.11.0
Disabled:
  - circles: 29.0.0-dev (installed 28.0.0)
  - contacts: 6.0.1 (installed 6.0.1)
  - dashboard: 7.9.0 (installed 7.0.0)
  - encryption: 2.17.0
  - files_accesscontrol: 1.19.1 (installed 1.19.1)
  - files_automatedtagging: 1.19.0 (installed 1.19.0)
  - files_downloadactivity: 1.17.0 (installed 1.17.0)
  - files_external: 1.21.0
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - firstrunwizard: 2.18.0 (installed 1.1)
  - photos: 2.5.0 (installed 1.0.0)
  - spreed: 19.0.11 (installed 19.0.11)
  - survey_client: 1.17.0 (installed 1.10.0)
  - suspicious_login: 7.0.0
  - text: 3.10.1 (installed 2.0.0)
  - twofactor_totp: 11.0.0-dev
  - user_status: 1.9.0 (installed 1.0.1)
  - weather_status: 1.9.0 (installed 1.0.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Additional info

No response

@ervin09 ervin09 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 3, 2025
@joshtrichards
Copy link
Member

joshtrichards commented Feb 3, 2025

Confirmed.

The metadata should be getting generated automatically from what I can tell.

AFAIK there are two points when the metadata gets generated for a new node automatically:

  • at creation time (via a listener) here
  • via a daily refresh job that runs during the configured maintenance_window_start

(there are also ways to trigger it manually)

For some reason the listener doesn't seem to functioning (verified in v30) here at the moment.

(others are though - e.g. for files_versions). This one is a little different since it's not registered through an app.

P.S. The following isn't the cause, but in your config the value should be an integer not a string:

        "maintenance_window_start": "23"

See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#maintenance-window-start

@joshtrichards joshtrichards added 1. to develop Accepted and waiting to be taken care of feature: filesystem and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Feb 3, 2025
@joshtrichards joshtrichards changed the title [Bug]: file versioning metadata, file just created. [Bug]: NodeWrittenEvent isn't triggering metadata generation Feb 3, 2025
@ervin09
Copy link
Author

ervin09 commented Feb 5, 2025

thanks for looking this up @joshtrichards. Also thanks for the advice, changed the line into value not string.

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

No branches or pull requests

2 participants