Server Admin Settings - Logging page throws NPE for datasource appender

Description

In server admin - logging edit page, while updating the datasource appender without the datasource throws a NullPointerException.

 

lucee.runtime.exp.NativeException: java.lang.NullPointerException at lucee.runtime.db.DataSourceUtil.isMSSQL(DataSourceUtil.java:76) at lucee.commons.io.log.log4j2.appender.DatasourceAppender.createSQL(DatasourceAppender.java:178) at lucee.commons.io.log.log4j2.appender.DatasourceAppender.touchTable(DatasourceAppender.java:162) at lucee.commons.io.log.log4j2.appender.DatasourceAppender.<init>(DatasourceAppender.java:52) at lucee.commons.io.log.log4j2.Log4j2Engine.getDatasourceAppender(Log4j2Engine.java:501) at lucee.commons.io.log.log4j2.Log4j2Engine.getAppender(Log4j2Engine.java:334) at lucee.commons.io.log.LoggerAndSourceData.getLog(LoggerAndSourceData.java:131) at lucee.commons.io.log.LoggerAndSourceData.getAppenderArgs(LoggerAndSourceData.java:102) at lucee.runtime.tag.Admin._doGetLogSettings(Admin.java:3201) at lucee.runtime.tag.Admin.doGetLogSettings(Admin.java:3178) at lucee.runtime.tag.Admin._doStartTag(Admin.java:654) at lucee.runtime.tag.Admin.doStartTag(Admin.java:355) at server_logging_cfm322$cf.call(/admin/server.logging.cfm:13) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1043) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:935) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:916) at web_cfm$cf.call(/admin/web.cfm:492) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1043) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:935) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:916) at server_cfm$cf.call(/admin/server.cfm:2) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1043) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:935) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:219)

Environment

None

Attachments

1

Activity

Pothys - MitrahSoft 
29 March 2022 at 07:43

I've checked this ticket with lucee latest build 5.3.9.120-SNAPSHOT. Now updating the logging appender works fine. Also, there is no NPE on the admin logging page for renaming or removing the logging appender datasource/path.

Michael Offner 
28 March 2022 at 15:07
(edited)

i have make sire we get a better exception and it still works, even the datasource no longer exist. please give it another try

Michael Offner 
25 March 2022 at 17:29

please give the new build a try

Pothys - MitrahSoft 
25 March 2022 at 15:04

The PR for prevent to updating the empty datasource /not existing path to logging appender.
But While doing getLogSettings, if the grandparent directory not existing or dataSource (which is used for logging) doesn't exist means it will throw NPE.

Pull Request: https://github.com/lucee/Lucee/pull/1607

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 23 March 2022 at 07:27
Updated 29 March 2022 at 07:43
Resolved 29 March 2022 at 07:43