Error "log4j:ERROR [2:0480KB] not in expected format" during cell startup in VMware Cloud Director
book
Article ID: 378372
calendar_today
Updated On:
Products
VMware Cloud Director
Issue/Introduction
The /opt/vmware/vcloud-director/logs/cell.log on the Cloud director cell show errors of the form:
Bootstrap application: start log4j:ERROR [2:0480] is not in proper int form. log4j:ERROR [2:0480KB] not in expected format. java.lang.NumberFormatException: For input string: "2:0480" at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.base/java.lang.Long.parseLong(Long.java:692)
log4j:ERROR [2:0480] is not in proper int form. log4j:ERROR [2:0480KB] not in expected format. java.lang.NumberFormatException: For input string: "2:0480" at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.base/java.lang.Long.parseLong(Long.java:692) at java.base/java.lang.Long.valueOf(Long.java:1144)
The/opt/vmware/vcloud-director/etc/log4j.properties file on the Cloud Director cell has an incorrectly formatted value for 'MaxFileSize' - '2:0480KB'
# Component appender for container debug log4j.appender.vcloud.system.debug=org.apache.log4j.RollingFileAppender log4j.appender.vcloud.system.debug.File=logs/vcloud-container-debug.log log4j.appender.vcloud.system.debug.MaxFileSize=2:0480KB log4j.appender.vcloud.system.debug.MaxBackupIndex=20
Environment
VMware Cloud Director
Cause
The issue is caused by incorrectly formatted values in the '/opt/vmware/vcloud-director/etc/log4j.properties' file.
Resolution
To resolve this issue, please follow these steps:
Before making any changes, create a copy of /opt/vmware/vcloud-director/etc/log4j.properties for safekeeping.
Open the log4j.properties file and look for any configuration properties with a value that matches the one reported in the error message (e.g., 2:0480KB).
Change the incorrect value (e.g., 2:0480KB) to the proper format. In this case, the correct format is 20480KB (removing the colon).
Once the value is corrected, restart the VCD service with the following command: service vmware-vcd restart