Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[management] Portal notification of new user is missing user.username #2132

Closed
n2ygk opened this issue Apr 9, 2019 · 2 comments

Comments

2 participants
@n2ygk
Copy link

commented Apr 9, 2019

Expected Behavior

I expected notification of new user creation.

Current Behavior

No notification is received and this error is logged:

Apr 09, 2019 2:44:50 PM freemarker.log._JULLoggerFactory$JULLogger error
SEVERE: Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> user.username  [in template "notifications/portal/PORTAL.USER_FIRST_LOGIN.yml" at line 3, column 6]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${user.username}  [in template "notifications/portal/PORTAL.USER_FIRST_LOGIN.yml" at line 3, column 4]
----
Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
	at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:467)
	at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:389)
	at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:358)
	at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:100)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:63)
	at freemarker.core.Environment.visit(Environment.java:330)
	at freemarker.core.Environment.visit(Environment.java:336)
	at freemarker.core.Environment.process(Environment.java:309)
	at freemarker.template.Template.process(Template.java:384)
	at org.springframework.ui.freemarker.FreeMarkerTemplateUtils.processTemplateIntoString(FreeMarkerTemplateUtils.java:50)
	at io.gravitee.management.service.impl.PortalNotificationServiceImpl.create(PortalNotificationServiceImpl.java:76)

Possible Solution

Steps to Reproduce (for bugs)

  1. Configure /#!/management/settings/notifications for new user registered, created, first login.
  2. Perform first-time login via OIDC IdP as a new user.
  3. Notice that no notification is delivered.
  4. Notice error logged in apim_managementapi

Context

A minor problem but I would like to be notified when new users show up.

Your Environment

  • Version used: 1.24.0
  • Browser Name and version:
  • Operating System and version:

@brasseld brasseld changed the title portal notification of new user is missing user.username [management] Portal notification of new user is missing user.username Apr 9, 2019

@n2ygk

This comment has been minimized.

Copy link
Author

commented Apr 9, 2019

Tested and works. PR coming. Thanks!

n2ygk added a commit to n2ygk/gravitee-management-rest-api that referenced this issue Apr 9, 2019

Fix "Portal notification of new user is missing user.username"
fixes gravitee-io/issues#2132
- replace user.username with user.displayName

brasseld added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Apr 11, 2019

Fix "Portal notification of new user is missing user.username"
fixes gravitee-io/issues#2132
- replace user.username with user.displayName

@brasseld brasseld added this to the APIM - 1.25.0 milestone Apr 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.