-
Notifications
You must be signed in to change notification settings - Fork 149
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
Wrong error code from Xrootd bridge for file exists #1167
Comments
This avoids the issue in xrootd#1167, which causes the wrong error code to be given for a known error text. This simply looks for the known error text and corrects the HTTP status code.
I left a comment in the pull request but I will post here as well. I looked, indeed, the cmsd does not differentiate the between ENOENT and EEXISTS. The correct error code should have been returned by the cmsd and, in fact, it's supposed to do that. I agree that it isn't obvious because error code handling becomes complicated when the cmsd attempts a retry and gets yet another error. However, in this case it's pretty straightforward as a retry is not possible. So, it's not too complicated to fix this. That does that change your opinion on the fix? |
I spent about an hour tinkering with different approaches to fixing the return code from the cmsd. However, it was quickly becoming a wholesale rewrite of all return codes between the server and client - it kept snowballing into pieces of the codebase I wasn't familiar with. So, I agree with the idea that we really should fix the problem at the root. That said - this is somewhat critical / urgent because it causes problems with the Given doing a reasonable fix looked like a large-scale project (which are best not rushed) -- and needing a short-term fix for |
OK, sounds reasonable. We will have to remember to remove this, I suppose (though we will likely forget). My take is that you want this back ported to 4.11.x but we have already released it so it would look like 4.11.4 which we don't mind doing. Of course, that won't be as quick as I think you expect, given the circumstances. |
One more thing, EEXISTS is now mapped to kXR_InvalidRequest which is used to indicate what is meant (e.g. duplicate logins, bypassing authentication, bad request code). So, dumping EEXISTS in that mess is awkward but not devastating. I suppose you'd want a separate error code for that when we fix this in R5, right? |
That'd be a reasonable thing to do. That said, in |
So, maybe I'll leave it that way. Anyway, how come gfal2 doesn't use the mkpath option of mkdir. That way it would all just get done in a single try. Is that possible to do with WebDav? |
No - to the best of my knowledge, there's nothing equivalent to the |
Well, that can be corrected since the gfal person is also the xroot person, funny that. I'll bring it to their attention. Anyway, it won't be difficult to return the correct error code after all. I'm working on it now. It also gives me a chance to cleanup up some ugly code. |
OK, the pull request you have will work in all releases prior to R5. In R5 the text changes (which is why text scraping is bad) to one of: So, the line: That way you will be immune in case the code doesn't change for R5 to take advantage of the fact the the right error code (kXR_InvalidRequest) will be returned. I changed the text once I realized it was completely wrong for directories. |
This avoids the issue in xrootd#1167, which causes the wrong error code to be given for a known error text. This simply looks for the known error text and corrects the HTTP status code.
@abh3 - since I'm a little worried about what other error responses include the phrase That said, after your latest correction of the correct error code, this patch is superfluous in R5. I'm going to close the PR and redo it against the stable branch. |
This avoids the issue in xrootd#1167, which causes the wrong error code to be given for a known error text. This simply looks for the known error text and corrects the HTTP status code.
OK, just make sure you will be capturing the error via the code.
…On Mon, 30 Mar 2020, Brian P Bockelman wrote:
@abh3 - since I'm a little worried about what other error responses include the phrase `already exists`, I simply enumerated the two known cases. Rebased and retested it against the latest master.
That said, after your latest correction of the correct error code, this patch is superfluous in R5. I'm going to close the PR and redo it against the stable branch.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1167 (comment)
|
This has been corrected, though it doesn't seem the http code tests for this particular error code. However, the way it's implemented it sort of works anyway. |
When a file exists, the cmsd returns the wrong error code (or maybe just doesn't provide a distinct error code?) resulting in the wrong xrootd error code.
See the following example (note PID 2072999 is the
cmsd
and 2075105 is thexrootd
):I think what happens is the
-2
error code in thecmsd
response is interpreted as a Unixerrno
by thexrootd
daemon, which corresponds toENOENT
and then mapped to error code3011
.The wrong response (3011 is
kXR_NotFound
or file not found) is causing the HTTP protocol to return the wrong response and clients to take the wrong action.The right fix isn't readily apparent -- it looks like giving the "right" error code from the
cmsd
would be a large-scale protocol break, which I'm not confident in doing immediately. May have to do a short-term workaround based on the error message in the meantime.The text was updated successfully, but these errors were encountered: