I have deployed a Phoenix app with a PG database with the PostGIS extension enabled. I’m trying to run a one-time task on a running instance to seed the database with geometric data. I am downloading .zip files from an external source and saving them to the
tmp/ directory, processing and writing the data to the database, and deleting the file. It works locally, but when I run it in production I get an ENOENT when trying to unzip the files. Any suggestions? Thanks in advance!
07:53:41.692 [error] Task #PID<9449.2121.0> started from #PID<9449.2111.0> terminating ** (stop) :enoent (elixir 1.13.4) lib/system.ex:1044: System.cmd("unzip", ["/tmp/tl_2021_us_cd116.zip", "-d", "/tmp/exshape_da72c5e8-4581-433b-835a-05f4b17e6f53"], ) lib/exshape.ex:40: Exshape.unzip/3 lib/exshape.ex:100: Exshape.from_zip/2 lib/pyrex/shapefile.ex:47: PYREx.Shapefile.from_zip/1 lib/pyrex/shapefile.ex:31: PYREx.Shapefile.map_download/3 lib/pyrex/loader.ex:17: anonymous fn/2 in PYREx.Loader.run/0 (elixir 1.13.4) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2 (elixir 1.13.4) lib/task/supervised.ex:34: Task.Supervised.reply/4 Function: &:erlang.apply/2 Args: [#Function<4.108565059/1 in Pyrex.Loader>, [#Function<11.108565059/0 in Pyrex.Loader>]]