[MAGNOLIA-3285] URI Mapping cause the whole system to fail Created: 31/Aug/10  Updated: 13/Dec/11  Resolved: 10/Sep/10

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 4.3.6
Fix Version/s: 4.3.7, 4.5

Type: Bug Priority: Critical
Reporter: Mingfai Assignee: Ondrej Chytil
Resolution: Fixed Votes: 0
Labels: urimapping
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File MAGNOLIA-3285.patch    
Issue Links:
supersession
is superseded by MAGNOLIA-3515 Better virtualUriMapping registration... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

At the VirtualURIMapping node, I incorrectly addedd a New Node Data instead of New Content Node. Then I immediately try to remove the Data node but then the whole server is screwed up and any URL results as error 500. The error is as follows:
java.lang.String cannot be cast to info.magnolia.cms.beans.config.VirtualURIMapping

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to info.magnolia.cms.beans.config.VirtualURIMapping
at info.magnolia.cms.beans.config.VirtualURIManager.getURIMapping(VirtualURIManager.java:83)
at info.magnolia.cms.filters.VirtualUriFilter.getURIMapping(VirtualUriFilter.java:141)

i tried to repeat the same process in a fresh downloaded Magnolia instance and I could easily repeat it. And OMG there is no way for me to fix as I can't access the admin central anymore.

It is obviously a critical bug to me because a user mistake could f up the whole system unnecessarily. I don't blame the lack of validation in the UI as you guys are working hard to improve the admin ui, but it also show a lack of exception handling. When processing multiple URI mapping rules, if one of the rules fail, it shouldn't cause the whole system to fail. (if it is a security/access control rule, i would accept a single exception in processing the rules to cause a deny access)

p.s. I tried to post to the user-list to look for a way to fix the problem but the mail-list system seems to be broken and there is no reply after i have replied the verification email. Is there ant wat to fix the problem, i.e. is there any way to remove the last "untitled" uri mapping entry without accessing Magnolia (coz all url including JCR browser can't be accessed.)



 Comments   
Comment by Zdenek Skodik [ 31/Aug/10 ]

Hi Mingfai,

to fix your issue, have a look at How to repair broken configuration wiki page, follow the instructions there and with use of restoreMappings.jsp you can remove the untitled property from that path.

Best regards.

Comment by Mingfai [ 31/Aug/10 ]

ok. i patched the VirtualURIManager so I can access the site now. And I went to the node and have deleted the entry that caused the problem.

Comment by Federico Grilli [ 31/Aug/10 ]

An alternative way to repair it would be using the Groovy Rescue servlet http://wiki.magnolia-cms.com/display/WIKI/Groovy+Rescue+Servlet from our Groovy module http://svn.magnolia-cms.com/view/community/modules/magnolia-module-groovy/.

Comment by Jan Haderka [ 31/Aug/10 ]

Thanks for the patch.

Comment by Mingfai [ 31/Aug/10 ]

thanks for the troubleshooting info. The interactive Groovy console is one of the best thing in Magnolia (I have been using Groovy since 2008 ). However, I didn't have the Groovy module at the time the problem occur, and the Groovy module needs to be installed before using it for the first time. The following error occurred when I try to access the groovyInteractiveConsole page before running the installer.
java.lang.IllegalArgumentException: Failed to retrieve repository 'templates' (mapped as 'templates'). Your Magnolia instance might not have been initialized properly. at info.magnolia.cms.beans.config.ContentRepository.getRepository(ContentRepository.java:508)

I tried to post a comment to the Groovy+Rescue+Servlet page but I can't login with my JIRA user account. so far, i found two of your supporting systems are malfunction. (the mail list subscription and confluence login)

Comment by Mingfai [ 31/Aug/10 ]

this jira doesn't have any section to report issue about your supporting services so I am not going to abuse it.

In the http://wiki.magnolia-cms.com/administrators.action page, the admin's email addresses are hidden so i can't contact them to report the issue. Jan, would you mind to pass my message to any system admin that:
1) after i have replied the verification email, it never replies and allow me to join the mail list
2) i can't use my JIRA account to login confluence (according to the start here page, confluence uses the JIRA account. http://wiki.magnolia-cms.com/display/WIKI/Start+here)

thank you very much.

Comment by Ondrej Chytil [ 10/Sep/10 ]

Thanks for patch.

Generated at Mon Feb 12 03:45:00 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.