OS Core Common - Spring 5 issueshttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues2024-01-23T05:26:54Zhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/76Unset variables causing NullExceptionPointer in os-core-common AppPropertiesF...2024-01-23T05:26:54ZDeepa KumariUnset variables causing NullExceptionPointer in os-core-common AppPropertiesFeatureFlagImplThere is a scenario when an unset variable is causing the application to fail unexpectedly:
Caused by: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "org.springframework.core.env.Envir...There is a scenario when an unset variable is causing the application to fail unexpectedly:
Caused by: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "org.springframework.core.env.Environment.getProperty(String)" is null
at org.opengroup.osdu.core.common.feature.AppPropertiesFeatureFlagImpl.isFeatureEnabled(AppPropertiesFeatureFlagImpl.java:18)
at org.opengroup.osdu.storage.service.IngestionServiceImpl.createUpdateRecords(IngestionServiceImpl.java:119)
at org.opengroup.osdu.storage.api.RecordApi.createOrUpdateRecords(RecordApi.java:102)
The code here will need to be changed: https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/blob/master/src/main/java/org/opengroup/osdu/core/common/feature/AppPropertiesFeatureFlagImpl.java#L18
Its even highlighted by sonar lint.M23 - Release 0.26Deepa KumariDeepa Kumarihttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/72Error getting data from Redis on lost connection2023-09-18T07:26:13ZYurii Ruban [EPAM / GCP]Error getting data from Redis on lost connectionIn case of loss of connection between the service and Redis, the processing of requests to the service is delayed and an error of type
`Command timed out after 30 SECONDS` is received.
Redis (cache service) is a productivity tool. In c...In case of loss of connection between the service and Redis, the processing of requests to the service is delayed and an error of type
`Command timed out after 30 SECONDS` is received.
Redis (cache service) is a productivity tool. In case of a lost connection, delays in processing requests increase, and, in general, the service becomes unviable.
`entitlements-v2.app: An unknown error has occurred
AppException(error=AppError(code=500, reason=Internal Server Error, message=An unknown error has occurred, errors=null, debuggingInfo=null, originalException=com.lambdaworks.redis.RedisCommandTimeoutException: Command timed out after 30 SECONDS), originalException=com.lambdaworks.redis.RedisCommandTimeoutException: Command timed out after 30 SECONDS)
...
Caused by: com.lambdaworks.redis.RedisCommandTimeoutException: Command timed out after 30 SECONDS
`
I recommend adding Redis health checks.M20 - Release 0.23Yurii Ruban [EPAM / GCP]Yurii Ruban [EPAM / GCP]https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/70Invalid data-partition-id will create 500 code with no Authorize message.2023-10-10T12:16:06ZBruce JinInvalid data-partition-id will create 500 code with no Authorize message.While making calls to OSDU services, such as `secret` and `storage` service, testers discover that if they put invalid symbols in `data_partition_id`, we will have 500 code, but with reason of Access Denied.
After investigation, we reali...While making calls to OSDU services, such as `secret` and `storage` service, testers discover that if they put invalid symbols in `data_partition_id`, we will have 500 code, but with reason of Access Denied.
After investigation, we realize the partition service did not consider the situation that user put invalid URI symbols like `@#$%` in data partition
id, which will make the `normalizeStringUrl` function have Java.Lang exception in this [UrlNormalizationUtil.java](https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/blob/master/src/main/java/org/opengroup/osdu/core/common/util/UrlNormalizationUtil.java).
```
Caused by: java.lang.IllegalArgumentException: Malformed escape pair at index 57: http://os-partition:8080/api/partition/v1/partitions/osdu%
at java.net.URI.create(URI.java:852)
at org.opengroup.osdu.core.common.util.UrlNormalizationUtil.normalizeStringUrl(UrlNormalizationUtil.java:27)
```
This will generate a 500 code in entitlement service since the service will treat this error as a general error in [SpringExceptionMapper.java](handleGeneralException), instead a 400 code.
Also in Entitlements the error message is processed within [AuthorizationServiceImpl.java](https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/blob/master/src/main/java/org/opengroup/osdu/core/common/entitlements/AuthorizationServiceImpl.java), so it will have `"Access denied", "The user is not authorized to perform this action"` error message.
Here is a MR that will handle the 500 code produced from `java.lang.IllegalArgumentException` https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/219Bruce JinBruce Jinhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/68Core-common post migration TODOs (Powermock, module access)2023-06-28T14:57:27ZRustam Lotsmanenko (EPAM)rustam_lotsmanenko@epam.comCore-common post migration TODOs (Powermock, module access)- Unit test refactoring is required, to remove --add-opens params from build run args.
~~~
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED</argLine>
~~~
Tests failed without args:
~~~
Fail...- Unit test refactoring is required, to remove --add-opens params from build run args.
~~~
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED</argLine>
~~~
Tests failed without args:
~~~
Failed tests:
shouldThrowExceptionWhenPropertyNotPresentInEnv(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
shouldThrowExceptionWhenPropertyInMapNull(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
shouldThrowExceptionWhenPropertyValueInMapNull(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
shouldThrowExceptionWhenPropertyNotInMap(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
Tests in error:
shouldNotThrowExceptionWhenPropertyValueInMapIsEmpty(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
shouldNotThrowExceptionWhenEnvReturnEmptyVal(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
shouldGetTypedProperties(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
getPropertyValueFromEnv(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
shouldThrowExceptionWhenEnvReturnNull(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
getPropertyValueFromMapValue(org.opengroup.osdu.core.common.partition.PartitionPropertyResolverTest)
~~~
- Powermock dependency removal is highly recommended, Powermock not getting updates to work with Java 17, and has conflicts with Mockito:
~~~
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
~~~https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/67inefficient/non-performant crs-conversions causing reliability/performance is...2023-06-21T07:54:16ZYurii Kondakovinefficient/non-performant crs-conversions causing reliability/performance issues on ingestion workflowWe are seeing reliability and performance issue because of inefficient/non-performant crs-conversions on ingestion workflow. If crs conversions takes long time (on Storage /batch API), then it slows down entire ingestion workflow.
There...We are seeing reliability and performance issue because of inefficient/non-performant crs-conversions on ingestion workflow. If crs conversions takes long time (on Storage /batch API), then it slows down entire ingestion workflow.
There is a need for setting a timeout for crs-conversion requests that run for more than a certain time. For the requests to crs-conversion-service currently java.net.HttpURLConnection class is used, which is only has connectionTimeout and readTimeout properties, that don't help us to set the timeout.
It is suggested to use apache CloseableHttpClient httpClient that has socketTimeout property.
core-common MR - https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/213
storage MR - https://community.opengroup.org/osdu/platform/system/storage/-/merge_requests/712M19 - Release 0.22Yurii KondakovYurii Kondakovhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/66Code duplicity and misleading parameter usage in Redis Cache constructor2023-06-05T09:41:27Zharshit aggarwalCode duplicity and misleading parameter usage in Redis Cache constructorCurrently there is a lot of code duplicity in some of the RedisCache constructors which can be avoided be easily avoided by implemented a common base constructor
Also one issue is that the parameter `expTimeSeconds` which is supposed to...Currently there is a lot of code duplicity in some of the RedisCache constructors which can be avoided be easily avoided by implemented a common base constructor
Also one issue is that the parameter `expTimeSeconds` which is supposed to be the TTLs for the keys in Redis cache is also used for command execution timeout value as well which is very misleading because both values can drastically differ in values becasue TTLs can be very long duration as compared to command execution timeouts
Code reference - https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/blob/master/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java#L48
The above should be cleanup or modified to take appropriate params with some default valuesM18 - Release 0.21https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/65Wrong encoding of special characters in URL query component2023-05-30T08:55:20ZKelly ZhouWrong encoding of special characters in URL query componentWhile consuming HttpClient from os core common library, we found that some special characters in URL query component are not properly encoded, 1 example of that is `+` (the plus symbol).
According to [RFC 2396](https://www.rfc-editor.o...While consuming HttpClient from os core common library, we found that some special characters in URL query component are not properly encoded, 1 example of that is `+` (the plus symbol).
According to [RFC 2396](https://www.rfc-editor.org/rfc/rfc2396#appendix-A), it is a reserved character in query component so it is not encoded when forming the url, however, if we encode it explicitly before constructing the URL by using library, the escape character `%` would be treated as a non-reserved character in query component which leads to double-encoding issue for `+` symbol.
As a result, if we send `+` as plain text, library forms the url as it is, if we encode `+` to `%2B` before sending it to library, it comes out as `%252B`, neither of them represents the original url when it arrives at server side.M17 - Release 0.20https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/64Spring configuration related to Feature flag should be optional2023-01-30T11:37:15ZRustam Lotsmanenko (EPAM)rustam_lotsmanenko@epam.comSpring configuration related to Feature flag should be optionalIt is possible that some OSDU services may not use Partition service, Unit service as an example. But the configuration of the recently merged code https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requ...It is possible that some OSDU services may not use Partition service, Unit service as an example. But the configuration of the recently merged code https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/189 requires PARTITION_API env variable mandatorily. It will be better to change the configuration to make it optional, instead of bringing this variable to each service, no matter if Partition is used or not.
~~~
Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'featureFlagConfig':
Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException:
Could not resolve placeholder 'PARTITION_API' in value "${PARTITION_API}"
~~~Rustam Lotsmanenko (EPAM)rustam_lotsmanenko@epam.comRiabokon Stanislav(EPAM)[GCP]Rustam Lotsmanenko (EPAM)rustam_lotsmanenko@epam.comhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/62Add validator to RecordAncestry in Storage Service2023-05-30T08:57:28ZKelly ZhouAdd validator to RecordAncestry in Storage Servicewhen ingesting records, Storage needs to check if parent records specified in RecordAncestry exist or not, without Validator for parent record, exceptions would be thrown out if users provide invalid parent record id.
We need to add val...when ingesting records, Storage needs to check if parent records specified in RecordAncestry exist or not, without Validator for parent record, exceptions would be thrown out if users provide invalid parent record id.
We need to add validator for RecordAncestry and add proper test to verify it.M15 - Release 0.18https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/60Changing info logs into debug logs2022-12-01T15:14:39ZNeha KhandelwalChanging info logs into debug logsIn the OSDU Storage service, we are incurring large costs due to info logs created every time a request is sent to the Entitlements service. These logs are being created in the class HttpClientHandler.java (line 110) and are of the forma...In the OSDU Storage service, we are incurring large costs due to info logs created every time a request is sent to the Entitlements service. These logs are being created in the class HttpClientHandler.java (line 110) and are of the format "method: %s | latency: %s | url: %s | correlation id: %s". Such logs can be turned into debug logs to save on costs. There are two reasons why this change is viable: the Entitlements service creates request logs whenever a request is received, and info logs will still be created in Storage if any error occurs with the request. If needed, the logs can be switched back to info logs in the future.Neha KhandelwalNeha Khandelwalhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/59Unable to use custom codec with RedisCache2022-10-04T10:12:45ZAalekh JainUnable to use custom codec with RedisCacheCurrently, the codec that is used for the `RedisCache` is hard coded to `CompressionCodec`. However, there are use cases where one might want to use custom codecs (primarily used for desired serialization and de-serialization of the redi...Currently, the codec that is used for the `RedisCache` is hard coded to `CompressionCodec`. However, there are use cases where one might want to use custom codecs (primarily used for desired serialization and de-serialization of the redis keys or values). Hence, a separate method which can be overridden needs to be introduced using which one can use the cusom codecs for `RedisCache` if the need be.
One such use case can be found here in ingestion workflow: https://community.opengroup.org/osdu/platform/data-flow/ingestion/ingestion-workflow/-/blob/441b6489dc954bee1df890b45d434651c219810a/provider/workflow-azure/src/main/java/org/opengroup/osdu/workflow/provider/azure/cache/ActiveDagRunsRedisCache.java#L30 (The method here uses `JSONCodec` instead of `CompressionCodec`)
This is the corresponding MR for the above use case which also contains the detailed description of why this change is required: https://community.opengroup.org/osdu/platform/data-flow/ingestion/ingestion-workflow/-/merge_requests/237
Described below is the scenario where using `CompressionCodec` will result into erroneous scenario and one might want to use another codec such as `JSONCodec`
0. Assuming the datatype of key in RedisCache is `String` and the datatype of value in RedisCache is `Integer`
1. Using atomic increment operation of redis cache will increment the value corresponding to the given key. Since redis cache internally does not have any data type, it will just increment the value assuming the value to be plain bytes (which it is not since we're using the compression codec)
2. Using the get operation on the same key will result in EOFException as the decoding happens on the incremented value from the above step which assumed integer type/representation in the earlier step (which is the not the case since CompressionCodec will change the values from plain bytes to compressed bytes).
Using `JSONCodec `can resolve this issue. This is how it's done here: https://community.opengroup.org/osdu/platform/data-flow/ingestion/ingestion-workflow/-/blob/441b6489dc954bee1df890b45d434651c219810a/provider/workflow-azure/src/main/java/org/opengroup/osdu/workflow/provider/azure/cache/ActiveDagRunsRedisCache.java#L30
The changes are targetted in this MR: !148https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/53Apache log4j CVE-2021-442282021-12-15T06:36:39ZDmitrii GerashchenkoApache log4j CVE-2021-44228https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
Zero-day vulnerability affects log4j and can lead to remote code execution. This is a critical issue and needs to be resolved as soon as possible.
---
Apache Log4j2 <=2.14...https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
Zero-day vulnerability affects log4j and can lead to remote code execution. This is a critical issue and needs to be resolved as soon as possible.
---
Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.15.0, this behavior has been disabled by default. In previous releases (>2.10) this behavior can be mitigated by setting system property "log4j2.formatMsgNoLookups" to “true” or it can be mitigated in prior releases (<2.10) by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-\*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class).https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/52Security vulnerabilities (WhiteSource alerts)2021-12-15T06:34:28ZDmitrii GerashchenkoSecurity vulnerabilities (WhiteSource alerts)WhiteSource's Security vulnerabilities list contains alerts:
* spring-web-5.3.6.jar
* netty-codec-4.1.63.Final.jar
* netty-codec-4.1.63.Final.jar
* spring-security-oauth2-client-5.4.6.jar
* netty-all-4.1.63.Final.jar
* netty-handler-4.1....WhiteSource's Security vulnerabilities list contains alerts:
* spring-web-5.3.6.jar
* netty-codec-4.1.63.Final.jar
* netty-codec-4.1.63.Final.jar
* spring-security-oauth2-client-5.4.6.jar
* netty-all-4.1.63.Final.jar
* netty-handler-4.1.63.Final.jar
* gson-2.8.5.jar
* json-smart-2.4.2.jar
---
- https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-22118
- https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-37136
- https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-37137
- https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-22119
- https://github.com/netty/netty/issues/10362
- https://github.com/google/gson/pull/1991
- https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-31684M10 - Release 0.13Dmitrii GerashchenkoDmitrii Gerashchenkohttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/51Need to update parent record id validation for legal tag2022-03-24T14:46:48ZYauheni LesnikauNeed to update parent record id validation for legal tagCurrently, parent validation is based on the old concept of allowing only 3 components for record ID, then adding the version number, therefore it is only expecting 4 components:
```
if (tokens.length != 4) {
String msg = String.format(...Currently, parent validation is based on the old concept of allowing only 3 components for record ID, then adding the version number, therefore it is only expecting 4 components:
```
if (tokens.length != 4) {
String msg = String.format(ValidationDoc.INVALID_PARENT_RECORD_ID_FORMAT, parent);
```
Instead, it should be checking for valid record ID and record ID with version.
`if (!recordId.matches(ValidationDoc.RECORD_ID_REGEX) && !recordId.matches(ValidationDoc.RECORD_ID_WITH_VERSION_REGEX)) `M10 - Release 0.13Yauheni LesnikauYauheni Lesnikauhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/46Delete Tags & Libraries for 0.11.0 and 0.12.02021-06-29T22:07:46ZDavid Diederichd.diederich@opengroup.orgDelete Tags & Libraries for 0.11.0 and 0.12.0David Diederichd.diederich@opengroup.orgDavid Diederichd.diederich@opengroup.orghttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/45Reset to 0.10.0-SNAPSHOT2021-06-29T22:07:46ZDavid Diederichd.diederich@opengroup.orgReset to 0.10.0-SNAPSHOTDavid Diederichd.diederich@opengroup.orgDavid Diederichd.diederich@opengroup.orghttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/38Create an implementation class for IServiceAccountJwtClient in each cloud pro...2022-10-04T10:21:30ZAlok JoshiCreate an implementation class for IServiceAccountJwtClient in each cloud provider libraryMultiple services might end up having the same implementation of IServiceAccountJwtClient (e.g. https://community.opengroup.org/osdu/platform/system/storage/-/blob/master/provider/storage-aws/src/main/java/org/opengroup/osdu/storage/prov...Multiple services might end up having the same implementation of IServiceAccountJwtClient (e.g. https://community.opengroup.org/osdu/platform/system/storage/-/blob/master/provider/storage-aws/src/main/java/org/opengroup/osdu/storage/provider/aws/util/ServiceAccountJwtClientImpl.java) to generate service account token at runtime. Moving the implementation to respective provider libraries will prevent this issuehttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/37AppException stack traces are not informative.2021-04-29T15:11:06ZKrishna Nikhil VedurumudiAppException stack traces are not informative.## Current behaviour
When we wrap an exception inside AppException and the exception object is logged, inner stack trace is not populated by default.
The reason being, the printStackTrace implementation of `Throwable` class
```java
...## Current behaviour
When we wrap an exception inside AppException and the exception object is logged, inner stack trace is not populated by default.
The reason being, the printStackTrace implementation of `Throwable` class
```java
synchronized (s.lock()) {
// Print our stack trace
s.println(this);
StackTraceElement[] trace = getOurStackTrace();
for (StackTraceElement traceElement : trace)
s.println("\tat " + traceElement);
// Print suppressed exceptions, if any
for (Throwable se : getSuppressed())
se.printEnclosedStackTrace(s, trace, SUPPRESSED_CAPTION, "\t", dejaVu);
// Print cause, if any
Throwable ourCause = getCause();
if (ourCause != null)
ourCause.printEnclosedStackTrace(s, trace, CAUSE_CAPTION, "", dejaVu);
}
```
Here, when stacktrace is printed by logger, the AppException's StackTrace gets printed. Along with it, if a cause is attached, then the stacktrace of the cause also gets printed.
However, the `originalException` field in `AppException` class is not registered as cause. So, when we print the exception in logs, we miss important information about the cause. For eg: If we encounter a NullPointerException - Right now there is no way to identify the point at which the exception was thrown from.
Here is the current sample stack trace printed in logs
```
2021-04-07 18:17:29.672 ERROR LAPTOP-TS9M1QFT --- [nio-8082-exec-2] o.o.o.a.l.Slf4JLogger correlation-id=688c57a6-39a7-4666-b90b-4d5a461e77f3 data-partition-id=opendes: storage.app null {correlation-id=688c57a6-39a7-4666-b90b-4d5a461e77f3, data-partition-id=opendes}
AppException(error=AppError(code=500, reason=Server error., message=An unknown error has occurred., errors=null, debuggingInfo=null, originalException=java.lang.NullPointerException), originalException=java.lang.NullPointerException)
at org.opengroup.osdu.storage.util.GlobalOtherExceptionMapper.handleGeneralException(GlobalOtherExceptionMapper.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
```
## Expected Behaviour
The stacktrace could contain cause as well
```
021-04-07 20:29:23.858 ERROR LAPTOP-TS9M1QFT --- [nio-8082-exec-2] o.o.o.a.l.Slf4JLogger correlation-id=56bbc5c2-19e8-4aef-a449-3c684d733326 data-partition-id=opendes: storage.app null {correlation-id=56bbc5c2-19e8-4aef-a449-3c684d733326, data-partition-id=opendes}
AppException(error=AppError(code=500, reason=Server error., message=An unknown error has occurred., errors=null, debuggingInfo=null, originalException=java.lang.NullPointerException), originalException=java.lang.NullPointerException)
at org.opengroup.osdu.storage.util.GlobalOtherExceptionMapper.handleGeneralException(GlobalOtherExceptionMapper.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
Caused by: java.lang.NullPointerException
at org.opengroup.osdu.storage.service.QueryServiceImpl.getRecordInfo(QueryServiceImpl.java:72)
at org.opengroup.osdu.storage.api.RecordApi.getLatestRecordVersion(RecordApi.java:113)
at org.opengroup.osdu.storage.api.RecordApi$$FastClassBySpringCGLIB$$495e8f0c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
... 100 more
```https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/35VmCache should support expireAfterWrite2021-04-29T15:11:31ZKrishna Nikhil VedurumudiVmCache should support expireAfterWriteCurrent VM Cache implementation sets expiry to `expireAfterAccess`.
```
public VmCache(int cacheExpirationSeconds, int maximumCacheSize) {
this.cache = CacheBuilder.newBuilder().expireAfterAccess(cacheExpirationSeconds, TimeUn...Current VM Cache implementation sets expiry to `expireAfterAccess`.
```
public VmCache(int cacheExpirationSeconds, int maximumCacheSize) {
this.cache = CacheBuilder.newBuilder().expireAfterAccess(cacheExpirationSeconds, TimeUnit.SECONDS)
.maximumSize(maximumCacheSize).build();
}
```
For systems that have frequent `READ` calls, the cache expiration gets prolonged. And since there is no cache invalidation in place currently, stale data might never get updated.
**Ask**
Provide an additional constructor that could set `expiration strategy` based on the need. To avoid breaking change, we could use the existing constructor as default setting.
This could enable devs to customize the expiration strategy and use `expireAfterWrite` setting that would invalidate the cache entry as soon as the expiry time is reached.https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/34UpsertRecord serialization is throwing an exception due to the new RecordIdve...2023-06-05T08:19:48ZMatt WiseUpsertRecord serialization is throwing an exception due to the new RecordIdversions propertyBroken by https://community.opengroup.org/osdu/platform/system/storage/-/merge_requests/84
Fixed by !59Broken by https://community.opengroup.org/osdu/platform/system/storage/-/merge_requests/84
Fixed by !59ethiraj krishnamanaiduDania Kodeih (Microsoft)Wladmir FrazaoJoeDmitriy RudkoMatt Wiseethiraj krishnamanaidu