Unable to edit newly created page (Failed to load the page)

I created a page and was able to edit and save it, but I have not been able to edit it since:

image

How do I troubleshoot that issue?

Hi, what error do you get in the xwiki logs? Do you get any error in the javascript console of your browser?

Hate to be a broken record, but I don’t know which logs to look in…I’ll start digging, but have had very little luck finding relevant log info.

As far as console, yep. Attaching as it’s too much for the post.DevToolsConsole.txt (151.4 KB)

I’m pretty sure I mentioned that a few times but it could have been to someone else! :slight_smile:

Anyway you just type “xwiki logging” in google and you’ll get to https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Logging which explains where you can find the logs.

In any case the js logs clearly show that some things are not good on your instance. I don’t have the time to look into more details right now. Maybe someone else can help you.

Actually, I “fixed” it. The issue was the page name:

Accessing User Desktop Without Password (Login / Session)

I renamed it to

Accessing User Desktop Without Password

Now it works just fine.

Oh, and I’ve read all that many times, but on Windows, the logging does not match up with that documentation.

Would be great to update it! How did you install XWiki on Windows?

This could mean that you haven’t configured Tomcat to support / and \ in page names: https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HAllowing222F22and225C22inpagenames

I would rather not do that. Is there not a way to make XWiki prohibit the page from being named using slashes?

Yes, it’s even the default since XWiki 12.0RC1 :wink:

See:

BTW may I ask why not?

Because that slashes were disabled because they are a security risk.

I don’t understand. What is not the default? Why does XWiki allow me to name the page with slashes if they will fail until Tomcat is modified?

Why do you think they are a security risk? It’s a general disable by tomcat, it’s not related to xwiki! I don’t know of a known risk in xwiki with directory traversal, thus asking what you have in mind! If there’s a problem we need to fix it :slight_smile:

Please read the doc :slight_smile: it’s all explained in details there. What version of xwiki? If you’re on XWiki 12.0RC1+ what do you see in the admin UI for this?

Hi, I’m running into this issue (Xwiki 12.4, Tomcat 9). I’ve recently imported some hundreds of wiki pages that were exported from a Confluence instance into a fresh Xwiki setup. Everything imported fine, however I can’t edit any of the pages that were imported with slashes in their names.

Looking at both the Tomcat logs and the client side, I’m seeing this for trying to edit a page titled “Dell / EMC”:

Tomcat:

127.0.0.1 - - [08/Jun/2020:11:03:30 -0400] "GET /bin/get/Home/CT/Dell%20%2F%20EMC?sheet=XWiki.InplaceEditing&action=lock&lockAction=edit&language=en&outputSyntax=plain&timestamp=1591628609976 HTTP/1.0" 302 -
127.0.0.1 - - [08/Jun/2020:11:03:30 -0400] "GET /bin/lock/Home/CT/Dell%20%2F%20EMC?ajax=1&action=edit&language=en HTTP/1.0" 204 -
127.0.0.1 - - [08/Jun/2020:11:03:30 -0400] "GET /rest/wikis/xwiki/spaces/Home/spaces/CT/pages/Dell%20/%20EMC?timestamp=1591628610178 HTTP/1.0" 404 221

Client side 404:
http://(the-wiki-server)/rest/wikis/xwiki/spaces/Home/spaces/CT/pages/Dell%20/%20EMC?timestamp=1591628660834

So it looks like the locking action escapes the “/” in the URL but the actual edit call doesn’t. And since I can’t load the editor, I can’t rename the page in Xwiki. The page loads to read, I just can’t edit it. Is this the expected behavior or is the REST call supposed to be escaping the “/” characters as well?

In my Tomcat server.xml I added the following in my Connector:

encodedSolidusHandling="passthrough"
relaxedPathChars=' [ \ ] ^ ` { | }'
relaxedQueryChars='\ { } |'

The wiki pages without slashes all load and edit fine.

Hi, this is a well-known issue with Tomcat.

See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HAllowing222F22and225C22inpagenames

PS: Next time please start a new topic, makes it easier for us to close topics. Thx!

Yes, I’ve also configured Tomcat to allow slashes. That still doesn’t explain the “Failed to load the page” error I’m also seeing. Should the client side javascript be escaping slashes (regardless of Tomcat’s config) in the page name on an attempted edit? If it was the Tomcat issue I would expect it to throw a 403, not a 404.

If you check https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HAllowing222F22and225C22inpagenames you’ll see it’s not just Tomcat but also any front end. Have you configured that too?

There’s no known issue with / and \ provided that any front end you’re using is configured to let them through and not encode them.

The Tomcat process via ‘ps’ on the Red Hat box:

/usr/bin/java -Djava.util.logging.config.file=/srv/xwiki/apache-tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true -Dignore.endorsed.dirs= -classpath /srv/xwiki/apache-tomcat/bin/bootstrap.jar:/srv/xwiki/apache-tomcat/bin/tomcat-juli.jar -Dcatalina.base=/srv/xwiki/apache-tomcat -Dcatalina.home=/srv/xwiki/apache-tomcat -Djava.io.tmpdir=/srv/xwiki/apache-tomcat/temp org.apache.catalina.startup.Bootstrap start

The noted ALLOW flags are certainly there (twice even, technically) for Tomcat/Catalina. If there is additional configuration needed then I’m not seeing it in your link.

As I said my comment was about any front end, not tomcat. See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HAllowing222F22and225C22inpagenames which has:

Note that if you’re using the Apache web server, you also need to [configure Apache to allow encoded / and ](https://httpd.apache.org/docs/current/mod/core.html#allowencodedslashes).

It’s true for Apache Web Server but also any other front end that may encode / or .