[MGNLCT-358] Root node is not created for content types defined on classpath Created: 18/Jan/23  Updated: 10/Feb/23  Resolved: 09/Feb/23

Status: Closed
Project: Content Types
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Bug Priority: Neutral
Reporter: Jaroslav Simak Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 3h Time Spent: 3h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File asset-error-log.png     PNG File qa-steps-1.png     PNG File qa-steps.png     Text File t5snmsdmturgjmfh.log     PNG File upload-asset.png    
Issue Links:
dependency
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLCT-359 Implementation Sub-task Completed Robert Šiška  
MGNLCT-360 Review Sub-task Closed Robert Šiška  
MGNLCT-361 piQA Sub-task Completed Javier Benito  
MGNLCT-362 QA Sub-task Completed Oanh Thai Hoang  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* 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:
Epic Link: SaaS TPR - DevX Bugs
Sprint: DevX 29, DevX 30
Story Points: 1
Team: DeveloperX
Work Started:

 Description   

Steps to reproduce

  1. Create new subscription
  2. Log into norsu pgadmin (step to log into pgadmin https://git.magnolia-cms.com/projects/CLOUD/repos/infra/browse/multi-tenant/README.md)
  3. Check nodes created: 
    SELECT		n.*	FROM		norsu.environments env		inner join norsu.nodes n on env.id = n.env_id	WHERE		env.space_id = 'sub_id'	; 
  1. Check susbcription logs: no errors at pages content type load

Expected results

The website node is created.

Actual results

The website not is not created.

Workaround

Push content type definition to git.

Development notes



 Comments   
Comment by Jaroslav Simak [ 18/Jan/23 ]

Discovery

NorsuContentTypeInitializer is not run unless a content type definition is registered via git push.

Because intializer does not run on module startup, the already existing definitions coming from classpath are not processed.

Proposed solution

Run NorsuContentTypeInitializer on module startup, after registry is bound to configuration source.

Comment by Jaroslav Simak [ 20/Jan/23 ]

The proposed solution in the discovery does not work due to the fact that no environment is configured.

 

Comment by Oanh Thai Hoang [ 01/Feb/23 ]

No config any git env will cause trouble for norsu-asset as well. Event norsu asset won't use content type for provisioning root path. 

 

Step to reproduce: 

  1. Create new subscription
  2. Go to Norsu asset app
  3. Click to upload asset
  4. See error right away. 

 

Here is log: t5snmsdmturgjmfh.log

 

Caused by: java.lang.RuntimeException: No default environment found for subscription
	at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider.lambda$getDefaultConfigurationEnvironment$0(CurrentEnvironmentContextProvider.java:116) ~[magnolia-norsu-1.0.0-SNAPSHOT.jar:?]
	at java.util.Optional.orElseThrow(Optional.java:408) ~[?:?]
	at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider.getDefaultConfigurationEnvironment(CurrentEnvironmentContextProvider.java:116) ~[magnolia-norsu-1.0.0-SNAPSHOT.jar:?]
	at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider.isDefaultConfigurationEnvironment(CurrentEnvironmentContextProvider.java:109) ~[magnolia-norsu-1.0.0-SNAPSHOT.jar:?]
	at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider.inferContentEnvironmentFromConfigurationEnvironment(CurrentEnvironmentContextProvider.java:102) ~[magnolia-norsu-1.0.0-SNAPSHOT.jar:?]
	at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider.get(CurrentEnvironmentContextProvider.java:89) ~[magnolia-norsu-1.0.0-SNAPSHOT.jar:?]
	at info.magnolia.norsu.NodeApiProvider.get(NodeApiProvider.java:59) ~[magnolia-norsu-1.0.0-SNAPSHOT.jar:?]
	at info.magnolia.norsu.NodeApiProvider.get(NodeApiProvider.java:46) ~[magnolia-norsu-1.0.0-SNAPSHOT.jar:?]
	at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86) ~[guice-5.1.0.jar:?]
	at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72) ~[guice-5.1.0.jar:?]
	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:60) ~[guice-5.1.0.jar:?]
	at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:59) ~[guice-5.1.0.jar:?]
	at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1101) ~[guice-5.1.0.jar:?]
	... 121 more 
Comment by Oanh Thai Hoang [ 09/Feb/23 ]

QA has been done.
After sign up a new sub without config any git.
Login to pg-admin and can see /website provisioning there

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