stavro / arc

:paperclip: Flexible file upload and attachment library for Elixir
1.16k stars 210 forks source link

`arc` crashes when trying to delete a file with a `:skip`ped transform #280

Open OvermindDL1 opened 5 years ago

OvermindDL1 commented 5 years ago

Environment

Expected behavior

Deleting a file (specifically done through arc_ecto but ditto when calling to delete it directly) while using a :skip transform should not crash

Actual behavior

Deleting a file (specifically done through arc_ecto but ditto when calling to delete it directly) while using a :skip transform crashes the process and thus the phoenix connection due to the task crashing propagating to it due to trying to delete a nil file. Stacktrace:

2019-05-31:11:50:48.163 [error] Task #PID<0.26883.0> started from #PID<0.26863.0> terminating
** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1
    (elixir) lib/io.ex:461: IO.chardata_to_string(nil)
    (elixir) lib/path.ex:521: Path.do_join/3
    (elixir) lib/path.ex:514: Path.join/2
    (elixir) lib/path.ex:483: Path.join/1
    (ccc_server) lib/arc/storage/fixed_local.ex:31: Arc.Storage.FixedLocal.delete/3
    (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<0.46176319/0 in Arc.Actions.Delete.async_delete_version/3>
    Args: []

This makes it impossible to delete those files and is also crashing connections that try it.

ali7enkish commented 5 years ago

I am also getting this issue. Is there any temporary workaround this?