holsee / chroxy

Headless Chrome as a Service

Home Page:https://hex.pm/packages/chroxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run with Elixir 1.8.1 & OTP 21

pedroseabra1091 opened this issue · comments

15:26:32.873 [info]  Application chroxy exited: exited in: Chroxy.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (ArgumentError) argument error
            :erlang.binary_to_integer(nil)
            (chroxy) lib/chroxy/endpoint.ex:11: Chroxy.Endpoint.child_spec/0
            (chroxy) lib/chroxy/application.ex:20: Chroxy.Application.start/2
            (kernel) application_master.erl:277: :application_master.start_it_old/4
** (Mix) Could not start application chroxy: exited in: Chroxy.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (ArgumentError) argument error
            :erlang.binary_to_integer(nil)
            (chroxy) lib/chroxy/endpoint.ex:11: Chroxy.Endpoint.child_spec/0
            (chroxy) lib/chroxy/application.ex:20: Chroxy.Application.start/2
            (kernel) application_master.erl:277: :application_master.start_it_old/4

Working with OTP 21 and Elixir 1.7.3. I will investigate with 1.8.1 soon. Thanks for the report.

Integration Tests passing on:
Elixir 1.8.1
Erlang/OTP 21 [erts-10.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

I have been unable to reproduce the issue on OTP 21 with Elixir 1.8.1. The following logic executes fine as such the "ArgumentException" does not take place.

@pedroseabra1091 it looks like this issue is with the following:

config/config.exs
(missing the following configuration when using Chroxy as a library i.e. in your own app?)

config :chroxy, Chroxy.Endpoint,
  scheme: :http,
  port: envar.("CHROXY_ENDPOINT_PORT") || "1330"

lib/chroxy/endpoint.ex:11:

endpoint_port = endpoint_opts[:port] |> String.to_integer()

When testing this logic out manually within a running iex session all is well:
Screenshot 2019-04-11 at 12 21 06

I will try a few more things before closing this issue.

@pedroseabra1091 I can only suspect that you are embedding Chroxy within another app, in which case you need to define the required configuration. Closing the issue. If you have more information please provide it within another issue.

I refer you to the following from the README:

If using Chroxy as a dependency of another mix projects you may wish to leverage the configuration implementation of Chroxy by replication the configuration in "../deps/chroxy/config/config.exs".