core icon indicating copy to clipboard operation
core copied to clipboard

Problems syncing graphical files

Open madpipeline opened this issue 12 years ago • 40 comments

While syncing project files from GIMP or Krita, at random times the sync stops providing me with this error: "The item is not synced because of previous errors: The server did not provide an Etag."

After that the syncing stops. The server kind of crashes. I cannot connect to it via the web interface or the client.

Expected behaviour

Sync to work normally, just sync the file(s) to the server.

Actual behaviour

Sync stops with: "The item is not synced because of previous errors: The server did not provide an Etag.".

Steps to reproduce

  1. Create and edit GIMP or Krita projects.
  2. Save changes to those files in a OwnCloud synced directory.
  3. Repeat until error is received.

Server configuration

Operating system: Debian 7 128MB RAM

1 OwnCloud user.

Web server: apache2

Database: mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (i686) using readline 6.2

PHP version: PHP 5.4.4-14+deb7u7 (cli) (built: Dec 12 2013 10:55:22) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

ownCloud version: (see ownCloud admin page)

Updated from an older ownCloud or fresh install: fresh install.

List of activated app: Files. Because of this error and from what I've read in the apache error log I've disabled all other apps.

The content of config/config.php: (Without the database password and passwordsalt)

'oc17705b99a2', 'passwordsalt' => '', 'datadirectory' => '/media/sf_ownCloud', 'dbtype' => 'mysql', 'version' => '6.0.0.16', 'installed' => true, 'loglevel' => '0', 'enable_previews' => false, ); Are you using external storage, if yes which one: The server runs in a Virtual Machine. The data directory is in a shared directory that lies on an external USB 2TB HDD. There were no power outages or other electricity problems. I'm using the same HDD for other services as well, and I haven't had any problems with them. ### Client configuration Browser: Chromium. Operating system: Arch Linux ### Logs #### Web server error log ``` [Thu Feb 06 00:56:08 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files_versions\\/Nunta' !!! \\ncache: Array\\n(\\n [fileid] => 10179\\n [storage] => home::ovidiub13\\n [path] => files_versions\\/Nunta\\n [parent] => 10178\\n [name] => Nunta\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 7243396\\n [mtime] => 1391618389\\n [storage_mtime] => 1391618389\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f26cddd67a1\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391640963\\n [size] => -1\\n [etag] => 52f2c1878f24c\\n [storage_mtime] => 1391640963\\n)\\n","level":0,"time":"2014-02-05T22:56:07+00:00"} [Thu Feb 06 01:09:30 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files_versions\\/Nunta' !!! \\ncache: Array\\n(\\n [fileid] => 10179\\n [storage] => home::ovidiub13\\n [path] => files_versions\\/Nunta\\n [parent] => 10178\\n [name] => Nunta\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 7723055\\n [mtime] => 1391640963\\n [storage_mtime] => 1391640963\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f2c1878f24c\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391640974\\n [size] => -1\\n [etag] => 52f2c4aa03019\\n [storage_mtime] => 1391640974\\n)\\n","level":0,"time":"2014-02-05T23:09:30+00:00"} [Thu Feb 06 01:12:23 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files_versions\\/Nunta' !!! \\ncache: Array\\n(\\n [fileid] => 10179\\n [storage] => home::ovidiub13\\n [path] => files_versions\\/Nunta\\n [parent] => 10178\\n [name] => Nunta\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 8291041\\n [mtime] => 1391640974\\n [storage_mtime] => 1391640974\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f2c4aa03019\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391641778\\n [size] => -1\\n [etag] => 52f2c556d6e93\\n [storage_mtime] => 1391641778\\n)\\n","level":0,"time":"2014-02-05T23:12:22+00:00"} [Thu Feb 06 01:13:10 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files_versions\\/Nunta' !!! \\ncache: Array\\n(\\n [fileid] => 10179\\n [storage] => home::ovidiub13\\n [path] => files_versions\\/Nunta\\n [parent] => 10178\\n [name] => Nunta\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 9117041\\n [mtime] => 1391641778\\n [storage_mtime] => 1391641778\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f2c556d6e93\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391641945\\n [size] => -1\\n [etag] => 52f2c5863c530\\n [storage_mtime] => 1391641945\\n)\\n","level":0,"time":"2014-02-05T23:13:10+00:00"} [Thu Feb 06 01:13:13 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files\\/Nunta' !!! \\ncache: Array\\n(\\n [fileid] => 10533\\n [storage] => home::ovidiub13\\n [path] => files\\/Nunta\\n [parent] => 2\\n [name] => Nunta\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 19848319\\n [mtime] => 1391641946\\n [storage_mtime] => 1391641946\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f2c55b74a1f\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391641989\\n [size] => -1\\n [etag] => 52f2c588cb484\\n [storage_mtime] => 1391641989\\n)\\n","level":0,"time":"2014-02-05T23:13:13+00:00"} [Thu Feb 06 01:13:59 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files_versions\\/Nunta' !!! \\ncache: Array\\n(\\n [fileid] => 10179\\n [storage] => home::ovidiub13\\n [path] => files_versions\\/Nunta\\n [parent] => 10178\\n [name] => Nunta\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 9942980\\n [mtime] => 1391641945\\n [storage_mtime] => 1391641945\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f2c5863c530\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391641994\\n [size] => -1\\n [etag] => 52f2c5b7d0ee8\\n [storage_mtime] => 1391641994\\n)\\n","level":0,"time":"2014-02-05T23:13:59+00:00"} [Thu Feb 06 01:14:13 2014] [error] [client 192.168.2.65] {"app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-02-05T23:14:13+00:00"} [Thu Feb 06 01:23:47 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files_versions\\/Nunta' !!! \\ncache: Array\\n(\\n [fileid] => 10179\\n [storage] => home::ovidiub13\\n [path] => files_versions\\/Nunta\\n [parent] => 10178\\n [name] => Nunta\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 10464856\\n [mtime] => 1391641994\\n [storage_mtime] => 1391641994\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f2c5b7d0ee8\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391642382\\n [size] => -1\\n [etag] => 52f2c80313ebe\\n [storage_mtime] => 1391642382\\n)\\n","level":0,"time":"2014-02-05T23:23:47+00:00"} [Thu Feb 06 01:26:51 2014] [error] [client 192.168.2.65] {"app":"core","message":"redirectToDefaultPage: http:\\/\\/owncloud.geekaliens.com\\/index.php\\/apps\\/files","level":0,"time":"2014-02-05T23:26:51+00:00"} [Thu Feb 06 01:27:35 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! No reuse of etag for 'files_trashbin\\/files' !!! \\ncache: Array\\n(\\n [fileid] => 10170\\n [storage] => home::ovidiub13\\n [path] => files_trashbin\\/files\\n [parent] => 10169\\n [name] => files\\n [mimetype] => httpd\\/unix-directory\\n [mimepart] => httpd\\n [size] => 32217127\\n [mtime] => 1391623109\\n [storage_mtime] => 1391623109\\n [encrypted] => \\n [unencrypted_size] => 0\\n [etag] => 52f27bd3db833\\n)\\n \\ndata: Array\\n(\\n [mimetype] => httpd\\/unix-directory\\n [mtime] => 1391642036\\n [size] => -1\\n [etag] => 52f2c8e6a6218\\n [storage_mtime] => 1391642036\\n)\\n","level":0,"time":"2014-02-05T23:27:35+00:00"} [Thu Feb 06 01:36:18 2014] [error] [client 192.168.2.65] {"app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-02-05T23:36:17+00:00"} ``` #### ownCloud log (data/owncloud.log) ``` {"app":"PHP","message":"file_put_contents(\/media\/sf_ownCloud\/.htaccess): failed to open stream: Permission denied at \/var\/www\/owncloud\/lib\/private\/setup.php#184","level":2,"time":"2014-01-31T04:14:40+00:00"} {"app":"PHP","message":"file_put_contents(\/media\/sf_ownCloud\/index.html): failed to open stream: Permission denied at \/var\/www\/owncloud\/lib\/private\/setup.php#185","level":2,"time":"2014-01-31T04:14:40+00:00"} ``` I will provide any other necessary information to fix this.

madpipeline avatar Feb 05 '14 23:02 madpipeline

Does it only happen with graphical file ?

@georgehrke could it be the thumbnail hook ?

PVince81 avatar Feb 06 '14 09:02 PVince81

\OC\Preview generates thumbnails on demand, not after the upload, so I don't think this is related.

georgehrke avatar Feb 06 '14 10:02 georgehrke

@PVince81 I can't confirm if it hapens only with graphical files. This is what I've worked with so far since I installed this owncloud.

One mistake in my Bug reoprt: I have more than just the files app installed. I also have: Documents, Pictures, Deleted files, First Run Wizard, Full Text Search, PDF Viewer, Share files, Text Editor, Updater and Versions.

madpipeline avatar Feb 06 '14 13:02 madpipeline

Can you try applying this patch if possible: https://github.com/owncloud/core/pull/6907 This will log more useful information that should help finding out what's going on. Thanks.

PVince81 avatar Feb 07 '14 15:02 PVince81

I've added the patch, now just to use it and wait for the error to happen again.

madpipeline avatar Feb 07 '14 22:02 madpipeline

while trying to sync a large file (116,8MiB) I got the same errors again from the client: "The server did not provide an Etag." and "Bad request"

Here is the apache error log:

[Fri Feb 14 01:14:12 2014] [error] [client 192.168.2.65] {"app":"OC\\\\Files\\\\Cache\\\\Scanner","message":"!!! Path 'files\\/Documente\\/UPT\\/GPS' is not readable !!!","level":0,"time":"2014-02-13T23:14:12+00:00"}
[Fri Feb 14 01:21:41 2014] [error] [client 192.168.2.65] {"app":"webdav","message":"Exception: Sabre_DAV_Exception_BadRequest: expected filesize 7173579 got 0","level":4,"time":"2014-02-13T23:21:41+00:00"}
[Fri Feb 14 01:22:38 2014] [error] [client 192.168.2.65] {"app":"webdav","message":"Exception: Sabre_DAV_Exception_BadRequest: expected filesize 10485760 got 0","level":4,"time":"2014-02-13T23:22:38+00:00"}
[Fri Feb 14 01:26:59 2014] [error] [client 192.168.2.65] {"app":"webdav","message":"Exception: Sabre_DAV_Exception_BadRequest: expected filesize 10485760 got 0","level":4,"time":"2014-02-13T23:26:59+00:00"}

madpipeline avatar Feb 13 '14 23:02 madpipeline

It looks like some chunks of that file couldn't be written to disk for some reason. I suppose this is still happening randomly ?

  1. Can you check whether there is enough disk space on the partition where the "data/" folder is ? The way it works with big files: chunks of the big file are uploaded into the "data/username/cache" dir, then put together into a single "part" file, then that "part" file will overwrite the original file.

If you're close to the disk space limit it could happen that you didn't have extra 116 MB for the chunking to happen.

  1. Is your "data" partition on an NFS mount or some remote storage ?

  2. While looking for hints I saw that your server has only 128 MB RAM which might be a bit too tight. :frowning:

PVince81 avatar Feb 14 '14 11:02 PVince81

I have 136GB free on that partition. As I've mentioned in the bug description: The server runs in a Virtual Machine. The data directory is in a shared directory that lies on an external USB 2TB HDD. There were no power outages or other electricity problems. I'm using the same HDD for other services as well, and I haven't had any problems with them.

I'll increase the ram to 200MB.

madpipeline avatar Feb 14 '14 11:02 madpipeline

As discussed on IRC:

  • RAM was increased to 512 MB
  • data directory was changed to standard dir
  • problems still occur
  • there are stray chunk files in the "cache" folder and no part files was found, nor target file in the data dir

PVince81 avatar Feb 14 '14 17:02 PVince81

Increased the RAM to 512 MB at the recommendation of @PVince81 I've also increased the video memory to 64MB.

On uploading a picture from the Android client I got this in the owncloud.log:

{"app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/InstantUpload\/IMG_20140214_185938.jpg' is not readable !!!","level":0,"time":"2014-02-14T17:28:48+00:00"}
{"app":"webdav","message":"Exception: Sabre_DAV_Exception_NotFound: File with name InstantUpload\/IMG_20140214_185938.jpg could not be located","level":4,"time":"2014-02-14T17:28:49+00:00"}
{"app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'files\/InstantUpload\/IMG_20140214_185938.jpg' is not readable !!!","level":0,"time":"2014-02-14T17:28:58+00:00"}
{"app":"webdav","message":"Exception: Sabre_DAV_Exception_NotFound: File with name InstantUpload\/IMG_20140214_185938.jpg could not be located","level":4,"time":"2014-02-14T17:28:58+00:00"}

The client reported upload success. The file is not available to be viewed from the webUI.

I can see 2 chunks in the cache for this file.

madpipeline avatar Feb 14 '14 17:02 madpipeline

I seem to encounter the same problem, however not with graphical files.

installation 1, is synology (4.3) with enough free space, running ownCloud 6.0.1 (stable) containing (old) files, that have been uploaded through its web interface e.g. in subdir NN/Part/Rep/fn085 ( web interface states: 698.3kB, 4 days ago) file fn085.vp.sib is not present in the subdir.

installation 2, mac osx 10.6 running owncloud mac "Version 1.4.1 (build 2275)" having been installed, put link in, and ask to "get local copy" from installation 1. Then I put the file fn085.vp.sib in the subdir NN/Part/Rep/fn085

Now the sync tool on (mac) installation 2 states (in the "Activity" tag):

File:                                                   Folder:           Action:
NN/Part/Rep/fn085/fn085.vp.sib       ShareFolder   The item is not synced because of previous errors: The server did not provide an Etag.

For completeness:

  1. my connection (from installation 2 to installation 1) is via a http proxy server that once in a while refuses some requests.
  2. when launching owncloud on installation 2, I get messages on stderr:
objc[97399]: Class WebCoreMovieObserver is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore and /Applications/owncloud.app/Contents/MacOS/../Frameworks/QtWebKit.framework/Versions/4/QtWebKit. One of the two will be used. Which one is undefined
  1. I contact my installation 1 via webdav + https, where installation 1 has a self-signed certificate.

in the logging produced (on installation 2) if owncloud is started as: owncloud --logdir this_dir/ I discover:

03-06 23:19:52:004 csync_ftw: Uniq ID from Database: NN/Part/Rep/fn085/fn085.vp.sib -> 
03-06 23:19:52:004 csync_walker: file: /Users/liselorev/Documents/_Owncloud/NN/Part/Rep/fn085/fn085.vp.sib
03-06 23:19:52:004 _csync_detect_update: ==> file: NN/Part/Rep/fn085/fn085.vp.sib - hash 17419303312023879059, mtime: 1393775687, fileId: 
03-06 23:19:52:004 csync_statedb_get_stat_by_hash: No result record found for phash = 17419303312023879059
03-06 23:19:52:004 _csync_detect_update: file: NN/Part/Rep/fn085/fn085.vp.sib, instruction: INSTRUCTION_NEW <<=
03-06 23:19:52:004 csync_ftw:  <= Closing walk for /Users/lislorev/Documents/_Owncloud/NN/Part/Rep/fn085 with read_from_db 0

liselorev avatar Mar 06 '14 22:03 liselorev

Please try upgrading to 6.0.2, it comes with better error logging on the server side. Hopefully we'll be able to see what error appears in the server log when you get "server did not return etag".

PVince81 avatar Mar 11 '14 09:03 PVince81

I've tried. I can't. No errors shown. It just freezes. I can give you access to the server if you want, so you can take a look.

madpipeline avatar Mar 11 '14 13:03 madpipeline

I get this on 6.0.2:

Fatal webdav Exception: Sabre_DAV_Exception_NotFound: File with name DirektUppladdning/IMG_20140319_141828.jpg could not be located 2014-03-19T15:48:16+00:00

enoch85 avatar Mar 19 '14 17:03 enoch85

Same here https://github.com/owncloud/core/issues/7950 For every upload with android client I get a fatal webdav exception.

webwude avatar Apr 01 '14 13:04 webwude

I think we're mixing up issues here. For the "Sabre_DAV_Exception_NotFound" issue, in most cases it can be ignored. The sync clients will first check whether a file exists before uploading. When doing the check, they will try to access the file. If the file does not exist, that exception is logged (we should try and remove it in such cases). And after that it will upload the file.

If that exception appearing in the log does not disturb the upload, then you can ignore it. If the upload really failed, then it is indeed an error.

But from @ovidiub13 's comments it doesn't seem to be related. In his case the server completely freezes.

PVince81 avatar Apr 10 '14 11:04 PVince81

My log is still flooded with:

Fatal webdav Sabre_DAV_Exception_NotFound: File with name *******.jpg could not be located

Even after upgrade to 6.0.3. Shouldn´t this just be a debug message?

enoch85 avatar May 04 '14 17:05 enoch85

It is. The trouble is that the sync client triggers a 404 on purpose to check whether a file exists before uploading. I guess this one should probably be logged as DEBUG instead of ERROR.

PVince81 avatar May 05 '14 08:05 PVince81

Aah ok, now I get it. Will this be fixed soon?

enoch85 avatar May 05 '14 09:05 enoch85

@enoch85 let's continue the discussion about the not found case here: #7541

PVince81 avatar May 05 '14 09:05 PVince81