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

Introduce new X-OC-ETag header to fix some sync issues. #9005

Closed
guruz opened this issue Jun 12, 2014 · 15 comments · Fixed by #10725 or #15168
Closed

Introduce new X-OC-ETag header to fix some sync issues. #9005

guruz opened this issue Jun 12, 2014 · 15 comments · Fixed by #10725 or #15168
Assignees
Milestone

Comments

@guruz
Copy link
Contributor

guruz commented Jun 12, 2014

The syncing client uses the ETag header for its syncing algorithm.

There is however a difference in semantics of what the sync client needs and what the HTTP RFC (and servers) implement.

The syncing client uses the ETag to uniquely identify (changed) file contents.
The HTTP servers do the same, however compressing responses (Content-Encoding) also changes or removes the ETag.
(The sync client doesn't want that!)

This can be seen for example here:
https://httpd.apache.org/docs/trunk/mod/mod_deflate.html#deflatealteretag
http://lxr.nginx.org/source/src/http/modules/ngx_http_gzip_filter_module.c#0309
pagespeed modules (lost the link)

So a plain webserver works fine with the sync client, but as soon as users configure gzip on their servers, it might break.

A solution would be for the server to additionally(!) send a X-OC-ETag header with the "real" oC file ETag.

I will try to do a pull request. Probably code change in lib/private/connector/sabre/file.php in get() if no one has a better idea

(This should be done for oC6 and oC7)

CC @ogoffart @PVince81 @dragotin

Source issues:
owncloud/client#1291
owncloud-archive/documentation#344
owncloud/client#1097
owncloud/client#1306

@guruz guruz added the Bug label Jun 12, 2014
@guruz guruz self-assigned this Jun 12, 2014
@PVince81
Copy link
Contributor

Sounds good.
Until now I believed that my ownCloud server runnining on openSUSE + Apache 2 had gzip enabled by default. But what you wrote above seem to imply that it doesn't, else I'd have experienced that etag issue already.

CC @karlitschek @craigpg @icewind1991

@blizzz
Copy link
Contributor

blizzz commented Jun 12, 2014

@PVince81 see the first link – Apache's behaviour can be configured so it keeps, modifies or removes it. Unchanged was default until Apache 2.4.

@ghost
Copy link

ghost commented Jun 14, 2014

Hi,

some so called "security guides" are also recommending to set:

Header unset ETag
FileETag None

in the apache config which removes the used ETag header completely.

Source: https://forum.owncloud.org/viewtopic.php?f=14&t=16800&start=10

@PVince81
Copy link
Contributor

@craigpg @karlitschek please evaluate the priority. Thanks.

@MTRichards MTRichards added this to the ownCloud 7.0.1 milestone Jun 20, 2014
@PVince81
Copy link
Contributor

Seems the priority was set to 7.0.1

@DeepDiver1975
Copy link
Member

Regarding the naming of the header - we shall not prefix it with 'X-' - this is an deprecated convention.
Simply OC-ETag is valid

@guruz guruz assigned DeepDiver1975 and unassigned guruz Aug 29, 2014
guruz added a commit to owncloud/client that referenced this issue Aug 29, 2014
@craigpg craigpg modified the milestones: 2014-sprint-03-next, 2014-sprint-02-current Sep 2, 2014
@PVince81
Copy link
Contributor

PVince81 commented Feb 6, 2015

Reopening this, setting to 8.0.1

@PVince81 PVince81 reopened this Feb 6, 2015
@PVince81 PVince81 modified the milestones: 8.0.1-next-maintenance, 2014-sprint-03 Feb 6, 2015
@PVince81
Copy link
Contributor

PVince81 commented Feb 6, 2015

(the original fix was reverted here: #13932)

@nsymms
Copy link

nsymms commented Mar 21, 2015

The ETag issue has been opened / closed / fixed / reverted so many times I've lost track.

I'm still having the same problem with server v8.0.2 using nginx. The v1.7.1 windows client continues to receive a tiny text file over and over again because "No E-Tag received from server."

What's going to happen with this? Since this particular issue (9005) is still open, is the issue still active? Or did someone just forget to close this issue?

I can post logs and other info if needed.

@ghost
Copy link

ghost commented Mar 21, 2015

@nsymms
Try to disable gzip in your NginX config: owncloud-archive/documentation#922

AFAIK this "X-OC-ETag" will be added in OC 8.1 so thats probably the reason why this issue here is still open.

@nsymms
Copy link

nsymms commented Mar 21, 2015

Thanks. gzip disabled, error disappeared. I was concerned because I saw PVince set it to target 8.0.1. Now I see that it is an 8.1 fix.

On a side note, I am using OC inside a docker container, so I had to disable gzip on both the container's nginx and the outside nginx proxy (just for the OC server).

@ghost
Copy link

ghost commented Mar 22, 2015

@nsymms
Great, thanks for the feedback. Hope my documentation change linked above will be merged soon.

Really wonder why no one had found the initial problem which i had already reported nearly a year ago in owncloud-archive/documentation#344

@PVince81
Copy link
Contributor

I merged it too quickly... sorry. Revert PR here #15218

The problem is described here: #15168 (comment)

@PVince81
Copy link
Contributor

Fix here: #15227
This one is much simpler and copies the Etag header in Sabre's "afterMethod"

@PVince81
Copy link
Contributor

Fixed through #15227

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants