peburrows / goth

Elixir package for Oauth authentication via Google Cloud APIs
http://hexdocs.pm/goth
MIT License
289 stars 111 forks source link

Failed to retrieve project data from GCE internal metadata service #70

Closed 619 closed 4 years ago

619 commented 4 years ago

mix.exs deps looks like this: {:goth, "~> 1.2", config: :goth, json: "file.json" |> File.read!},

I also ran export GOOGLE_APP_CREDENTIALS=... already. What's going on?

** (Mix) Could not start application goth: Goth.start(:normal, []) returned an error: shutdown: failed to start child: Goth.Config
    ** (EXIT) an exception was raised:
        ** (RuntimeError)  Failed to retrieve project data from GCE internal metadata service.
                   Either you haven't configured your GCP credentials, you aren't running on GCE, or both.
                   Please see README.md for instructions on configuring your credentials.
            (goth 1.2.0) lib/goth/config.ex:182: Goth.Config.determine_project_id/2
            (goth 1.2.0) lib/goth/config.ex:73: anonymous fn/2 in Goth.Config.load_and_init/1
            (elixir 1.10.2) lib/enum.ex:1400: anonymous fn/3 in Enum.map/2
            (stdlib 3.12.1) maps.erl:232: :maps.fold_1/3
            (elixir 1.10.2) lib/enum.ex:2127: Enum.map/2
            (goth 1.2.0) lib/goth/config.ex:71: Goth.Config.load_and_init/1
            (stdlib 3.12.1) gen_server.erl:374: :gen_server.init_it/2
            (stdlib 3.12.1) gen_server.erl:342: :gen_server.init_it/6
            (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
619 commented 4 years ago

I get the same error when I disable goth in mix.exs with disabled: true

619 commented 4 years ago

Google's example for setting the path variable does not list the correct location for the path variable on macOS. Perhaps its intended for linux?

nichita-pasecinic commented 2 years ago

@619 how did you solved it ?