petermueller / waffle_gcs

Google Cloud Storage for Waffle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error coming from kolorahl's repo

tjdam opened this issue · comments

commented

Hi! I just updated from kolorahl's last available commit, and straight up I get this error:

** (FunctionClauseError) no function clause matching in Goth.Token.for_scope/2
    (goth 1.2.0) lib/goth/token.ex:70: Goth.Token.for_scope(%Backend.Product.Creator{__meta__: #Ecto.Schema.Metadata<:loaded, "creators">, admin_relationships: #Ecto.Association.NotLoaded<association :admin_relationships is not loaded>, admins: #Ecto.Association.NotLoaded<association :admins is not loaded>, author_relationships: #Ecto.Association.NotLoaded<association :author_relationships is not loaded>, bio: "Something something", courses: #Ecto.Association.NotLoaded<association :courses is not loaded>, cover: %{file_name: "a144a57c-70d6-4650-9f22-883da7864487_1616926811951984000.png", updated_at: ~N[2021-03-28 10:20:13]}, handle: "a_handle", id: "2c856398-5df5-46eb-9c94-a997095363ea", inserted_at: ~N[2021-03-26 10:41:37], name: "A Person", role: nil, subscribers: #Ecto.Association.NotLoaded<association :subscribers is not loaded>, updated_at: ~N[2021-03-28 10:20:13]}, nil)
    (waffle_gcs 0.1.1) lib/waffle/storage/google/token/default_fetcher.ex:6: Waffle.Storage.Google.Token.DefaultFetcher.get_token/1
    (waffle_gcs 0.1.1) lib/waffle/storage/google/cloud_storage.ex:83: Waffle.Storage.Google.CloudStorage.conn/1
    (waffle_gcs 0.1.1) lib/waffle/storage/google/cloud_storage.ex:47: Waffle.Storage.Google.CloudStorage.put/3
    (waffle 1.1.4) lib/waffle/actions/store.ex:130: Waffle.Actions.Store.put_version/3
    (elixir 1.11.3) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir 1.11.3) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Function: #Function<1.48286728/0 in Waffle.Actions.Store.async_put_version/3>
    Args: []
21:58:51.472 [erl_level=error crash_reason=function_clause domain=cowboy pid=<0.12669.0> ] <error> Ranch protocol #PID<0.12670.0> of listener BackendWeb.Endpoint.HTTP (connection #PID<0.12669.0>, stream id 1) terminated
an exception was raised:
    ** (FunctionClauseError) no function clause matching in Goth.Token.for_scope/2
        (goth 1.2.0) lib/goth/token.ex:70: Goth.Token.for_scope(%Backend.Product.Creator{__meta__: #Ecto.Schema.Metadata<:loaded, "creators">, admin_relationships: #Ecto.Association.NotLoaded<association :admin_relationships is not loaded>, admins: #Ecto.Association.NotLoaded<association :admins is not loaded>, author_relationships: #Ecto.Association.NotLoaded<association :author_relationships is not loaded>, bio: "Something something", courses: #Ecto.Association.NotLoaded<association :courses is not loaded>, cover: %{file_name: "a144a57c-70d6-4650-9f22-883da7864487_1616926811951984000.png", updated_at: ~N[2021-03-28 10:20:13]}, handle: "a_handle", id: "2c856398-5df5-46eb-9c94-a997095363ea", inserted_at: ~N[2021-03-26 10:41:37], name: "A Person", role: nil, subscribers: #Ecto.Association.NotLoaded<association :subscribers is not loaded>, updated_at: ~N[2021-03-28 10:20:13]}, nil)
        (waffle_gcs 0.1.1) lib/waffle/storage/google/token/default_fetcher.ex:6: Waffle.Storage.Google.Token.DefaultFetcher.get_token/1
        (waffle_gcs 0.1.1) lib/waffle/storage/google/cloud_storage.ex:83: Waffle.Storage.Google.CloudStorage.conn/1
        (waffle_gcs 0.1.1) lib/waffle/storage/google/cloud_storage.ex:47: Waffle.Storage.Google.CloudStorage.put/3
        (waffle 1.1.4) lib/waffle/actions/store.ex:130: Waffle.Actions.Store.put_version/3
        (elixir 1.11.3) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
        (elixir 1.11.3) lib/task/supervised.ex:35: Task.Supervised.reply/5
        (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Is this to be expected?

Also, my waffle config uses Waffle.Storage.Google.CloudStorage instead of Waffle.Storage.Google as shown in the setup example. I a newbie to Elixir, but trying to read the code it seems to me that Google acts just as a namespace and not an actual module?

Thanks :)

commented

I got the same error. I also found I had to use Waffle.Storage.Google.CloudStorage.

Is there any fix for this?

We've been using this with glific fairly successfully. i just compared our branches, and we are two commits ahead. I'll check to see the differences. Our repo is is: https://github.com/glific/

Our storage is: Waffle.Storage.Google.CloudStorage