Content Item Rest API FileNotFoundException


#1

Hello,

I am doing a small PoC with Flowable and nearly complete. Am having a bit of trouble using the REST API application with docker. I am trying to call the following Content REST API method:
http://admin:pass@docker.flowable:9977/flowable-rest/content-api/content-service/content-items/8664d695-c08c-11e8-9523-0242ac120005/data

The response is always the following, no matter the content item:
{
“message”: “Internal server error”,
“exception”: “Error while opening file stream”
}

An exception occurs in the logs for the flowable-rest:
Caused by: java.io.FileNotFoundException: /root/content/uncategorized/8664d694-c08c-11e8-9523-0242ac120005 (No such file or directory)

The full exception is at the gist below:
https://gist.github.com/Yomiji/0f27da62389ed573350a3a3796791c04

I am using the docker deployment for flowable-rest, flowable-idm, flowable-task, flowable-modeler and the postgresql docker compose provided by flowable.

Is there anyone familiar with this issue?


#2

After some additional searching, I’ve found a workaround in case anyone is interested.

Docker has the ability to create volumes, which are essentially bridges between the file system inside the container and the host machine. By sharing the volume as a bridge between the docker container file systems, I was able to link the lookup location for the flowable-rest /root/content directory with the flowable-task /data directory, where content is stored on forms.

Below are the steps to get the flowable-rest container API to see the flowable-task container content:

  1. Add a volume to the flowable-rest service definition in the .yml file of the docker compose
  2. Add the same named volume to the flowable-task service definition in the .yml file of the docker compose
  3. Add the named volume under the ‘volume’ service of the docker compose file
  4. Ensure that the selinux restrictions are lifted on the created volume, one way would be to add a colon and the letter Z at the end of the directory, you could also issue the commands listed on this stackoverflow post

A gist of the docker compose yml that I have modified is here:
https://gist.github.com/Yomiji/b9457d7ba88a85d92160c24f4b4e35e7

This remedies the FileNotFoundException issue for Docker-based deployments.