Download files from remote server failed but ok from localhost with FileStorage using streams

Hi Team,

Our app was working fine several months ago with both web and portal clients streams image from server. Now (Cuba studio v6.8.3) the images are shown correctly with both clients when runs locally (localhost:8080/app or app-portal), but failed when runs from remote server (even on Lan in the lab like or app-portal). In the remote case, with the webclient using embeddedImage component, the image is shown top part only (please see the attachment), while with the portal module, the image is not shown at all.

To isolate the problem, we build and run Cuba team’s demo project with identical environment:
posted by Yuriy in July 17 at:
How to overwrite fileStorageDir? - Inaccessible primary storage

This demo works perfectly fine on both local and remote (Lan actually).

The key part of streaming images from the server in our code is the same as in the demo.

We observed two major differences related to the problem between our app and the demo:
1/ To organize/save uploaded files with the path string in ExtFileDescriptor, our app overrided saveStream(…) and getStorageDir(File rootDir, FileDescriptor fileDescriptor) methods of the core module:

2/ Our app has the fileStorageDir defined as something like:

The log (attached) has the same error message as in this post:

The error message is:
“java.lang.IllegalStateException: Connection not obtained from this manager”.

But we are still experiencing the problem with the fix.

Any insights and help is much appreciated.!

Lan_webClient_image_partialLoaded.txt (4.4 KB)
Lan_webClient_image_partialLoadedLan_portal_image_notShownAtAll.txt (26.2 KB)

1 Like

Updated the attachment files by adding portal log.

Both portal log and webClient log has the error:
java.lang.IllegalStateException: Connection not obtained from this manager

The portal log has the following two more errors that webClient log does not have:

org.apache.catalina.connector.ClientAbortException: Connection reset by peer

Caused by: Connection reset by peer

Thank you,

In the fact that Cuba demo app works just fine, we believe the problem of our app is most likely in our customization. While any insights are very welcome, please let us investigate further.

Thank you,

The fix is to upgrade Platform version in cuba-studio from platform-6.6.2 to a newer version that has the fix from Cuba team. We upgraded to the latest platform-6.8.7.

The Cuba team’s bug track is at:

The Cuba demo app works because it uses platform-6.5.5 which the problem had not been introduced yet.