[BLOSSOM-249] Definitions app not opening up after migrating to 5.6.3 Created: 13/Mar/18  Updated: 11/Dec/18  Resolved: 27/Mar/18

Status: Closed
Project: Blossom
Component/s: None
Affects Version/s: None
Fix Version/s: 3.2.1

Type: Bug Priority: Critical
Reporter: Viet Nguyen Assignee: Saimir Gasa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

invesco.com


Attachments: PNG File Screen Shot 2018-03-21 at 15.49.44.png     Text File magnolia-definitions-app-563-log.txt    
Issue Links:
Relates
relates to CFGUI-78 Internal error in Definitions app Closed
causality
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:
Sprint: Basel 139
Story Points: 3

 Description   

In SUPPORT-8497, there are few cases that 'upgraded to 5.6.3 from 5.6, "Definitions" app is not opening up and throwing an error in the back end, attached is the debug log for this action.'
The NPE caused by
{{ DefinitionMetadata metadata.getConfigurationSourceType().name() }}
Could be after migration, we lack of definition source type somewhere or customer has a custom implementation which didn't set any value to that field.
Error in
https://git.magnolia-cms.com/projects/MODULES/repos/definitions-app/browse/src/main/java/info/magnolia/definitions/app/problems/list/ProblemReportListPresenter.java#113
Fix by null checking such as

if (itemId instanceof DefinitionProviderId) {
                    final DefinitionProviderId definitionProviderId = (DefinitionProviderId) itemId;
                    final DefinitionMetadata metadata = definitionProviderId.getValue().getMetadata();
                    String type = metadata.getType() == null ? "unknown" : metadata.getType().getName();
                    String sourceType = metadata.getConfigurationSourceType() == null ? "unknown" : metadata.getConfigurationSourceType().name();
                    final Table.GeneratedRow generatedRow =
                            new Table.GeneratedRow(
                                    String.format(definitionProviderInfoTemplate,
                                            definitionProviderId.getStyle(),
                                            type,
                                            metadata.getReferenceId(),
                                            sourceType,
                                            metadata.getLocation()));
                    generatedRow.setSpanColumns(true);
                    generatedRow.setHtmlContentAllowed(true);

                    return generatedRow;
                }

-----------------------
Proposed solution:

  • add a new 'unknown' source type to your enum and use it in case of missing source type.
  • this issue is not a common issue and should not happen in a new, ideal environment, however we still able to support customers for custom code that lack of setting this info.


 Comments   
Comment by Saimir Gasa [ 23/Mar/18 ]

Test Steps:

  • checkout magnolia-blossom-samples project
  • update the magnoliaVersion in the master pom.xml to 5.6.2
  • update the blossomVersion to 3.2.1-SNAPSHOT
  • login into magnolia
  • Definitions app should open with no errors
Generated at Sun Feb 11 23:31:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.