moodywoody
moodywoody

Reputation: 2159

Mojolicious - can't start app with hypnotoad

As the title says and I'm not sure why. The only thing happening is a hypnotaod.pid file appearing in the working directory. No running process, nothing listening on the defined port. Also - everything works fine with morbo.

EDIT: I've straced the startup, http://pastebin.com/YWUSeMuu

EDIT2: After looking through the strace output above it seems that hypnotad appends another ".pl" to the script file. I've change the file name to myapp, rinse, repeat http://pastebin.com/NVK2rhu4

Any ideas much appreaciated.

[root@fedora16 Mojo]# ./myapp.pl version
CORE
  Perl        (v5.14.2, linux)
  Mojolicious (3.02, Rainbow)

OPTIONAL
  EV              (4.11)
  IO::Socket::IP  (0.16)
  IO::Socket::SSL (1.76)

This version is up to date, have fun!

[root@fedora16 Mojo]# hypnotoad -t myapp.pl
Everything looks good!

[root@fedora16 Mojo]# hypnotoad  myapp.pl
Starting hot deployment for Hypnotoad server 29432.

Code by now is simply the tutorial testcode

use Mojolicious::Lite;

app->config(hypnotoad => {listen => ['http://*:3000']});
get '/' => {text => 'ALL GLORY TO THE HYPNOTOAD!'};
app->start;

Upvotes: 5

Views: 4400

Answers (6)

Eugen Konkov
Eugen Konkov

Reputation: 25133

add plugin 'Config'; into your application before app->config

If application does not load 'Config' plugin the configuration is not applyed

PS. The authors of Mojo do not beleive me that plugin 'Config' very implecit and not expected command when run application by hypnotoad.

Please vote to show that it must be documented about that Because current DOC is too implicit to understand that

Upvotes: 1

The same thing happened to me, I removed the .pid file in the app directory and started hypnotoad again and it worked just fine!. Hope this helps. M.

Upvotes: 2

shaneburgess
shaneburgess

Reputation: 15882

I have had this problem and every time it was related to a file permission issue.

In all cases morbo would run but hypnotoad would not.

Using the foreground flag should help you out.

Upvotes: 0

John Slavick
John Slavick

Reputation: 10619

I was having trouble with this as well. It was only when I happened to read the hypnotoad doc page closer that I saw it said "which listens on port 8080." Sure enough, opening http://127.0.0.1:8080 in my browser loaded my app.

Upvotes: 1

coredump
coredump

Reputation: 56

I met the similar issue, with --foreground, I managed to find the a lot of warning about permission denied with user 'nobody', after change the user parameter, the issue was fixed.

So many things can make hypnotoad fail, try to check port, file, user, group permissions etc.

Upvotes: 0

niczero
niczero

Reputation: 367

The first thing to do is try a different port (eg 3001) in case it's hitting a problem with 3000. Then try invoking it with MOJO_LOG_LEVEL=debug ... to see if it gives any more info. Ensure you have a writeable directory called 'log' and check it for output.

Upvotes: 0

Related Questions