Error uploading photos from the iOS client

Hi,

I have NC 23 and I am getting tons of errors when autouploading photos to NC. The pics get uploaded eventually, but the app crashes after a few of them get uploaded.
This is the error I get from the server:

{"reqId":"ksDsMjbZypOwmXuyd9Dx","level":4,"time":"2022-02-23T22:07:48+00:00","remoteAddr":"192.168.1.32","user":"francis","app":"webdav","method":"PUT","url":"/remote.php/dav/files/francis/Photos/Mobile/2009/11/701D2497-B50D-41DE-BDE9-C26F6C754962.JPG","message":"X-OC-MTime header must be a valid positive integer","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/4.2.2","version":"23.0.2.1","exception":{"Exception":"InvalidArgumentException","Message":"X-OC-MTime header must be a valid positive integer","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php","line":407,"function":"sanitizeMtime","class":"OCA\\DAV\\Connector\\Sabre\\MtimeSanitizer","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":319,"function":"sanitizeMtime","class":"OCA\\DAV\\Connector\\Sabre\\Node","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":155,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":339,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/MtimeSanitizer.php","Line":37,"CustomMessage":"--"}}

Any hints on how to fix it?

I see the same error.
In my case I try to upload old scanned images with file date set to 01.01.1970 12:00:00. The upload progresses and than it results in the error X-OC-MTime header must be a valid positive integer.

When I change the file date to 01.01.1980 it works well.

I use v 22.2.5. I think, the same worked well with an older version and I have a lot of old images dated to 01.01.1970 in my Nextcloud.

I have started seeing these types of errors as well.

I had recently updated the Windows Desktop app and thought that was it since it was triggering errors for an invalid modified time. However, I reverted back to an older build and am seeing the following error in the Desktop App:

"Server replied '500 Internal Server Error' to 'PUT https://cloud.[domain].com/remote.php/dav/files/[user]....file.ext[psd, ai, exe, jpg, psd, etc...]' (X-OC-MTime header must be a valid positive integer)."

Later, I decided to check out my admin logs on the nextcloud server and am seeing the following errors:

[webdav] Fatal: X-OC-MTime header must be a valid positive integer

PUT /remote.php/dav/files/[user]/aWeb/Project%2024%20Timeline.docx
from 10.0.10.1 by [user] at 2022-03-05T03:37:54+00:00

Iโ€™m running desktop app version 3.3.6 (previously was running 3.4, then later upgraded to 3.4.3 when I saw there were some errors).

Server version: Nextcloud Hub II (23.0.2)

It seems that the issue for me doesnโ€™t seem to revolve around any specific type of file, but rather that at some point, a modification timestamp was dropped somewhere. Iโ€™m not sure how or why, or where it would have even happened.

1 Like