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]: Failed to write file contents: File with id "…" has not been found #31695

Closed
5 of 8 tasks
nickvergessen opened this issue Mar 24, 2022 · 11 comments
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: files feature: filesystem needs info

Comments

@nickvergessen
Copy link
Member

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

We have 2.440 Failed to write file contents: File with id "…" has not been found errors in our log file in the last 14 days

Steps to reproduce

  1. People use nextcloud

Expected behavior

Nothing happens in the error log

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database engine version

MariaDB

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

Updated from a minor version (ex. 22.2.3 to 22.2.4)

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

c.nc.c

Nextcloud Signing status

No response

Nextcloud Logs

{
  "reqId": "PNGH1WcDNh8aMHfpSpxG",
  "level": 4,
  "time": "2022-03-24T09:41:26+00:00",
  "remoteAddr": "",
  "user": "",
  "app": "webdav",
  "method": "GET",
  "url": "/remote.php/dav/files/…",
  "message": "Failed to write file contents: File with id \"3079700\" has not been found.",
  "userAgent": "Mozilla/5.0 (Windows) mirall/…",
  "version": "23.0.3.2",
  "exception": {
    "Exception": "Sabre\\DAV\\Exception\\ServiceUnavailable",
    "Message": "Failed to write file contents: File with id \"3079700\" has not been found.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
        "line": 465,
        "function": "convertToSabreException",
        "class": "OCA\\DAV\\Connector\\Sabre\\File",
        "type": "->"
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 85,
        "function": "get",
        "class": "OCA\\DAV\\Connector\\Sabre\\File",
        "type": "->"
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpGet",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->"
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/apps/dav/lib/Server.php",
        "line": 339,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/remote.php",
        "line": 166,
        "args": [
          "/var/www/html/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
    "Line": 708,
    "Previous": {
      "Exception": "OCP\\Files\\StorageNotAvailableException",
      "Message": "File with id \"3079700\" has not been found.",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/html/apps/files_sharing/lib/SharedStorage.php",
          "line": 444,
          "function": "acquireLock",
          "class": "OC\\Files\\Storage\\FailedStorage",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
          "line": 610,
          "function": "acquireLock",
          "class": "OCA\\Files_Sharing\\SharedStorage",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 1964,
          "function": "acquireLock",
          "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 2079,
          "function": "lockPath",
          "class": "OC\\Files\\View",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 1151,
          "function": "lockFile",
          "class": "OC\\Files\\View",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 1005,
          "function": "basicOperation",
          "class": "OC\\Files\\View",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
          "line": 463,
          "function": "fopen",
          "class": "OC\\Files\\View",
          "type": "->"
        },
        {
          "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
          "line": 85,
          "function": "get",
          "class": "OCA\\DAV\\Connector\\Sabre\\File",
          "type": "->"
        },
        {
          "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
          "line": 89,
          "function": "httpGet",
          "class": "Sabre\\DAV\\CorePlugin",
          "type": "->"
        },
        {
          "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 472,
          "function": "emit",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 253,
          "function": "invokeMethod",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 321,
          "function": "start",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/dav/lib/Server.php",
          "line": 339,
          "function": "exec",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
          "line": 35,
          "function": "exec",
          "class": "OCA\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/var/www/html/remote.php",
          "line": 166,
          "args": [
            "/var/www/html/apps/dav/appinfo/v2/remote.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/var/www/html/lib/private/Files/Storage/FailedStorage.php",
      "Line": 197,
      "Hint": "Storage is temporarily not available",
      "Previous": {
        "Exception": "OCP\\Files\\NotFoundException",
        "Message": "File with id \"3079700\" has not been found.",
        "Code": 0,
        "Trace": [
          {
            "file": "/var/www/html/apps/files_sharing/lib/SharedStorage.php",
            "line": 134,
            "function": "getPath",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/var/www/html/apps/files_sharing/lib/SharedStorage.php",
            "line": 503,
            "function": "init",
            "class": "OCA\\Files_Sharing\\SharedStorage",
            "type": "->"
          },
          {
            "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Jail.php",
            "line": 482,
            "function": "getWrapperStorage",
            "class": "OCA\\Files_Sharing\\SharedStorage",
            "type": "->"
          },
          {
            "file": "/var/www/html/apps/files_sharing/lib/SharedStorage.php",
            "line": 443,
            "function": "resolvePath",
            "class": "OC\\Files\\Storage\\Wrapper\\Jail",
            "type": "->"
          },
          {
            "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
            "line": 610,
            "function": "acquireLock",
            "class": "OCA\\Files_Sharing\\SharedStorage",
            "type": "->"
          },
          {
            "file": "/var/www/html/lib/private/Files/View.php",
            "line": 1964,
            "function": "acquireLock",
            "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
            "type": "->"
          },
          {
            "file": "/var/www/html/lib/private/Files/View.php",
            "line": 2079,
            "function": "lockPath",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/var/www/html/lib/private/Files/View.php",
            "line": 1151,
            "function": "lockFile",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/var/www/html/lib/private/Files/View.php",
            "line": 1005,
            "function": "basicOperation",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
            "line": 463,
            "function": "fopen",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
            "line": 85,
            "function": "get",
            "class": "OCA\\DAV\\Connector\\Sabre\\File",
            "type": "->"
          },
          {
            "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
            "line": 89,
            "function": "httpGet",
            "class": "Sabre\\DAV\\CorePlugin",
            "type": "->"
          },
          {
            "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 472,
            "function": "emit",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 253,
            "function": "invokeMethod",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 321,
            "function": "start",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/var/www/html/apps/dav/lib/Server.php",
            "line": 339,
            "function": "exec",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
            "line": 35,
            "function": "exec",
            "class": "OCA\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/var/www/html/remote.php",
            "line": 166,
            "args": [
              "/var/www/html/apps/dav/appinfo/v2/remote.php"
            ],
            "function": "require_once"
          }
        ],
        "File": "/var/www/html/lib/private/Files/View.php",
        "Line": 1773
      }
    },
    "CustomMessage": "--"
  },
  "id": "623c3f5d8fc46"
}

Additional info

No response

@PVince81
Copy link
Member

likely related to oc_share entries with the wrong owner, see #30791

there were some cases I analyzed that seemed to be connected to that

@CamZie
Copy link

CamZie commented Nov 3, 2022

Same issue here on Nextcloud version 24.0.6.1. We have moved a shared folder to another folder and after that we received this error. Re-creating the shares also does not help. Is there a workaround for this at the moment?

@PVince81
Copy link
Member

PVince81 commented Nov 3, 2022

you can use this upcoming command to repair such cases: #32211

@CamZie
Copy link

CamZie commented Nov 4, 2022

you can use this upcoming command to repair such cases: #32211

Thanks! upgrading to version 25 fixed the issue or us.

@PVince81
Copy link
Member

PVince81 commented Nov 4, 2022

@nickvergessen do you still see those errors in recent logs ? we did run the repair command a few weeks ago on c.nc.com

@nickvergessen
Copy link
Member Author

No entry since 23rd October at least

@hanserasmus
Copy link

I am also having this issue. I have upgraded my instance to latest stable (25.0.2), ran the new command, but the problem is still there. This is really annoying, because it seems because of this "fatal" error on this one file, the sync client does not sync other files. Is there a way to get rid of this?

@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Jan 23, 2023
@nickvergessen
Copy link
Member Author

Not in our current log, so assuming it's fixed.

@hanserasmus
Copy link

I was on 25.0.3. It seems after running the command, the file was placed back in my user space. The error in the log still persisted, but I was this time around to manually delete the file and then the error disappeared.

Thanks again.

@pReya
Copy link

pReya commented Apr 18, 2023

Having the same problem here under Nextcloud 25.0.5. Tried running the occ maintenance:repair-share-owner, yet I just got Found no shares with invalid share owner.

So I'm not sure how to fix this. Any other ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: files feature: filesystem needs info
Projects
None yet
Development

No branches or pull requests

6 participants