# Message "failed to lock the page" when tring to edit a page

**URL:** <https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609>\
**Category:** Help / Discuss\
**Created:** [October 17, 2020, 7:48am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609 "2020-10-17T07:48:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gumn](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gumn/32/1464_2.png) [@gumn](https://forum.xwiki.org/u/gumn)\
**Post date:** [October 17, 2020, 7:48am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/1 "2020-10-17T07:48:53Z")

</div>

I can’t edit pages any more in the principal wiki (it still works in subwikis). Maybe it’s linked to the recent update - I’ve noticed a lot of changes included some social features.  
I checked that page creation and deletion still work.  
Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [October 19, 2020, 8:05am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/2 "2020-10-19T08:05:41Z")

</div>

You need to check the server logs for error messages that may be logged when trying to edit a page, and you should also look at the Network tab from the browser’s developer tools to get more information on the failed lock request (check the response).

---

<div class="post-metadata">

**Author:** ![gumn](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gumn/32/1464_2.png) [@gumn](https://forum.xwiki.org/u/gumn)\
**Post date:** [October 19, 2020, 7:23pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/3 "2020-10-19T19:23:31Z")

</div>

Thanks @mflorea ,  
I have nothing in the catalina log. The network tab gives us nothing after the 302 InplaceEditing get request - no response.  
But I also noticed, on the console, an error related to load block of the mixed active content.

---

<div class="post-metadata">

**Author:** ![gumn](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gumn/32/1464_2.png) [@gumn](https://forum.xwiki.org/u/gumn)\
**Post date:** [October 21, 2020, 12:19pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/4 "2020-10-21T12:19:20Z")

</div>

We also noticed that it works using WYSIWYG edition.

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [October 22, 2020, 5:38am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/5 "2020-10-22T05:38:35Z")

</div>

> [@gumn](#):
>
> The network tab gives us nothing after the 302 InplaceEditing get request - no response.

You don’t have any HTTP requests there with 4xx or 5xx status code? “failed to lock the page” suggests that the lock request has failed, and 302 (redirect) is not a failure. Are there any JavaScript errors in the Console tab?

---

<div class="post-metadata">

**Author:** ![gumn](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gumn/32/1464_2.png) [@gumn](https://forum.xwiki.org/u/gumn)\
**Post date:** [October 23, 2020, 12:27pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/6 "2020-10-23T12:27:03Z")

</div>

![Capture du 2020-10-23 14-24-57](https://discourse.xwiki.org/uploads/default/original/2X/7/7fa6d1e394281c093bfca82053e38ed953b3382c.png) nothing after 302.  
 ![Capture du 2020-10-23 14-25-50](https://discourse.xwiki.org/uploads/default/original/2X/b/bd5f3cbe3cc713eb64f1682747966788f6a6d2ad.png) and a “TypeError : b is Null” message I had already before

---

<div class="post-metadata">

**Author:** ![ClemensRobbenhaar](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clemensrobbenhaar/32/930_2.png) [@ClemensRobbenhaar](https://forum.xwiki.org/u/ClemensRobbenhaar)\
**Post date:** [November 23, 2020, 8:01am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/7 "2020-11-23T08:01:50Z")

</div>

For some reason the request URL to lock the page uses http instead of https. Your browser is configured not to send such requests from a page with https.  
This might be some problem with the configuration or the setup. Is in the Wiki descriptor for the main wiki the “Secure” flag set?

---

<div class="post-metadata">

**Author:** ![gumn](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gumn/32/1464_2.png) [@gumn](https://forum.xwiki.org/u/gumn)\
**Post date:** [November 23, 2020, 9:35pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/8 "2020-11-23T21:35:00Z")

</div>

Dear Clemens,  
You’re right, it seems to call the http page, well spotted !  
But I checked and the secure flag is set in the wiki descriptor of the main wiki.  
Is there something else to check ?

---

<div class="post-metadata">

**Author:** ![ClemensRobbenhaar](https://forum.xwiki.org/user_avatar/forum.xwiki.org/clemensrobbenhaar/32/930_2.png) [@ClemensRobbenhaar](https://forum.xwiki.org/u/ClemensRobbenhaar)\
**Post date:** [November 23, 2020, 9:44pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/9 "2020-11-23T21:44:11Z")

</div>

If there is an apache or nginx running in front of the servlet engine, doing the HTTPS encryption, then XWiki in the backend might think that the request came in via plain HTTP and thus responds via HTTP sometimes.

If the servlet container is tomcat, adding a `scheme="https"` to the relevant `<Connector` element in the `server.xml` often helps.

---

<div class="post-metadata">

**Author:** ![gumn](https://forum.xwiki.org/user_avatar/forum.xwiki.org/gumn/32/1464_2.png) [@gumn](https://forum.xwiki.org/u/gumn)\
**Post date:** [January 9, 2021, 3:18pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/10 "2021-01-09T15:18:29Z")

</div>

Hello,  
We tested your proposal @ClemensRobbenhaar , many thanks.  
The problem is that doing that, the URL got back to local 8080 and xwiki is not reachable any more then.  
We use nginx as a proxy as you well guessed. So there might be some interference with the server settings.

---

<div class="post-metadata">

**Author:** ![pogo](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@pogo](https://forum.xwiki.org/u/pogo)\
**Post date:** [March 16, 2021, 10:20pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/11 "2021-03-16T22:20:57Z")

</div>

I have the exact same problem. Is there a solution?

I have installed XWiki using the official docker image from [GitHub - xwiki/xwiki-docker: Dockerfile to build and run XWiki on docker](https://github.com/xwiki/xwiki-docker) with docker compose and mysql.

What can I do to fix this? In the current state, xwiki is unusable.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [March 17, 2021, 8:08am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/12 "2021-03-17T08:08:08Z")

</div>

> [@pogo](#):
>
> What can I do to fix this? In the current state, xwiki is unusable.

XWiki doesn’t have any known problem (that I know of) regarding HTTPS. There are plenty of instances around the world using that. So if there’s an issue , I’d say it’s with the way you’ve setup your front end to use HTTPS somehow. Could you check it?

---

<div class="post-metadata">

**Author:** ![pogo](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@pogo](https://forum.xwiki.org/u/pogo)\
**Post date:** [March 17, 2021, 9:26am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/13 "2021-03-17T09:26:05Z")

</div>

I just followed the installation guide of the docker image and chose to use docker compose. I did not change any settings there.

My server uses plesk for administration and I you can just check “Use Let’s Encrypt” for https which I did. And then I put the following proxy rule for my xwiki subdomain in plesk (see screenshot).

![docker](https://forum.xwiki.org/uploads/default/original/2X/a/a208fb5332dfb9d56753f8bdbeb03dc7205f774b.png)

Interestingly, everything else in xwiki works with https. It is only the “edit” button that does not work. So, maybe it’s just one setting in xwiki that I missed? Or something like this?

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [March 17, 2021, 9:31am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/14 "2021-03-17T09:31:12Z")

</div>

> [@pogo](#):
>
> So, maybe it’s just one setting in xwiki that I missed? Or something like this?

There’s no setting for that in XWiki. Actually there’s nothing to do to support HTTPS in xwiki, see [https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Configuration/#HHTTPS2FSSL](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Configuration/#HHTTPS2FSSL)

---

<div class="post-metadata">

**Author:** ![pogo](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@pogo](https://forum.xwiki.org/u/pogo)\
**Post date:** [March 17, 2021, 9:14pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/15 "2021-03-17T21:14:22Z")

</div>

What is then the reason for the “failed to lock the page” message? Is there a documentation somewhere that explains in which situations this message appears? And how to fix it?

---

<div class="post-metadata">

**Author:** ![Beat\_Burgener](https://forum.xwiki.org/user_avatar/forum.xwiki.org/beat_burgener/32/413_2.png) [@Beat\_Burgener](https://forum.xwiki.org/u/Beat_Burgener)\
**Post date:** [March 29, 2021, 9:17pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/16 "2021-03-29T21:17:14Z")

</div>

I had the same battle with Apache to Tomcat and xWiki… easy “fix”: configure Tomcat to listen to https (like 8443) and use any certificate you want (self signed or whatever). As long as you have a reverse proxy in front that does not care about the backend certificate, you are fine … HTH

---

<div class="post-metadata">

**Author:** ![pogo](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@pogo](https://forum.xwiki.org/u/pogo)\
**Post date:** [April 1, 2021, 12:36pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/17 "2021-04-01T12:36:37Z")

</div>

thanks for your answer! how do I configure tomcat in such a way? (I’m using the docker image). Can you hint me to a tutorial or something?

---

<div class="post-metadata">

**Author:** ![Beat\_Burgener](https://forum.xwiki.org/user_avatar/forum.xwiki.org/beat_burgener/32/413_2.png) [@Beat\_Burgener](https://forum.xwiki.org/u/Beat_Burgener)\
**Post date:** [April 1, 2021, 10:18pm UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/18 "2021-04-01T22:18:56Z")

</div>

I don’t know the version and setup of the docker image as I never used it. But this should be straight forward by generating a certificate (pkcs should do), and then enable the connector in the server.xml. Make a copy of the server.xml to have a fallback. Then re-configure the reverse proxy to point to the https port (declaring the https scheme to connect to the backend)

---

<div class="post-metadata">

**Author:** ![Snowbridge](https://forum.xwiki.org/user_avatar/forum.xwiki.org/snowbridge/32/4301_2.png) [@Snowbridge](https://forum.xwiki.org/u/Snowbridge)\
**Post date:** [June 15, 2022, 10:35am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/19 "2022-06-15T10:35:54Z")

</div>

Same problem here on both 14.4.1 and 13.10.6  
Steps to reproduce:

1. create subwiki
2. log in to that subwiki as a read-write user which is NOT the owner
3. create a page, save
4. try to edit recently created page - you’ll get the ‘failed to lock page’ message

Prerequisites:

1. The xwiki is served via https
2. The default editor is Wysiwyg

The reason is:

1. browser sends the lock-request `GET https://domain/get/Main?action=lock...`
2. xwiki (the application itself) answers `302 location httP://domain/...`

And it doesn’t matter what the SSL and Port settings of the subwiki and/or mainwiki are set to

It is a bug. Maybe thats a Wysiwys-editors bug, but THERE IS a problem

**WORKAROUND**  
I’ve installed the [Realtime WYSIWYG Editor](https://extensions.xwiki.org/xwiki/bin/view/Extension/Realtime%20Wiki%20Editor/), assigned it as a default editor and it did the trick

- XWiki 13.10.6
- Realtime WYSIWYG Editor 13.10.6

---

<div class="post-metadata">

**Author:** ![tw0flower](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tw0flower/32/4380_2.png) [@tw0flower](https://forum.xwiki.org/u/tw0flower)\
**Post date:** [July 14, 2022, 6:38am UTC](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/20 "2022-07-14T06:38:08Z")

</div>

I faced the same problem, and it actually has to do with the configuration of Tomcat. @vmassol is right when he says there’s nothing to do to support HTTPS in XWiki. But at the same time you need to configure Tomcat and I found it hard to get the right piece of information.

Basically, the Docker container is not configured to support HTTPS by default, and the documentation on Github ([xwiki-docker/README.md at master · xwiki/xwiki-docker · GitHub](https://github.com/xwiki/xwiki-docker/blob/master/README.md)) does not directly contain instructions on how to make it production-ready.

You need to combine two pieces of information:

- Concerning Docker, the information you need is here: [GitHub - xwiki/xwiki-docker: Dockerfile to build and run XWiki on docker](https://github.com/xwiki/xwiki-docker#configuring-tomcat).  
The way to mount the Tomcat configuration can be found in this command: `docker run --net=xwiki-nw --name xwiki -p 8080:8080 -v /tmp/xwiki:/usr/local/xwiki -v /tmp/tomcat:/usr/local/tomcat/conf -e DB_USER=xwiki -e DB_PASSWORD=xwiki -e DB_DATABASE=xwiki -e DB_HOST=mysql-xwiki xwiki:lts-mysql-tomcat`.
- To configure Tomcat you need to check the documentation on how to install XWiki within Tomcat manually. Specifically, a section contains the instructions on how to make Tomcat find the proxy headers you’re sending with NginX (x-forwarded-for and x-forwarded-proto): [https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#Hhttps28secure29](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#Hhttps28secure29)

Once you bind-mount the correct Tomcat configuration everything works as expected. Even with your workaround I would recommend you configure Tomcat, because the edit button is not the only broken feature: the extension interface was not loading correctly in my case.

So that’s it, everything one needs is documented, but in unexpected places 🙂 . I’d be interested in contributing to improve the Docker documentation. Since it’s on Github is it okay if I simply send a merge request?

[Next page](https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609.md?page=2)
