AtlasOfLivingAustralia / profile-hub

Profiles front end application
http://www.ausflora.org.au/
0 stars 3 forks source link

/{opusId}/profile/{profileId}/image API endpoint no longer returning images #811

Closed jack-brinkman closed 8 months ago

jack-brinkman commented 9 months ago

Following the 4.2 release, images from the /api/opus/{opusId}/profile/{profileId}/image aren’t being returned.

However, they’re still within the system & returned from the main /api/opus/{opusId}/profile/{profileId} endpoint (see screenshots below).

Images endpoint

image

Main profile endpoint

image

schoicsiro commented 9 months ago

I checked Profile-hub logs in Prod, I found the error as below,

'2023-12-14 14:13:03.090 ERROR --- [o-8098-exec-104] au.org.ala.ws.service.WebService : Failed sending GET request to http://localhost:8080/biocache-service/occurrences/search.json?q=lsid%3Ahttps%3A%2F%2Fid.biodiversity.org.au%2Ftaxon%2Fapni%2F51295129+AND+%28data_resource_uid%3Adr382+OR+data_resource_uid%3A%22dr382%22+OR+data_resource_uid%3A%22dr413%22+OR+data_resource_uid%3A%22dr376%22%29&fq=multimedia:Image&sort=images&format=json&im=true&pageSize=7&startIndex=0&fl=id,image_url java.net.ConnectException: Connection refused (Connection refused) at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.base/java.net.Socket.connect(Socket.java:609) at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177) at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446) at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:220) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164) at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515) at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:434) at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:383) at groovyx.net.http.HTTPBuilder$request.call(Unknown Source) at au.org.ala.ws.service.WebService.send(WebService.groovy:281) at jdk.internal.reflect.GeneratedMethodAccessor203.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:61) at au.org.ala.ws.service.WebService.get(WebService.groovy:70) at au.org.ala.ws.service.WebService.get(WebService.groovy) at jdk.internal.reflect.GeneratedMethodAccessor259.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:182) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:73) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139) at au.org.ala.profile.hub.BiocacheService.retrieveImages(BiocacheService.groovy:84) at au.org.ala.profile.hub.BiocacheService$retrieveImages$1.call(Unknown Source) at au.org.ala.profile.hub.ImageService.retrieveImagesPaged(ImageService.groovy:363) 9:34

biocache-service is unstable so connection is refused.

now it's working but it might be happen again.

jack-brinkman commented 8 months ago

This has been fixed via a script - the privateImages property of the profile object in mongo was not populated correctly, and hence, the images weren't being returned.