Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Error: (FunctionClauseError) no function clause matching in URI.encode/ #106

Open
sheharyarn opened this issue Jun 10, 2020 · 0 comments
Open

Comments

@sheharyarn
Copy link

sheharyarn commented Jun 10, 2020

Overview

We just updated arc_gcs from v0.1.2 to v0.2.3 and now get a FunctionClauseError when uploading an image.

Error

** (FunctionClauseError) no function clause matching in URI.encode/2
    (elixir) lib/uri.ex:293: URI.encode(nil, &URI.char_unreserved?/1)
    (google_api_storage) lib/google_api/storage/v1/api/objects.ex:732: GoogleApi.Storage.V1.Api.Objects.storage_objects_insert_simple/7
    (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<1.111884395/0 in Arc.Actions.Store.async_put_version/3>
    Args: []
17:28:07.579 pid=<0.4923.0>  [error] Ranch protocol #PID<0.4924.0> of listener Slab.Web.Endpoint.HTTPS (connection #PID<0.4923.0>, stream id 1) terminated
** (exit) :function_clause

Config

For context, the bucket name is our custom domain for assets. So, we've set asset_host: to the domain name and bucket: to nil to avoid unnecessary prefix on all paths. This is our Arc config:

config :arc,
  storage: Arc.Storage.GCS,
  bucket: nil,
  asset_host: "static.myapp.com"

I also tried setting bucket: "" but that just gives a different error.

Source

This seems to be the line responsible for the error:

"bucket" => URI.encode(bucket, &URI.char_unreserved?/1)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant