Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-91593

System Settings are not properly stored and cannot be properly retrieved from the database when comments are included in a configuration file (Continued)

    Details

    • Fix Priority:
      3

      Description

      This is a continuation of LPS-86754, the original fix did not actually resolve the issue.

      Description

      When a configuration file is used to provide a System Setting and the file contains a comment, the configuration is improperly stored in the database.

      This may lead to inconsistent behavior, such as:

      • Orphaned configuration entries in the database
      • Inability to read the configuration entry that is stored in the database

      Steps to Reproduce

      1. Startup Liferay
      2. Navigate to Control Panel -> System Settings -> Blogs
      3. Verify that entry: Entry Check Interval = 1
      4. Create an OSGI Config file: [LIFERAY_HOME]/osgi/configs/com.liferay.blogs.configuration.BlogsConfiguration.config
        entryCheckInterval="5"
        
      5. Wait at least 10 seconds for Liferay to update the configuration using our Config file
      6. Go back to the browser
      7. Verify that entry: Entry Check Interval = 5
      8. Modify our created OSGI Config file
        #foobar
        entryCheckInterval="5"
        
      9. Wait at least 10 seconds for Liferay to update the configuration using our Config file
      10. Go back to the browser
      11. Verify entry for: Entry Check Interval

      Expected Results
      Entry Check Interval = 5

      Actual Results
      Entry Check Interval = 1

      Additional Check:

      1. Check the database table: Configuration_
      2. Lookup the value for the configurationId: com.liferay.blogs.configuration.BlogsConfiguration
      3. The dictionary includes an unexpected entry:
        #foobar\nentryCheckInterval="5"
        

      The scenario above, helps demonstrate the issue in master, 72x, 71x, and 70x.
      The above scenario demonstrates a minor effect of adding a comment.

      A more dramatic effect would be to test using a commented multi-value entry.
      Currently, this is most noticeable when testing using the master branch.

      Steps to Reproduce

      1. Create an OSGI Config file: [LIFERAY_HOME]/osgi/configs/com.liferay.blogs.configuration.BlogsConfiguration.config
        #foobar=["foo","bar"]
        
      2. Startup Liferay and wait for startup to complete
      3. Restart Liferay
      4. Examine Logs

      Expected Results
      No errors are shown in the logs

      Actual Results
      Errors are shown in the logs regarding the configuration

      Additional Notes

      • Modifying/removing the added config file does not resolve the issue.
      • Modifying the Blog Configuration within System Settings in Control Panel also does not resolve the issue.

      Sample: NullPointerException Message

      2019-03-08 02:11:29.877 ERROR [fileinstall-/Users/liferay/Liferay/development/deploy/liferay/master/osgi/configs][org_apache_felix_fileinstall:97] Failed to install artifact: /Users/liferay/Liferay/development/deploy/liferay/master/osgi/configs/com.liferay.blogs.configuration.BlogsConfiguration.config
      java.lang.NullPointerException
      	at org.apache.felix.cm.impl.helper.TargetedPID.<init>(TargetedPID.java:61)
      	at org.apache.felix.cm.impl.ConfigurationImpl.<init>(ConfigurationImpl.java:183)
      	at org.apache.felix.cm.impl.ConfigurationManager.getConfiguration(ConfigurationManager.java:452)
      	at org.apache.felix.cm.impl.ConfigurationAdminImpl.getConfiguration(ConfigurationAdminImpl.java:164)
      	at org.apache.felix.fileinstall.internal.ConfigInstaller.getConfiguration(ConfigInstaller.java:346)
      	at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:252)
      	at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:78)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:937)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:871)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:485)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                support-lep@liferay.com SE Support
                Reporter:
                eric.yan Eric Yan
                Participants of an Issue:
                Recent user:
                Eric Yan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Days since last comment:
                  28 weeks ago

                  Packages

                  Version Package