Plumber file not reading .RData or .rds file

We are currently trying to productionize our R code. For this purpose we have used plumber to create rest API's and we are storing the model objects in the same location. We have created a docker where all libraries have been loaded.
We are running into error -
Error in gzfile(file, "rb") : cannot open the connection
Calls: readRDS -> gzfile
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file '/home/ubuntu/R_API/Anomaly_detection_model_object.rds', probable reason 'No such file or directory'
Execution halted

The aforementioned file is present in the location but this error is persisting.

In which location is it? Did you copy it over to Docker image? There is usually COPY directive somewhere in Dockerfile that tells it where to copy data from.

You can also start interactive session in Docker to poke around and see what's inside for testing purposes. I don't have good links on hand for that, but it's a fairly common problem that many people have, so there are plenty of examples out there.

1 Like

Thanks for the hint, the issue was with location that we were providing internally. Had to edit the location path

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.