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

The remote server returned an error: (412) Precondition Failed. #21

Open
pietergent opened this issue Aug 15, 2015 · 5 comments
Open

The remote server returned an error: (412) Precondition Failed. #21

pietergent opened this issue Aug 15, 2015 · 5 comments

Comments

@pietergent
Copy link

Hi, 0.6 it seems to work in most cases, but for some rows I receive this error when doing an update: "The remote server returned an error: (412) Precondition Failed.". No clue yet why I receive this error for some rows and not for others :-/

System.Net.WebException was unhandled
HResult=-2146233079
Message=The remote server returned an error: (412) Precondition Failed.
Source=System
StackTrace:
at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
at System.Net.WebClient.UploadString(Uri address, String method, String data)
at GDataDB.Impl.Row`1.Update() in c:\prg\GDataDB\GDataDB\GDataDB\Impl\Row.cs:line 24

@mausch
Copy link
Owner

mausch commented Aug 15, 2015

Can you post a failing test?

@pietergent
Copy link
Author

I found out in the meantime what caused the problem. These are all rows that are updated twice without refreshing the GDataDB.ITable in the meantime. So kind of sounds logic to me that it cannot update the row anymore as it does not contain the original values anymore?

@mausch
Copy link
Owner

mausch commented Aug 17, 2015

You mean you have multiple concurrent writers? Or does even a simple row.Update(); row.Update(); fail?

@pietergent
Copy link
Author

Not Multiple concurrent writers, but 2 times an update.
It can be reproduced in your sample code. In Program.cs, replace

            r.Element.Conteudo = "nothing at all";
            Console.WriteLine("updating row");
            r.Update();

with

            r.Element.Conteudo = "nothing at all";
            Console.WriteLine("updating row");
            r.Update();
            r.Element.Conteudo = "nothing at all again";
            Console.WriteLine("updating row again");
            r.Update();

(where the 5th and 6th line are not even needed to reproduce it)

@mausch
Copy link
Owner

mausch commented Aug 18, 2015

My guess is we need to change the row's etag with the response of each update. Could you check that?

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

No branches or pull requests

2 participants