Internal System calls throws STORAGE_PARTITION_IDENTIFY_READ error

156 views
Skip to first unread message

Ajay shekar

unread,
Mar 17, 2021, 8:53:39 AM3/17/21
to HAPI FHIR
Hello All,

I am using hapi-fhir-jpaserver-starter 5.3.0.
I am testing a internal system call command/api call read(IIdType theId); which is in -
/**
* Read a resource - Note that this variant of the method does not take in a {@link RequestDetails} and
* therefore can not fire any interceptors. Use only for internal system calls
*/
T read(IIdType theId);

This works fine with Partitioning being disabled but it throws error when Partitioning being enabled.
Error - 
{
"severity": "error",
"code": "processing",
"diagnostics": "No interceptor provided a value for pointcut: STORAGE_PARTITION_IDENTIFY_READ"
}

I think there needs to be distinction made between internal system call and http call in 
RequestPartitionId requestPartitionId = this.myRequestPartitionHelperService.determineReadPartitionForRequest(theRequest, this.getResourceName());

Are you guys planning to support below internal system calls with Partition being enabled? 
1.T read(IIdType theId);
2.IBundleProvider search(SearchParameterMap theParams);
3.DaoMethodOutcome update(T theResource);
4.DaoMethodOutcome create(T theResource);

Thanks in advance.

James Agnew

unread,
Mar 17, 2021, 9:18:34 AM3/17/21
to Ajay shekar, HAPI FHIR
You need to provide an interceptor to handle this case - the system won't be able to know what partition to look in otherwise.

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/cf2cb4df-ad13-4aef-bd18-5fb3fb1020e0n%40googlegroups.com.

Ajay shekar

unread,
Mar 17, 2021, 1:15:40 PM3/17/21
to HAPI FHIR
Hi James,

Thanks for the reply.
As the comment say's for T read(IIdType theId); "Note that this variant of the method does not take in a {@link RequestDetails} and
* therefore can not fire any interceptors. Use only for internal system calls".
It doesn't fire any interceptor right ?
I tried to give access to read from all Partition @ Pointcut STORAGE_PARTITION_IDENTIFY_READ in a interceptor but it doesn't get invoked.

Do you mean I have to try this
So it hits the interceptor to get the partition information.

Ajay shekar

unread,
Mar 18, 2021, 4:05:36 AM3/18/21
to HAPI FHIR
Hi James,

It is solved, thanks. The solution was in our last conversation as there is two registry for interceptors 
and only dao registry interceptor get accessed through internal system call.

三浦笑峰

unread,
Jun 25, 2021, 8:23:30 AM6/25/21
to HAPI FHIR
Hi.

I had the same problem and could not find the way to create interceptor in dao registry.
Could you show me an example to make dao registery interceptor?

Thank you.

Ajay shekar

unread,
Jul 5, 2021, 12:37:33 AM7/5/21
to HAPI FHIR
Hi, 

To make internal system call with partition enabled, you need to provide the partition information for the request by intercepting the internal system call.
It is done at Pointcut - STORAGE_PARTITION_IDENTIFY_READ and STORAGE_PARTITION_IDENTIFY_WRITE 
and the Partition interceptor is registered as

PartitionInterceptor interceptor = new PartitionInterceptor();
myInterceptorRegistry.registerInterceptor(interceptor); 

Raghu Govardhana

unread,
Sep 15, 2021, 6:56:26 AM9/15/21
to HAPI FHIR
I have tried with all possible Interceptor. Still I am getting the same error whenever I create or access the resources.
Please suggest the right configuration

Raghu Govardhana

unread,
Sep 16, 2021, 11:28:34 PM9/16/21
to HAPI FHIR
Hi,

The hook is invoked for search operation

2021-09-17 08:55:08.457 [http-nio-8080-exec-4] DEBUG c.u.f.j.s.SearchCoordinatorSvcImpl [?:?] Registering new search 59901c9c-8e1f-4750-9cf7-510f76dfd414
2021-09-17 08:55:08.460 [http-nio-8080-exec-4] INFO  c.u.f.j.e.i.RequestTenantPartitionInterceptor [?:?] <<<<<<<<<<<<<<<<< READ PARTITION>>>>>>>>>>>>> null
2021-09-17 08:55:08.464 [http-nio-8080-exec-4] DEBUG c.u.f.j.s.SearchCoordinatorSvcImpl [?:?] Search initial phase completed in 5ms

For Create resource it is not invoked
2021-09-17 08:53:43.300 [http-nio-8080-exec-9] DEBUG c.u.f.jpa.provider.BaseJpaProvider [?:?] Request headers: [accept, accept-encoding, authorization, connection, content-length, content-type, host, postman-token, user-agent]
2021-09-17 08:53:43.300 [http-nio-8080-exec-9] DEBUG c.u.f.jpa.provider.BaseJpaProvider [?:?] Request is from address: 0:0:0:0:0:0:0:1
2021-09-17 08:53:43.331 [http-nio-8080-exec-9] DEBUG ca.uhn.fhir.jpa.dao.BaseHapiFhirDao [?:?] Starting entity update
2021-09-17 08:53:43.341 [http-nio-8080-exec-9] DEBUG ca.uhn.fhir.jpa.dao.BaseHapiFhirDao [?:?] Entity has published time: Fri Sep 17 08:53:43 IST 2021
2021-09-17 08:53:43.461 [http-nio-8080-exec-9] DEBUG c.u.f.j.d.i.DaoResourceLinkResolver [?:?] Automatically creating empty placeholder resource: null
2021-09-17 08:53:43.465 [http-nio-8080-exec-9] ERROR c.u.f.r.s.i.ExceptionHandlingInterceptor [?:?] Failure during REST processing
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: No interceptor provided a value for pointcut: STORAGE_PARTITION_IDENTIFY_READ
at ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.validatePartition(RequestPartitionHelperSvc.java:193)
at ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.determineReadPartitionForRequest(RequestPartitionHelperSvc.java:105)
at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.doUpdate(BaseHapiFhirResourceDao.java:1449)
at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.lambda$update$12(BaseHapiFhirResourceDao.java:1414)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at ca.uhn.fhir.jpa.dao.tx.HapiTransactionService.execute(HapiTransactionService.java:65)
at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.update(BaseHapiFhirResourceDao.java:1414)
at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.update(BaseHapiFhirResourceDao.java:1394)
at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.update(BaseHapiFhirResourceDao.java:1389)
at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.update(BaseHapiFhirResourceDao.java:1374)
at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao$$FastClassBySpringCGLIB$$5578fb67.invoke(<generated>) 

Please suggest what is missing in the configuration to make this work

Ajay shekar

unread,
Sep 22, 2021, 9:23:28 AM9/22/21
to HAPI FHIR
You have to create a Partition Interceptor to attach a Partition information to all read and write requests.
Follow these examples:

After creating a interceptor register it as below

RequestTenantPartitionInterceptor interceptor = new RequestTenantPartitionInterceptor();
myInterceptorRegistry.registerInterceptor(interceptor); 

Reply all
Reply to author
Forward
0 new messages