nextcloud / nextcloud/text

[Bug]: audit log loop after uploading and overwite an existing README.md file

Open
#7,094 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

⚠️ This issue respects the following points: ⚠️
Bug description

When audit log is enabled, when we upload an existing file and overwite the existing file, a loop happen in the audit.log until the user quit nextcloud

{"reqId":"ffw1aRpzsDcjk7DZHlEi","level":1,"time":"2025-04-10T13:16:44+00:00","remoteAddr":"10.89.1.3","user":"admin","app":"admin_audit","method":"POST","url":"/apps/text/session/8/sync","message":"File with id \"8\" accessed: \"/Readme.md\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"31.0.0.18","data":{"app":"admin_audit"}}
{"reqId":"VJgj6Vgj9Ul8XQa0VlaH","level":1,"time":"2025-04-10T13:16:46+00:00","remoteAddr":"10.89.1.3","user":"admin","app":"admin_audit","method":"POST","url":"/apps/text/session/8/sync","message":"File with id \"8\" accessed: \"/Readme.md\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"31.0.0.18","data":{"app":"admin_audit"}}
{"reqId":"eiVbQ13N3YdhoLcLuCog","level":1,"time":"2025-04-10T13:16:51+00:00","remoteAddr":"10.89.1.3","user":"admin","app":"admin_audit","method":"POST","url":"/apps/text/session/8/sync","message":"File with id \"8\" accessed: \"/Readme.md\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"31.0.0.18","data":{"app":"admin_audit"}}
{"reqId":"rmS9ts38KG1tOYvQ6C46","level":1,"time":"2025-04-10T13:16:56+00:00","remoteAddr":"10.89.1.3","user":"admin","app":"admin_audit","method":"POST","url":"/apps/text/session/8/sync","message":"File with id \"8\" accessed: \"/Readme.md\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"31.0.0.18","data":{"app":"admin_audit"}}
{"reqId":"YjhV6CY9UrBTDPhzjtxj","level":1,"time":"2025-04-10T13:17:02+00:00","remoteAddr":"10.89.1.3","user":"admin","app":"admin_audit","method":"POST","url":"/apps/text/session/8/sync","message":"File with id \"8\" accessed: \"/Readme.md\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"31.0.0.18","data":{"app":"admin_audit"}}
Steps to reproduce
  1. enable audit log
  2. download readme.txt
  3. upload readme.txt
  4. overwrite the existing file
Expected behavior

no loop and only one event should be logged

Nextcloud Server version

master

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

None

Database engine version

None

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

Fresh Nextcloud Server install

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

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the overwrite flow with audit logging enabled: download readme.txt, upload it, and overwrite the existing file. Inspect the /apps/text/session/8/sync handling and the repeated audit.log entries. Done means the loop no longer occurs and only one event is logged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.