Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone Web UI doesn't start #64

Closed
romul opened this issue Jun 16, 2015 · 15 comments
Closed

Standalone Web UI doesn't start #64

romul opened this issue Jun 16, 2015 · 15 comments

Comments

@romul
Copy link
Contributor

romul commented Jun 16, 2015

Hi, I managed start exq itself and it works great.
But web UI refuses to start with an error:

$ mix exq.ui --webport 4040

Started ExqUI on Port 4040
** (UndefinedFunctionError) undefined function: Exq.RouterPlug.init/1 (module Exq.RouterPlug is not available)
    Exq.RouterPlug.init([namespace: "", exqopts: [name: :exq_enq_ui, host: '127.0.0.1', webport: 4040]])
    lib/plug/adapters/cowboy.ex:155: Plug.Adapters.Cowboy.dispatch_for/2
    lib/plug/adapters/cowboy.ex:36: Plug.Adapters.Cowboy.args/4
    lib/plug/adapters/cowboy.ex:126: Plug.Adapters.Cowboy.run/4
    lib/mix/tasks/exq.ui.ex:22: Mix.Tasks.Exq.Ui.run/1
    (mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2

Could you point me what is going wrong?

@romul
Copy link
Contributor Author

romul commented Jun 16, 2015

Ok, that's because of a hex package doesn't contain web directory.
Web UI works if github link is used as dependency:

  defp deps do
    [
      {:exq, github: 'akira/exq'}
    ]
  end

@romul
Copy link
Contributor Author

romul commented Jun 16, 2015

Although some strange errors still occur in the console log:

21:20:52.333 [error] Ranch listener Exq.RouterPlug.HTTP had connection process started with :cowboy_protocol:start_link/4 at #PID<0.429.0> 
exit with reason: {{%Plug.Conn.NotSentError{message: "no response was set nor sent from the connection"}, 
[{Plug.Adapters.Cowboy.Handler, :maybe_send, 2, [file: 'lib/plug/adapters/cowboy/handler.ex', line: 42]},
 {Plug.Adapters.Cowboy.Handler, :upgrade, 4, [file: 'lib/plug/adapters/cowboy/handler.ex', line: 16]},
 {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 435]}]},
 {Exq.RouterPlug, :call, [%Plug.Conn{adapter: {Plug.Adapters.Cowboy.Conn, :...},
 assigns: %{}, before_send: [], body_params: %Plug.Conn.Unfetched{aspect: :body_params}, 
 cookies: %Plug.Conn.Unfetched{aspect: :cookies}, halted: false, host: "localhost", method: "GET", 
 owner: #PID<0.429.0>, params: %Plug.Conn.Unfetched{aspect: :params}, 
 path_info: ["api", "realtimes"], peer: {{127, 0, 0, 1}, 55566}, port: 4040, private: %{},

@j-mcnally
Copy link
Collaborator

I'll try to take a look today.

On Tue, Jun 16, 2015 at 1:27 PM, Roman Smirnov notifications@github.com
wrote:

Although some strange errors related to /api/realtimes still occur in the
console log:

21:20:52.333 [error] Ranch listener Exq.RouterPlug.HTTP had connection process started with :cowboy_protocol:start_link/4 at #PID<0.429.0> exit with reason: {{%Plug.Conn.NotSentError{message: "no response was set nor sent from the connection"}, [{Plug.Adapters.Cowboy.Handler, :maybe_send, 2, [file: 'lib/plug/adapters/cowboy/handler.ex', line: 42]}, {Plug.Adapters.Cowboy.Handler, :upgrade, 4, [file: 'lib/plug/adapters/cowboy/handler.ex', line: 16]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 435]}]}, {Exq.RouterPlug, :call, [%Plug.Conn{adapter: {Plug.Adapters.Cowboy.Conn, :...}, assigns: %{}, before_send: [], body_params: %Plug.Conn.Unfetched{aspect: :body_params}, cookies: %Plug.Conn.Unfetched{aspect: :cookies}, halted: false, host: "localhost", method: "GET", owner: #PID<0.429.0>, params: %Plug.Conn.Unfetched{aspect: :params}, path_info: ["api", "realtimes"], peer: {{127, 0, 0, 1}, 55566}, port: 4040, private: %{},


Reply to this email directly or view it on GitHub
#64 (comment).

http://www.kohactive.com
Justin McNally
Technology Director / Principal
p: 312.273.3074 <+13122733074> | e: justin@kohactive.com | skype:
justinmcnally211 http://is.gd/UuXAGG
https://github.com/j-mcnally https://twitter.com/j_mcnally
https://www.linkedin.com/profile/view?id=143776726

romul added a commit to romul/exq that referenced this issue Jun 16, 2015
@romul
Copy link
Contributor Author

romul commented Jun 16, 2015

@j-mcnally Thank you for a quick response.
I've already figured out what's going on, please, take a look at my pull request.

@j-mcnally
Copy link
Collaborator

Thanks so much! i will check it out now!

On Tue, Jun 16, 2015 at 4:00 PM, Roman Smirnov notifications@github.com
wrote:

@j-mcnally https://github.com/j-mcnally Thank you for a quick response.
I've already figured out a root of the issue, please, take a look at my
pull request.


Reply to this email directly or view it on GitHub
#64 (comment).

http://www.kohactive.com
Justin McNally
Technology Director / Principal
p: 312.273.3074 <+13122733074> | e: justin@kohactive.com | skype:
justinmcnally211 http://is.gd/UuXAGG
https://github.com/j-mcnally https://twitter.com/j_mcnally
https://www.linkedin.com/profile/view?id=143776726

@mspanc
Copy link

mspanc commented Jun 18, 2015

I have the same issue

@j-mcnally
Copy link
Collaborator

Thanks so much for the report. I will get this fixed in master tonight. I think the problem is I haven't kept up with testing new elixirs and otps

@akira
Copy link
Owner

akira commented Jun 18, 2015

@j-mcnally great, let me know if you need any help (btw, you should have commit access to master).

@j-mcnally
Copy link
Collaborator

ok so just to keep everyone updated, i pulled master and was able to run
mix exq.ui --webport 4040

and everything works.

Im going to create a dummy project and try to reproduce the issue.

@mspanc or @romul would it be possible to get a simple project where this fails.

As for the hex package missing the web directory i must admit i don't know much about hex packages.

@akira do you have any idea why that would be the case?

@j-mcnally
Copy link
Collaborator

ok i was able to reproduce with

defmodule ExqTest.Mixfile do
  use Mix.Project

  def project do
    [ app: :exqtest,
      version: "0.0.1",
      elixir: "~> 1.0.0",
      elixirc_paths: ["lib"],
      package: [],
      description: """
      Exq test.
      """,
      deps: deps ]
  end

  # Configuration for the OTP application
  def application do
    [
      mod: { ExqTest, [] },
      applications: [:logger]
    ]
  end

  # Returns the list of dependencies in the format:
  # { :foobar, "0.1", git: "https://github.com/elixir-lang/foobar.git" }
  defp deps do
    [
      {:exq, path: '../exq'}
    ]
  end
end

@j-mcnally
Copy link
Collaborator

@romul's fix works perfect. Must be a new plug thing. Still perplexed why it works in isolation but not when embeded in another project. O well.

Now we just need to fix the hex package and we should be good to go.

@j-mcnally
Copy link
Collaborator

@mspanc do you mind testing with master.

Basically just swap out the hex package for {:exq, github: 'akira/exq'} as @romul suggests.

@akira
Copy link
Owner

akira commented Jun 18, 2015

@j-mcnally I'll take a look at the hex package issue

@akira
Copy link
Owner

akira commented Jun 19, 2015

@j-mcnally I added to it to the files in mix.exs and bump / published it again. It should work now, let me know if not or if there are any other issues.

@j-mcnally
Copy link
Collaborator

Teamwork

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

No branches or pull requests

4 participants