Univention Bugzilla – Bug 50119
[UDM HTTP API] PATCH and POST always fail with HTTP 412: Precondition Failed (If-Match "..." does not match entity tag(s) .
Last modified: 2019-10-02 16:06:33 CEST
It's currently not possible to change any object! Both PATCH and POST always fail with HTTP 412: Precondition Failed (If-Match "..." does not match entity tag(s) . Reproduce with: $ curl -i -X PATCH -u Administrator:univention -H "Accept:application/json" -H "Content-Type:application/json" -d '{ "properties": { "title": "Mr." } }' 'http://m66.uni.dtr/univention/udm/users/user/uid=demo_admin,cn=mitarbeiter,cn=users,ou=DEMOSCHOOL,dc=uni,dc=dtr' -------------------------------------------------------------------------- HTTP/1.1 412 Precondition Failed Date: Fri, 06 Sep 2019 02:56:02 GMT Server: Univention/1.0 X-Permitted-Cross-Domain-Policies: master-only X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff X-Frame-Options: DENY Content-Length: 320 Content-Language: en-US Vary: Accept,Accept-Language,Accept-Encoding,Authorization Content-Type: application/json Via: 1.1 m66.uni.dtr {"_links": {"curies": [{"href": "http://m66.uni.dtr/univention/udm/relation/{rel}", "name": "udm", "templated": true}]}, "error": {"message": "HTTP 412: Precondition Failed (If-Match \"e58d30bee63ef03629e9b0ed5b2cd0103f2e663f\" does not match entity tag(s) .)", "code": 412, "traceback": null, "error": {}, "title": ""}} -------------------------------------------------------------------------- $ curl -X GET -H "Accept:application/json" -u Administrator:univention 'http://m66.uni.dtr/univention/udm/users/user/uid=demo_admin,cn=mitarbeiter,cn=users,ou=DEMOSCHOOL,dc=uni,dc=dtr' | python -m json.tool | sed 's/"mailUserQuota": 0,/"mailUserQuota": 5,/g' > /tmp/demo_admin.json $ curl -i -X PUT -H "Accept:application/json" -H "Content-Type:application/json" -d "$(cat /tmp/demo_admin.json)" -u Administrator:univention 'http://m66.uni.dtr/univention/udm/users/user/uid=demo_admin,cn=mitarbeiter,cn=users,ou=DEMOSCHOOL,dc=uni,dc=dtr' -------------------------------------------------------------------------- HTTP/1.1 412 Precondition Failed Date: Fri, 06 Sep 2019 02:56:02 GMT Server: Univention/1.0 X-Permitted-Cross-Domain-Policies: master-only X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff X-Frame-Options: DENY Content-Length: 320 Content-Language: en-US Vary: Accept,Accept-Language,Accept-Encoding,Authorization Content-Type: application/json Via: 1.1 m66.uni.dtr {"_links": {"curies": [{"href": "http://m66.uni.dtr/univention/udm/relation/{rel}", "name": "udm", "templated": true}]}, "error": {"message": "HTTP 412: Precondition Failed (If-Match \"e58d30bee63ef03629e9b0ed5b2cd0103f2e663f\" does not match entity tag(s) .)", "code": 412, "traceback": null, "error": {}, "title": ""}} --------------------------------------------------------------------------
This is a blocker for performance oriented code. Usage of Etag→If-Match is an important security oriented feature, but it has to be an *optional* one.
Fixed in: univention-management-console-module-udm (9.0.12-35) 7803a2c1a9ff | Bug #27816: Bug #50119: fix enforced If-Match header
OK: works for me (functional test as in opening text)
UCS 4.4-2 has been released: https://docs.software-univention.de/release-notes-4.4-2-en.html https://docs.software-univention.de/release-notes-4.4-2-de.html If this error occurs again, please use "Clone This Bug".