Empty Folders Contents when there is content in the folder

I have noticed on two Plone 5.1 sites that we experience a condition occasionally where the contents of a folder will show as empty, even if there is content present in those folders. This seems to happen if we have a url that has a repeating "word" at the beginning of its path.

For example https://somesite.com/plone/plone-five.

In the above example, if I remove the word plone from plone-five in the short name of the folder (plone-five in this case), the contents are displayed as expected.

I have tested this condition without front end webservers (nginx and apache).

Thoughts?

How to reproduce?

There is no reason that this should be the cause of the problem.

I would try to reproduce the problem in an interactive session (i.e. bin/instance debug or bin/client1 debug). There try f = app.unrestrictedTraverse("plone/plone-five") (the unrestrictedTraverse partially emulates the Web traversal) and look at the contents of f via f.objectIds(). Should f be empty, this would give an empty sequence. In this case, look at the path of f (--> f.getPhysicalPath()) to find out which f precisely was located.

If you mean

https://somesite.com/plone/plone-five/folder_contents

Usually if the folder_contents view is empty it is due to a javascript error.

Sounds really strange if this is the case, but maybe you can check if you get javascript errors on that url.

Thanks for the suggestions for those that replied. I will look deeper into this and report back. The odd thing is, some folders work fine. Its simply the ones that are named with duplicates of the URL path that break.

Some further testing. Javascript was not the issue as no errors where generated. I disabled our theme and reverted to Plone 5 stock theme to confirm. The issue still remains.

Interesting, I stumbled across something that seems to be the root cause, but not sure how else to fix/test. This particular server contains 12 other Plone sites. We used specific naming convention when naming our sites, using underscores. The sites that have the folder contents issue are ones that do not contain the underscore naming convention.

Here is an example:

siteone_somedomain_com is the name of the site in the ZMI. We can access this site by going to the server directly at http://someserver.com:8081/siteone_somedomain_com. If we create a directory named siteone-about... it works as expected.

Now, a situation that is not working.

siteone is the name of the site in the ZMI, accessed at http://someserver.com:8081/siteone. If we create that same folder... siteone-about. The folder contents are empty.

Definitely a bug; I wandered in here after a Google search for plone folder_contents empty. The site is behind a VHM and if I navigated to https://mcl.REDACED.gov/mcl-sc-meetings/folder_contents it would indeed appear empty.

As soon as we renamed the folder from mcl-sc-meetings to just sc-meetings then the contents view worked fine.

This was on an older Plone 5.0.8 site; I do not have access to its logs, database, etc.