FHIR Chat · HibernateException · implementers

Stream: implementers

Topic: HibernateException


view this post on Zulip Jake Hardy (Aug 25 2017 at 15:28):

Good morning everybody. I've been doing some validation against the HAPI server, and I keep getting multiple instances of this exception:

"Error org.hibernate.HibernateException: Unable to access lob stream; nested exception is javax.persistence.PersistenceException: org.hibernate.HibernateException: Unable to access lob stream validating {someElement}"

The strange thing is that sometimes it comes back as a warning, while other times coming back as an error. Does anybody know what this error means, or have any insight on how to fix it?

view this post on Zulip Lloyd McKenzie (Aug 25 2017 at 15:59):

@James Agnew ?

view this post on Zulip dsh (Apr 13 2021 at 17:57):

I am experiencing the same problem running 5.3 in docker, @James Agnew any nudges to help proceed forward ?

view this post on Zulip James Agnew (Apr 13 2021 at 18:00):

are you able to reproduce this on hapi.fhir.org?

view this post on Zulip dsh (Apr 13 2021 at 18:01):

James Agnew said:

are you able to reproduce this on hapi.fhir.org?

How would I do that? I am running 5.3.0 in Docker and I see this in my logs

Hibernate:
    select
        resourcehi0_.pid as pid1_12_0_,
        resourcehi1_.res_ver_pid as res_ver_1_13_1_,
        resourcehi0_.partition_date as partitio2_12_0_,
        resourcehi0_.partition_id as partitio3_12_0_,
        resourcehi0_.res_deleted_at as res_dele4_12_0_,
        resourcehi0_.res_version as res_vers5_12_0_,
        resourcehi0_.has_tags as has_tags6_12_0_,
        resourcehi0_.res_published as res_publ7_12_0_,
        resourcehi0_.res_updated as res_upda8_12_0_,
        resourcehi0_.res_encoding as res_enco9_12_0_,
        resourcehi0_.res_text as res_tex10_12_0_,
        resourcehi0_.res_id as res_id11_12_0_,
        resourcehi0_.res_type as res_typ12_12_0_,
        resourcehi0_.res_ver as res_ver13_12_0_,
        resourcehi1_.partition_date as partitio2_13_1_,
        resourcehi1_.partition_id as partitio3_13_1_,
        resourcehi1_.request_id as request_4_13_1_,
        resourcehi1_.res_pid as res_pid6_13_1_,
        resourcehi1_.source_uri as source_u5_13_1_
    from
        hfj_res_ver resourcehi0_
    left outer join
        hfj_res_ver_prov resourcehi1_
            on resourcehi0_.pid=resourcehi1_.res_ver_pid
    where
        resourcehi0_.res_id=?
        and resourcehi0_.res_ver=?
2021-04-13 18:01:14.822 [main] ERROR c.u.f.jpa.searchparam.retry.Retrier [Retrier.java:79] Retry failure 31/60: org.springframework.orm.jpa.JpaSystemException: Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream

view this post on Zulip James Agnew (Apr 13 2021 at 18:02):

like, can you upload any data you'd need in order to simulate the same scenario on hapi.fhir.org, and share a link that shows it?

view this post on Zulip dsh (Apr 13 2021 at 18:03):

James Agnew said:

like, can you upload any data you'd need in order to simulate the same scenario on hapi.fhir.org, and share a link that shows it?

no this is happening on Server start it self .... I haven't even accessed the UI yet

view this post on Zulip dsh (Apr 13 2021 at 18:04):

again this may be bcoz of hapiproject/hapi:latest which was built off of master branch, running on DB schema migrated by 5.3.0 CLI

view this post on Zulip dsh (Apr 13 2021 at 18:04):

@James Agnew ^

view this post on Zulip James Agnew (Apr 13 2021 at 18:05):

hmm, not sure unfortunately. i don't know a lot about the docker build

view this post on Zulip James Agnew (Apr 13 2021 at 18:05):

does this happen if you don't use the docker build?

view this post on Zulip dsh (Apr 13 2021 at 18:05):

do I need to enable the logger in application.yml for this error to go away ? currently its commented out

view this post on Zulip James Agnew (Apr 13 2021 at 18:08):

not sure, does that solve the issue?

view this post on Zulip dsh (Apr 13 2021 at 18:13):

@James Agnew no it does not

view this post on Zulip dsh (Apr 13 2021 at 18:43):

@James Agnew some more insights here. This issue was reported here https://github.com/hapifhir/hapi-fhir/issues/2034
I am trying to run JPA 5.3.0 from dockerhub hapiproject/hapi the server won't start unless I can get past that exception

view this post on Zulip James Agnew (Apr 13 2021 at 18:48):

Well, FWIW that issue was fixed so I assume it's not exactly that (or it's the same thing happening elsewhere). If you are able to reproduce it outside of docker, please feel free to file a bug with the steps to reproduce, any stack trace, etc

view this post on Zulip dsh (Apr 13 2021 at 23:15):

@James Agnew on 5.3.0 on Debian (buster) with Java 11.0.8, I still get the same error regardless if the WAR is run outside or inside docker

The JPA Server does not start

I am using PostGresql 12.5

view this post on Zulip dsh (Apr 13 2021 at 23:25):

@James Agnew seems like this may be a problem emanating from the DB schema migration by hapi-fhir-cli https://stackoverflow.com/questions/38511205/org-hibernate-hibernateexception-org-postgresql-util-psqlexception-large-objec

view this post on Zulip dsh (Apr 13 2021 at 23:44):

@James Agnew I even tried to change the Hibernate DDL properties hibernate.hbm2ddl.auto: create-drop and I still get the same error

2021-04-13 23:40:57.842 [main] ERROR c.u.f.jpa.searchparam.retry.Retrier [Retrier.java:79] Retry failure 4/60: org.springframework.orm.jpa.JpaSystemException: Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream
````

view this post on Zulip dsh (Apr 13 2021 at 23:44):

@Ken Stevens any idea ?

view this post on Zulip dsh (Apr 14 2021 at 07:41):

Finally I got past that error by running this PLSQL function on Large Objects in my Postgres 12.6 on AWS RDS

CREATE OR REPLACE FUNCTION public.grant_select_on_large_objects()
 RETURNS text
 LANGUAGE plpgsql
AS $function$

    DECLARE
        REC BIGINT;

    begin

        FOR REC in   SELECT OID FROM pg_catalog.pg_largeobject_metadata
        loop

            execute 'grant select on LARGE OBJECT ' || REC || ' to caringly_db_master';

--          select 'LOBID is ' || REC.oid;

        END LOOP;

        return 'DONE';
    END;
$function$
;

Last updated: Apr 12 2022 at 19:14 UTC