title: Elixir GenServer handle_cast function not found
body: <p>I'm new to Elixir so this is probably something really simple but I couldn't find the answer to this.</p>
  
  <p>So I have a simple GenServer like this:</p>
  
  <pre><code>defmodule BlobStorageActor do
    use GenServer
  
    def start_link do
      GenServer.start_link(__MODULE__, :ok, name: __MODULE__)  
    end
  
    def init(:ok) do
      {:ok, %{}}
    end
  
    def lookup(server, name) do
      GenServer.call(server, {:lookup, name})
    end
  
    def cp(pid, container, file_path) do
      GenServer.cast(pid, {:cp, container, file_path})
    end
  
    def handle_cast({:cp, container, file_path}, state) do
      %{body: containers} = ExAzure.request!(:list_containers)
  
      unless Enum.any?(containers, &amp;( {:blob_container, container, _, _, _ } = &amp;1)) do
        ExAzure.request(:create_container, [container])
      end
  
      ExAzure.request(:put_block_blob, [container, String.replace(file_path, " ", "_"), File.read!(file_path)])
    end
  end
  </code></pre>
  
  <p>But when I do this:</p>
  
  <pre><code>iex(53)&gt; iex(4)&gt; BlobStorageActor.cp(pid, "test", "Doxie 0008.pdf")
  BlobStorageActor.cp(pid, "test", "Doxie 0008.pdf")
  iex(53)&gt; ** (FunctionClauseError) no function clause matching in GenServer.cast/2
  iex(53)&gt;     (elixir) lib/gen_server.ex:630: GenServer.cast({:ok, #PID&lt;0.8023.0&gt;}, {:cp, "test", "Doxie 0008.pdf"})
  iex(53)&gt; iex(4)&gt; BlobStorageActor.cp(pid, "test", "Doxie 0008.pdf")
  BlobStorageActor.cp(pid, "test", "Doxie 0008.pdf")
  iex(53)&gt; ** (FunctionClauseError) no function clause matching in GenServer.cast/2
  iex(53)&gt;     (elixir) lib/gen_server.ex:630: GenServer.cast({:ok, #PID&lt;0.8023.0&gt;}, {:cp, "test", "Doxie 0008.pdf"})
  </code></pre>
  
  <p>Why do I get this error?</p>
  
  <pre><code>FunctionClauseError) no function clause matching in GenServer.cast/2
  </code></pre>
  
  <p>Any help would be much appreciated.</p>