nextcloud / nextcloud/ios

Sync Eror: X-OC-MTime header must be a valid positive integer

Open
#2,390 20 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.5k
Forks
1k
Avg merge
2d 18h
Merged PRs (30d)
13

Description

Steps to reproduce

Error appears when trying to sync files, not all files seem to be affected, but hundreds are. Not sure whats in common. Only uploading photos from camera roll.

Actual behavior

internal server error X-OC-MTime header must be a valid positive integer

Screenshots
Screenshot 2023-04-07 at 11 26 08
Logs

Server Logs

[webdav] Error: InvalidArgumentException: X-OC-MTime header must be a valid positive integer at <<closure>>

 0. /config/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php line 424
    OCA\DAV\Connector\Sabre\MtimeSanitizer::sanitizeMtime()
 1. /config/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 378
    OCA\DAV\Connector\Sabre\Node->sanitizeMtime()
 2. /config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1137
    OCA\DAV\Connector\Sabre\File->put()
 3. /config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 492
    Sabre\DAV\Server->updateFile("*** sensitive parameters replaced ***")
 4. /config/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPut()
 5. /config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit()
 6. /config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
 7. /config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
 8. /config/www/nextcloud/apps/dav/lib/Server.php line 360
    Sabre\DAV\Server->exec()
 9. /config/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
10. /config/www/nextcloud/remote.php line 171
    require_once("/config/www/nex ... p")
Environment data

iOS version: e.g. iOS 16.3.1

Nextcloud iOS app version:
4.8.0.5

Server operating system:
Unraid/ Docker

Web server:
Nginx

Database:
Type: mysql
Version: 10.11.2

PHP version:
Version: 8.1.17

Nextcloud version: see Nextcloud admin page
25.0.4

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 with the iOS sync/upload entry point and compare its requests with the server trace at apps/dav/lib/Connector/Sabre/Node.php:424 and File.php:378. Reproduce the photo-sync failure using the reported iOS and Nextcloud versions, then identify why affected uploads produce an invalid X-OC-MTime value. Done means affected files sync successfully without the server error and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, swift
Domain
backend, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.