The server did not provide an ETag when using Nginx
Hi,
When I'm using nginx and the new release of sync client (1.4.1) I'm getting "The server did not provide an Etag" when uploading files. Then after 5mins or so when the sync client request for the file details error is gone. But when I'm using Apache there are no errors.
On the previous release of sync client (1.3.0) there are no errors for both apache and nginx.
Is there any issues with ETag and Nginx?
Server:
nginx/1.4.1 owncloud 5.0.11 PHP Version 5.4.20
Hi,
have you tried to see with a tool like cadaver:
cadaver http://yourserver/remote.php/webdav propget .
if the result contains a line like:
DAV: getetag = "525bd7262731f"
With this you can see if this is a problem of the client or the server.
Fetching properties for `.': getetag = "525e0f7b4f330"
Does the client expect an etag on PUT?
Hi
I enabled the logging and below is what I got:
10-16 14:15:52:367 oc_module: PUT request on /remote.php/webdav/sample.txt! 10-16 14:15:52:367 oc_module: Sendfile handling request type PUT. fd 3 10-16 14:15:52:367 oc_module: about to send 1 block 10-16 14:15:52:367 oc_module: Chunk upload completed for 'owncloud://mysite/remote.php/webdav/sample.txt' (144693 bytes out of 144693) 10-16 14:15:52:627 status.php returns: "{"installed":"true","version":"5.0.20","versionstring":"5.0.11","edition":""}" 0 Reply: QNetworkReplyImpl(0x7596630) 10-16 14:15:52:627 #-------# oC found on "http://mysite" 10-16 14:15:53:454 _csync_push_file: file: C:/Users/default\ownCloud/sample.txt, command: sendfile, error: No error from errno 0 10-16 14:15:53:454 _csync_push_file: remember chunk: 0 (transfer id -487121674 ) 10-16 14:15:53:454 csync_propagate: Propagation for local replica took 1.10 seconds visiting 3 files. 10-16 14:15:53:454 csync_propagate: Propagation for remote replica took 0.00 seconds visiting 2 files. 10-16 14:15:53:454 void Mirall::CSyncThread::startSync() Sync finished 10-16 14:15:53:454 csync_statedb_get_stat_by_hash: No result record found for phash = 1898004223709294578 10-16 14:15:53:944 _insert_metadata_visitor: SQL statement: INSERT INTO metadata_temp (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5) VALUES (7772379496350463016, 6, Shared, 152705, 0, 0, 16895, 1381904119, 2, 5257483e76ce1); 10-16 14:15:53:946 _insert_metadata_visitor: SQL statement: INSERT INTO metadata_temp (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5) VALUES (-4385185172631462396, 29, Shared/TTS Seismic Operations, 152706, 0, 0, 16895, 1381451591, 2, 525747476654e); 10-16 14:15:54:109 csync_statedb_write_progressinfo: INSERT INTO progress (phash, modtime, md5, chunk, transferid, error_count, tmpfile, error_string) VALUES(1898004223709294578, 1381222182, '(NULL)', 0, -487121674, 1, '(NULL)', 'The server did not provide an Etag.');
I can confirm this issue using Nginx and sync client version 1.5 nightly from 06-12-2013. @danimo @dragotin
@fossxplorer no idea, I don't use nginx in conjuction with ownCloud, and I am not an expert on nginx and PHP. I
Any help with this is welcome.
The etag is added as custom header to the reply on the PUT. Maybe that needs to be allowed somehow on nginx?
I'm gonna stick with Apache as it works fine :) Thanks.
@fossxplorer @redknight101
Are you using ngx_pagespeed? https://github.com/owncloud/core/issues/6396
i can also confirm this issue. i am not using pagespeed.
found a suggestion on https://github.com/owncloud/mirall/issues/1291 which noted that when a file is gzipped, no etag is provided.
turns out that common default nginx paramters are set to gzip text, html, css and other static resources and those files are sent down without etags. adding gzip off; in the server clause of your nginx configuration
this ticket is particularly about upload, but i am not able to reproduce the issue and am able to upload just fine. (though, if you were to upload a .css file and had gzip turned on, it would cause the symptoms reported in this issue)
i suggest owncloud documenters update their nginx sample config file or update mirall to use other caching signals besides etag.
I am closing that as it is reported for an old client version. Please update to 1.5.0. The nginx hints however (turning off gzip) are still valid. Thx..
Hi,
Still have the error. Upgraded both web and sync client.
I added a fix in Sabre DAV code it seems to work.
File: /owncloud/3rdparty/Sabre/DAV/Server.php Line 890 and 906: From: if ($etag) $this->httpResponse->setHeader('ETag',$etag);
To: if ($etag){ $this->httpResponse->setHeader('ETag',$etag); $this->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); }