HTTP Status Code 412 Precondition Failed occurs when the client sends a precondition to serving the content (such as an If-Match header) that does not meet expectations.
Questions tagged [http-status-code-412]
27 questions
73
votes
3 answers
When is it appropriate to respond with a HTTP 412 error?
It is unclear to me when you should and should not return a HTTP 412: Precondition Failed, error for a web service? I am thinking of using it when validating data. For example, if a client POST's XML data and that data is missing a required data…

TERACytE
- 7,553
- 13
- 75
- 111
33
votes
3 answers
Http Status Code 400 vs 412
So I'm developing a Rest API
When a POST is made to create a resource and a required field is missing what should I return?
400 - Bad Request
OR
412 - Precondition Failed
And Why?

adamclerk
- 759
- 1
- 6
- 15
12
votes
1 answer
HTTP Status 412 (Precondition Failed) and Database Versioning
I am implementing a RESTful web service that accesses a database. Entities in the database are versioned to detect multiple updates. For instance, if the current value is {"name":"Bill", "comment":"tinker", "version":3}, if one user PUTs…

Mark Lutton
- 6,959
- 7
- 41
- 57
5
votes
4 answers
Firebase storage returning 412 error even after enabling storage API
We have already used firebase storage for storing the images and files in our application. Recently our files seem to bee not loading in the application and once cross-checking I found the following error.
{
"error": {
"code": 412,
…

Athulya Ratheesh
- 291
- 4
- 22
5
votes
1 answer
How to fix 412 (Precondition Failed) Error HTML5 Video Tag
I am using HTML5 video tag inside FlexSlider. Sometimes video stops working. After lot of search I got this error.
GET http://studiobooth.local/app/videos/0062mParticle12151601.mp4 412 (Precondition Failed)
Here is my HTML5 Video tag code:
5
votes
3 answers
HTTP Response 412 - can you include content?
I am building a RESTful data store and leveraging Conditional GET and PUT. During a conditional PUT the client can include the Etag from a previous GET on the resource and if the current representation doesn't match the server will return the HTTP…

Gandalf
- 9,648
- 8
- 53
- 88
4
votes
1 answer
UPnP subscription renewal fails on the device
When I try to renew the UPnP event subscription on the device, I have an 412 HTTP Error: Precondition Failed, bad SID.
This error occurs only on one device, all other devices works fine.
Buggy device is an D-Link XTreme N GIGABIT Router DIR-655…

Bernd Jacobi
- 571
- 2
- 5
- 18
3
votes
2 answers
Connect to AEM 6.0 JCR: Precondition Failed
I am having some issues connecting to the JCR repository within AEM 6.0. When I get to the point of creating a session on the repostory I get a javax.jcr.lock.LockException: Precondition Failed.
I have been using this tutorial to get started.…

DFenstermacher
- 564
- 1
- 9
- 23
3
votes
1 answer
Is Http status code 412 suitable for error based on rules defined in our domain
I have an api endpoint that returns a Voucher object.
The voucher is retrieved from a third party.
There are some conditions, for example an expired date, that we check for / validate on.
So, if a client application requests /voucher/1234…

Alex
- 37,502
- 51
- 204
- 332
3
votes
0 answers
Every other refresh of a page containing a $.ajax() request causes a status 412 error
The problem only occurs on Safari for Mac.
I'm loading clean json data files, with the following:
$.ajax({
url : url,
type : 'POST',
dataType : 'json',
contentType : 'application/json; charset=utf-8',
…
user56512
2
votes
2 answers
Getting "H2OResponseError: ModelBuilderErrorV3" "Missing training frame" when training with GLM http_status = 412
Using the python library, I'm training a GLM as part of a H2O ensemble that I'm creating:
(relevant snippet from script):
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
estimator = H2OGeneralizedLinearEstimator(
nfolds=5,…

David Jacques
- 179
- 2
- 9
2
votes
2 answers
CalDav Client for iCloud: MKCOL fails with 412 precondition failed
I need help.
I implemented a CalDav Client on our System and it worked like a charm. Now I have some problems with creating new calendars on iCloud. Maybe some of you know how I can fix this.
Currently I get a 412 Error.
Headers:
"Depth:…

Klerafukan
- 53
- 6
2
votes
0 answers
Couchdb HTTP 412 Error : missing_stub
I'm having an issue with couchdb 1.2.0 while saving multiple documents using the bulk API.
Request info :POST /myCouchDB/_bulk_docs
Response info :HTTP 412 (Error: missing_stub id:customerfile-36975, name:contract)
This HTTP 412 error occurs…

nfauvel
- 21
- 3
2
votes
0 answers
Handling failures when using Expect: 100-Continue with HttpClient
I'm interested in optimizing the behavior of a client calling a REST API. In this API, a particular POST operation allows for the inclusion of a If-None-Match: * header, which causes the server to report an HTTP 412 response if the item being…

Sam Harwell
- 97,721
- 20
- 209
- 280
2
votes
1 answer
KendoUI pages returning 412 (Precondition Failed) after OSX 10.9 Upgrade
I have a site running on a localhost that uses different KendoUI grids loaded from a kendoPanelBar. It was all working fine until I updated to OSX 10.9 (Mavericks). Now I can load a grid once using a $.post jquery call, but then the second time I…

Andrew Sinagra
- 232
- 1
- 4
- 14