librelist archives

« back to archive

Accepts default_host of an undefined host.

Accepts default_host of an undefined host.

From:
Madireddy Samuel Vijaykumar
Date:
2010-09-28 @ 10:46
I changes the "name" in the Host entry to "localhost" but did not reset the
default_host in the "mongrel2" of mongrel2.conf. As you can see here...

...
...
mongrel2 = Host(name="localhost", routes={
'@chat': chat_demo,
'/handlertest': handler_test,
 '/chat/': web_app_proxy,
'/': web_app_proxy,
'/tests/': test_directory,
'/testsmulti/(.*.json)': test_directory,
'/chatdemo/': chat_demo_dir,
'/static/': chat_demo_dir,
'/mp3stream': Handler(
send_spec='tcp://127.0.0.1:9995',
send_ident='53f9f1d1-1116-4751-b6ff-4fbe3e43d142',
 recv_spec='tcp://127.0.0.1:9994', recv_ident='')
})

main = Server(
uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
access_log="/logs/access.log",
error_log="/logs/error.log",
 chroot="./",
pid_file="/run/mongrel2.pid",
default_host="mongrel2.org",
 name="main",
port=6767,
hosts=[mongrel2]
)
...

And then i loaded this config, and ...

[sam@sam test]$ m2sh load
[WARN] (errno: None) No option --db given, using "config.sqlite" as the
default.
[WARN] (errno: None) No option --config given, using "mongrel2.conf" as the
default.

it loads without errors. And when i list the servers i see this...

[sam@sam test]$ m2sh servers
[WARN] (errno: None) No option --db given, using "config.sqlite" as the
default.
SERVERS:
------
main mongrel2.org 2f62bd5-9e59-49cd-993c-3b6013c28f05

So i go ahead it try to start mongrel2.org(obviously not defined) i get the
following error.

[sam@sam test]$ m2sh start -host mongrel2.org
[WARN] (errno: None) No option --db given, using "config.sqlite" as the
default.
[INFO] MAX limits.handler_stack=102400
[INFO] Loaded handler 1 with
send_spec=tcp://127.0.0.1:9999send_ident=54c6755b-9628-40a4-9a2d-cc82a816345e
recv_spec=tcp://
127.0.0.1:9998 recv_ident=
[INFO] Loaded handler 2 with
send_spec=tcp://127.0.0.1:9997send_ident=34f9ceee-cd52-4b7f-b197-88bf2f0ec378
recv_spec=tcp://
127.0.0.1:9996 recv_ident=
[INFO] Loaded handler 3 with
send_spec=tcp://127.0.0.1:9995send_ident=53f9f1d1-1116-4751-b6ff-4fbe3e43d142
recv_spec=tcp://
127.0.0.1:9994 recv_ident=
[INFO] Loaded proxy 1 with address=127.0.0.1 port=8888
[INFO] Loaded proxy 2 with address=127.0.0.1 port=8888
[INFO] MAX limits.dir_send_buffer=16384, limits.dir_max_path=256
[INFO] Loaded dir 1 with base=tests/ index=index.html def_ctype=text/plain
[INFO] Loaded dir 2 with base=examples/chat/static/ index=index.html
def_ctype=text/plain
[INFO] Loaded dir 3 with base=examples/chat/static/ index=index.html
def_ctype=text/plain
[INFO] Loaded dir 4 with base=tests/ index=index.html def_ctype=text/plain
[INFO] MAX limits.url_path=256, limits.host_name=256
[INFO] Created proxy route 1:/ -> 127.0.0.1:8888
[INFO] Created handler route 2:@chat ->
54c6755b-9628-40a4-9a2d-cc82a816345e:tcp://127.0.0.1:9999
[INFO] Created proxy route 3:/chat/ -> 127.0.0.1:8888
[INFO] Created directory route 4:/tests/ -> 1:tests/
[INFO] Created directory route 5:/static/ -> 2:examples/chat/static/
[INFO] Created directory route 6:/chatdemo/ -> 3:examples/chat/static/
[INFO] Created handler route 7:/handlertest ->
34f9ceee-cd52-4b7f-b197-88bf2f0ec378:tcp://127.0.0.1:9997
[INFO] Created handler route 8:/mp3stream ->
53f9f1d1-1116-4751-b6ff-4fbe3e43d142:tcp://127.0.0.1:9995
[INFO] Created directory route 9:/testsmulti/(.*.json) -> 4:tests/
[INFO] Adding host 1:localhost to server at pattern localhost
[INFO] Loaded server 1:2f62bd5-9e59-49cd-993c-3b6013c28f05 on port 6767 with
default host mongrel2.org
[INFO] MAX limits.mime_ext_len=128
[INFO] Could not force NOFILE higher, you'll need to run as root: Operation
not permitted
[INFO] MAX open file descriptors is 1024 now.
[ERROR] (errno: No such file or directory) Failed to open PID file
.//run/mongrel2.pid for reading.
[INFO] No previous Mongrel2 running, continuing on.
[ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as root
if this is what you want.
[ERROR] (errno: None) Couldn't chroot too ./, assuming running in test mode.
[ERROR] (errno: No such file or directory) Failed to open the access log:
/logs/access.log
[INFO] Starting 0MQ with 1 threads.
[INFO] MAX limits.header_count=1280
[INFO] MAX limits.content_length=20480, limits.buffer_size=4096,
limits.connection_stack_size=32768
[INFO] Starting Mongrel2/1.2-d5224c71cb. Copyright (C) Zed A. Shaw. Licensed
BSD.
[ERROR] (errno: None) No default_host set, you need one host named:
mongrel2.org
[ERROR] (errno: None) Server startup failed, aborting.

and then i try to start localhost, and i end up with this...

[sam@sam test]$ m2sh start -host localhost
[WARN] (errno: None) No option --db given, using "config.sqlite" as the
default.
[ERROR] (errno: No such file or directory) Operation on server failed.

I know the errors are legitimate but, i guess there needs to be better
parsing mechanism of the conf file before a load. What do you think?

Sam



"""
Anyday...
Above the ground and vertical
... is a good day!
"""
http://megam.info
:)~

Re: [mongrel2] Accepts default_host of an undefined host.

From:
Zed A. Shaw
Date:
2010-09-28 @ 17:09
On Tue, Sep 28, 2010 at 04:16:55PM +0530, Madireddy Samuel Vijaykumar wrote:
> I changes the "name" in the Host entry to "localhost" but did not reset the
> default_host in the "mongrel2" of mongrel2.conf. As you can see here...

Take a closer look:

> mongrel2 = Host(name="localhost", routes={
.....
> })

That host's name="localhost", not "mongrel2.org".

> main = Server(
....
> hosts=[mongrel2]
> )

You then set this mongrel2 variable as the only host, so it looks for a
server with a host named "mongrel2.org", doesn't find it, and gives you
that error.

Change the Host(name="mongrel2.org") and it should work.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Accepts default_host of an undefined host.

From:
Madireddy Samuel Vijaykumar
Date:
2010-09-28 @ 18:02
Yes i understand the legitimacy of those errors. But since theres is already
a load operation prior to start operation, doesnt it make sense to parse the
conf file for these erroneous inputs.

I am fine if you still wish to differ.

Sam
"""
Anyday...
Above the ground and vertical
... is a good day!
"""
http://megam.info
:)~




On Tue, Sep 28, 2010 at 10:39 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:

> On Tue, Sep 28, 2010 at 04:16:55PM +0530, Madireddy Samuel Vijaykumar
> wrote:
> > I changes the "name" in the Host entry to "localhost" but did not reset
> the
> > default_host in the "mongrel2" of mongrel2.conf. As you can see here...
>
> Take a closer look:
>
> > mongrel2 = Host(name="localhost", routes={
> .....
> > })
>
> That host's name="localhost", not "mongrel2.org".
>
> > main = Server(
> ....
> > hosts=[mongrel2]
> > )
>
> You then set this mongrel2 variable as the only host, so it looks for a
> server with a host named "mongrel2.org", doesn't find it, and gives you
> that error.
>
> Change the Host(name="mongrel2.org") and it should work.
>
> --
> Zed A. Shaw
> http://zedshaw.com/
>

Re: [mongrel2] Accepts default_host of an undefined host.

From:
Zed A. Shaw
Date:
2010-09-28 @ 18:46
On Tue, Sep 28, 2010 at 11:32:31PM +0530, Madireddy Samuel Vijaykumar wrote:
> Yes i understand the legitimacy of those errors. But since theres is already
> a load operation prior to start operation, doesnt it make sense to parse the
> conf file for these erroneous inputs.
> 
> I am fine if you still wish to differ.

Oh that, hmmm, yeah that's possible for sure.  It'd be easy to do up a
checker that confirms your DB is alright.  Hell that could even be a new
command, m2sh check.

http://mongrel2.org/tktview/afc14a23692efcf5a5dc2d8a3bf86b01905fca6a

Done and done.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Accepts default_host of an undefined host.

From:
Boril Boyanov
Date:
2010-09-28 @ 11:06
Your errors:

>[ERROR] (errno: No such file or directory) Failed to open PID file 
.//run/mongrel2.pid for reading.
You need to create a blank pid file:
touch ./run/mongrel2.pid
sudo chown root:root ./run/mongrel2.pid
sudo chmod ug+rw ./run/mongrel2.pid

>[ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as 
root if this is what you want.
Set chroot to a _full_ path like this:
chroot = "/var/www/mongrel2"

>[ERROR] (errno: None) Couldn't chroot too ./, assuming running in test mode.
see above

>[ERROR] (errno: No such file or directory) Failed to open the access log:
/logs/access.log
mkdir ./logs

>[ERROR] (errno: None) No default_host set, you need one host named: mongrel2.org
default_host = "yourhost" (localhost)
don't try to bind it to mongrel2.org :) it's Zed's domain! :)

>[ERROR] (errno: None) Server startup failed, aborting.
Well failure was imminent :)

>and then i try to start localhost, and i end up with this...

>[sam@sam test]$ m2sh start -host localhost
>[WARN] (errno: None) No option --db given, using "config.sqlite" as the default.
>[ERROR] (errno: No such file or directory) Operation on server failed.
without -sudo (because it didn't worked on my Ubuntu)

sudo m2sh load -config <your *.conf file> -db <your *.sqlite file>
sudo m2sh start -db <your *.sqlite> -host <your hostname: localhost>

This should work ...
Take care.

On 28 September 2010 13:46, Madireddy Samuel Vijaykumar
<mad.vijay@gmail.com> wrote:
> I changes the "name" in the Host entry to "localhost" but did not reset the
> default_host in the "mongrel2" of mongrel2.conf. As you can see here...
>
> ...
> ...
> mongrel2 = Host(name="localhost", routes={
> '@chat': chat_demo,
> '/handlertest': handler_test,
> '/chat/': web_app_proxy,
> '/': web_app_proxy,
> '/tests/': test_directory,
> '/testsmulti/(.*.json)': test_directory,
> '/chatdemo/': chat_demo_dir,
> '/static/': chat_demo_dir,
> '/mp3stream': Handler(
> send_spec='tcp://127.0.0.1:9995',
> send_ident='53f9f1d1-1116-4751-b6ff-4fbe3e43d142',
> recv_spec='tcp://127.0.0.1:9994', recv_ident='')
> })
> main = Server(
> uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
> access_log="/logs/access.log",
> error_log="/logs/error.log",
> chroot="./",
> pid_file="/run/mongrel2.pid",
> default_host="mongrel2.org",
> name="main",
> port=6767,
> hosts=[mongrel2]
> )
> ...
> And then i loaded this config, and ...
> [sam@sam test]$ m2sh load
> [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> default.
> [WARN] (errno: None) No option --config given, using "mongrel2.conf" as the
> default.
>
> it loads without errors. And when i list the servers i see this...
> [sam@sam test]$ m2sh servers
> [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> default.
> SERVERS:
> ------
> main mongrel2.org 2f62bd5-9e59-49cd-993c-3b6013c28f05
>
> So i go ahead it try to start mongrel2.org(obviously not defined) i get the
> following error.
> [sam@sam test]$ m2sh start -host mongrel2.org
> [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> default.
> [INFO] MAX limits.handler_stack=102400
> [INFO] Loaded handler 1 with send_spec=tcp://127.0.0.1:9999
> send_ident=54c6755b-9628-40a4-9a2d-cc82a816345e
> recv_spec=tcp://127.0.0.1:9998 recv_ident=
> [INFO] Loaded handler 2 with send_spec=tcp://127.0.0.1:9997
> send_ident=34f9ceee-cd52-4b7f-b197-88bf2f0ec378
> recv_spec=tcp://127.0.0.1:9996 recv_ident=
> [INFO] Loaded handler 3 with send_spec=tcp://127.0.0.1:9995
> send_ident=53f9f1d1-1116-4751-b6ff-4fbe3e43d142
> recv_spec=tcp://127.0.0.1:9994 recv_ident=
> [INFO] Loaded proxy 1 with address=127.0.0.1 port=8888
> [INFO] Loaded proxy 2 with address=127.0.0.1 port=8888
> [INFO] MAX limits.dir_send_buffer=16384, limits.dir_max_path=256
> [INFO] Loaded dir 1 with base=tests/ index=index.html def_ctype=text/plain
> [INFO] Loaded dir 2 with base=examples/chat/static/ index=index.html
> def_ctype=text/plain
> [INFO] Loaded dir 3 with base=examples/chat/static/ index=index.html
> def_ctype=text/plain
> [INFO] Loaded dir 4 with base=tests/ index=index.html def_ctype=text/plain
> [INFO] MAX limits.url_path=256, limits.host_name=256
> [INFO] Created proxy route 1:/ -> 127.0.0.1:8888
> [INFO] Created handler route 2:@chat ->
> 54c6755b-9628-40a4-9a2d-cc82a816345e:tcp://127.0.0.1:9999
> [INFO] Created proxy route 3:/chat/ -> 127.0.0.1:8888
> [INFO] Created directory route 4:/tests/ -> 1:tests/
> [INFO] Created directory route 5:/static/ -> 2:examples/chat/static/
> [INFO] Created directory route 6:/chatdemo/ -> 3:examples/chat/static/
> [INFO] Created handler route 7:/handlertest ->
> 34f9ceee-cd52-4b7f-b197-88bf2f0ec378:tcp://127.0.0.1:9997
> [INFO] Created handler route 8:/mp3stream ->
> 53f9f1d1-1116-4751-b6ff-4fbe3e43d142:tcp://127.0.0.1:9995
> [INFO] Created directory route 9:/testsmulti/(.*.json) -> 4:tests/
> [INFO] Adding host 1:localhost to server at pattern localhost
> [INFO] Loaded server 1:2f62bd5-9e59-49cd-993c-3b6013c28f05 on port 6767 with
> default host mongrel2.org
> [INFO] MAX limits.mime_ext_len=128
> [INFO] Could not force NOFILE higher, you'll need to run as root: Operation
> not permitted
> [INFO] MAX open file descriptors is 1024 now.
> [ERROR] (errno: No such file or directory) Failed to open PID file
> .//run/mongrel2.pid for reading.
> [INFO] No previous Mongrel2 running, continuing on.
> [ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as root
> if this is what you want.
> [ERROR] (errno: None) Couldn't chroot too ./, assuming running in test mode.
> [ERROR] (errno: No such file or directory) Failed to open the access log:
> /logs/access.log
> [INFO] Starting 0MQ with 1 threads.
> [INFO] MAX limits.header_count=1280
> [INFO] MAX limits.content_length=20480, limits.buffer_size=4096,
> limits.connection_stack_size=32768
> [INFO] Starting Mongrel2/1.2-d5224c71cb. Copyright (C) Zed A. Shaw. Licensed
> BSD.
> [ERROR] (errno: None) No default_host set, you need one host named:
> mongrel2.org
> [ERROR] (errno: None) Server startup failed, aborting.
>
> and then i try to start localhost, and i end up with this...
>
> [sam@sam test]$ m2sh start -host localhost
> [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> default.
> [ERROR] (errno: No such file or directory) Operation on server failed.
>
> I know the errors are legitimate but, i guess there needs to be better
> parsing mechanism of the conf file before a load. What do you think?
> Sam
>
>
> """
> Anyday...
> Above the ground and vertical
> ... is a good day!
> """
> http://megam.info
> :)~
>
>
>

Re: [mongrel2] Accepts default_host of an undefined host.

From:
Madireddy Samuel Vijaykumar
Date:
2010-09-28 @ 11:13
Thanks for your inline comments.

But my point is not clarify about the errors i have encountered but the fact
that "m2sh load" does not seem to complete parsing of the conf file before
it loads its into the database.

Thanks again

Sam

"""
Anyday...
Above the ground and vertical
... is a good day!
"""
http://megam.info
:)~




On Tue, Sep 28, 2010 at 4:36 PM, Boril Boyanov <borko.boyanov@gmail.com>wrote:

> Your errors:
>
> >[ERROR] (errno: No such file or directory) Failed to open PID file
> .//run/mongrel2.pid for reading.
> You need to create a blank pid file:
> touch ./run/mongrel2.pid
> sudo chown root:root ./run/mongrel2.pid
> sudo chmod ug+rw ./run/mongrel2.pid
>
> >[ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as root
> if this is what you want.
> Set chroot to a _full_ path like this:
> chroot = "/var/www/mongrel2"
>
> >[ERROR] (errno: None) Couldn't chroot too ./, assuming running in test
> mode.
> see above
>
> >[ERROR] (errno: No such file or directory) Failed to open the access log:
> /logs/access.log
> mkdir ./logs
>
> >[ERROR] (errno: None) No default_host set, you need one host named:
> mongrel2.org
> default_host = "yourhost" (localhost)
> don't try to bind it to mongrel2.org :) it's Zed's domain! :)
>
> >[ERROR] (errno: None) Server startup failed, aborting.
> Well failure was imminent :)
>
> >and then i try to start localhost, and i end up with this...
>
> >[sam@sam test]$ m2sh start -host localhost
> >[WARN] (errno: None) No option --db given, using "config.sqlite" as the
> default.
> >[ERROR] (errno: No such file or directory) Operation on server failed.
> without -sudo (because it didn't worked on my Ubuntu)
>
> sudo m2sh load -config <your *.conf file> -db <your *.sqlite file>
> sudo m2sh start -db <your *.sqlite> -host <your hostname: localhost>
>
> This should work ...
> Take care.
>
> On 28 September 2010 13:46, Madireddy Samuel Vijaykumar
> <mad.vijay@gmail.com> wrote:
> > I changes the "name" in the Host entry to "localhost" but did not reset
> the
> > default_host in the "mongrel2" of mongrel2.conf. As you can see here...
> >
> > ...
> > ...
> > mongrel2 = Host(name="localhost", routes={
> > '@chat': chat_demo,
> > '/handlertest': handler_test,
> > '/chat/': web_app_proxy,
> > '/': web_app_proxy,
> > '/tests/': test_directory,
> > '/testsmulti/(.*.json)': test_directory,
> > '/chatdemo/': chat_demo_dir,
> > '/static/': chat_demo_dir,
> > '/mp3stream': Handler(
> > send_spec='tcp://127.0.0.1:9995',
> > send_ident='53f9f1d1-1116-4751-b6ff-4fbe3e43d142',
> > recv_spec='tcp://127.0.0.1:9994', recv_ident='')
> > })
> > main = Server(
> > uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
> > access_log="/logs/access.log",
> > error_log="/logs/error.log",
> > chroot="./",
> > pid_file="/run/mongrel2.pid",
> > default_host="mongrel2.org",
> > name="main",
> > port=6767,
> > hosts=[mongrel2]
> > )
> > ...
> > And then i loaded this config, and ...
> > [sam@sam test]$ m2sh load
> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> > default.
> > [WARN] (errno: None) No option --config given, using "mongrel2.conf" as
> the
> > default.
> >
> > it loads without errors. And when i list the servers i see this...
> > [sam@sam test]$ m2sh servers
> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> > default.
> > SERVERS:
> > ------
> > main mongrel2.org 2f62bd5-9e59-49cd-993c-3b6013c28f05
> >
> > So i go ahead it try to start mongrel2.org(obviously not defined) i get
> the
> > following error.
> > [sam@sam test]$ m2sh start -host mongrel2.org
> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> > default.
> > [INFO] MAX limits.handler_stack=102400
> > [INFO] Loaded handler 1 with send_spec=tcp://127.0.0.1:9999
> > send_ident=54c6755b-9628-40a4-9a2d-cc82a816345e
> > recv_spec=tcp://127.0.0.1:9998 recv_ident=
> > [INFO] Loaded handler 2 with send_spec=tcp://127.0.0.1:9997
> > send_ident=34f9ceee-cd52-4b7f-b197-88bf2f0ec378
> > recv_spec=tcp://127.0.0.1:9996 recv_ident=
> > [INFO] Loaded handler 3 with send_spec=tcp://127.0.0.1:9995
> > send_ident=53f9f1d1-1116-4751-b6ff-4fbe3e43d142
> > recv_spec=tcp://127.0.0.1:9994 recv_ident=
> > [INFO] Loaded proxy 1 with address=127.0.0.1 port=8888
> > [INFO] Loaded proxy 2 with address=127.0.0.1 port=8888
> > [INFO] MAX limits.dir_send_buffer=16384, limits.dir_max_path=256
> > [INFO] Loaded dir 1 with base=tests/ index=index.html
> def_ctype=text/plain
> > [INFO] Loaded dir 2 with base=examples/chat/static/ index=index.html
> > def_ctype=text/plain
> > [INFO] Loaded dir 3 with base=examples/chat/static/ index=index.html
> > def_ctype=text/plain
> > [INFO] Loaded dir 4 with base=tests/ index=index.html
> def_ctype=text/plain
> > [INFO] MAX limits.url_path=256, limits.host_name=256
> > [INFO] Created proxy route 1:/ -> 127.0.0.1:8888
> > [INFO] Created handler route 2:@chat ->
> > 54c6755b-9628-40a4-9a2d-cc82a816345e:tcp://127.0.0.1:9999
> > [INFO] Created proxy route 3:/chat/ -> 127.0.0.1:8888
> > [INFO] Created directory route 4:/tests/ -> 1:tests/
> > [INFO] Created directory route 5:/static/ -> 2:examples/chat/static/
> > [INFO] Created directory route 6:/chatdemo/ -> 3:examples/chat/static/
> > [INFO] Created handler route 7:/handlertest ->
> > 34f9ceee-cd52-4b7f-b197-88bf2f0ec378:tcp://127.0.0.1:9997
> > [INFO] Created handler route 8:/mp3stream ->
> > 53f9f1d1-1116-4751-b6ff-4fbe3e43d142:tcp://127.0.0.1:9995
> > [INFO] Created directory route 9:/testsmulti/(.*.json) -> 4:tests/
> > [INFO] Adding host 1:localhost to server at pattern localhost
> > [INFO] Loaded server 1:2f62bd5-9e59-49cd-993c-3b6013c28f05 on port 6767
> with
> > default host mongrel2.org
> > [INFO] MAX limits.mime_ext_len=128
> > [INFO] Could not force NOFILE higher, you'll need to run as root:
> Operation
> > not permitted
> > [INFO] MAX open file descriptors is 1024 now.
> > [ERROR] (errno: No such file or directory) Failed to open PID file
> > .//run/mongrel2.pid for reading.
> > [INFO] No previous Mongrel2 running, continuing on.
> > [ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as
> root
> > if this is what you want.
> > [ERROR] (errno: None) Couldn't chroot too ./, assuming running in test
> mode.
> > [ERROR] (errno: No such file or directory) Failed to open the access log:
> > /logs/access.log
> > [INFO] Starting 0MQ with 1 threads.
> > [INFO] MAX limits.header_count=1280
> > [INFO] MAX limits.content_length=20480, limits.buffer_size=4096,
> > limits.connection_stack_size=32768
> > [INFO] Starting Mongrel2/1.2-d5224c71cb. Copyright (C) Zed A. Shaw.
> Licensed
> > BSD.
> > [ERROR] (errno: None) No default_host set, you need one host named:
> > mongrel2.org
> > [ERROR] (errno: None) Server startup failed, aborting.
> >
> > and then i try to start localhost, and i end up with this...
> >
> > [sam@sam test]$ m2sh start -host localhost
> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
> > default.
> > [ERROR] (errno: No such file or directory) Operation on server failed.
> >
> > I know the errors are legitimate but, i guess there needs to be better
> > parsing mechanism of the conf file before a load. What do you think?
> > Sam
> >
> >
> > """
> > Anyday...
> > Above the ground and vertical
> > ... is a good day!
> > """
> > http://megam.info
> > :)~
> >
> >
> >
>

Re: [mongrel2] Accepts default_host of an undefined host.

From:
Boril Boyanov
Date:
2010-09-28 @ 11:18
oh ok...

On 28 September 2010 14:13, Madireddy Samuel Vijaykumar
<mad.vijay@gmail.com> wrote:
> Thanks for your inline comments.
> But my point is not clarify about the errors i have encountered but the fact
> that "m2sh load" does not seem to complete parsing of the conf file before
> it loads its into the database.
>
> Thanks again
> Sam
> """
> Anyday...
> Above the ground and vertical
> ... is a good day!
> """
> http://megam.info
> :)~
>
>
>
>
> On Tue, Sep 28, 2010 at 4:36 PM, Boril Boyanov <borko.boyanov@gmail.com>
> wrote:
>>
>> Your errors:
>>
>> >[ERROR] (errno: No such file or directory) Failed to open PID file
>> > .//run/mongrel2.pid for reading.
>> You need to create a blank pid file:
>> touch ./run/mongrel2.pid
>> sudo chown root:root ./run/mongrel2.pid
>> sudo chmod ug+rw ./run/mongrel2.pid
>>
>> >[ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as
>> > root if this is what you want.
>> Set chroot to a _full_ path like this:
>> chroot = "/var/www/mongrel2"
>>
>> >[ERROR] (errno: None) Couldn't chroot too ./, assuming running in test
>> > mode.
>> see above
>>
>> >[ERROR] (errno: No such file or directory) Failed to open the access log:
>> > /logs/access.log
>> mkdir ./logs
>>
>> >[ERROR] (errno: None) No default_host set, you need one host named:
>> > mongrel2.org
>> default_host = "yourhost" (localhost)
>> don't try to bind it to mongrel2.org :) it's Zed's domain! :)
>>
>> >[ERROR] (errno: None) Server startup failed, aborting.
>> Well failure was imminent :)
>>
>> >and then i try to start localhost, and i end up with this...
>>
>> >[sam@sam test]$ m2sh start -host localhost
>> >[WARN] (errno: None) No option --db given, using "config.sqlite" as the
>> > default.
>> >[ERROR] (errno: No such file or directory) Operation on server failed.
>> without -sudo (because it didn't worked on my Ubuntu)
>>
>> sudo m2sh load -config <your *.conf file> -db <your *.sqlite file>
>> sudo m2sh start -db <your *.sqlite> -host <your hostname: localhost>
>>
>> This should work ...
>> Take care.
>>
>> On 28 September 2010 13:46, Madireddy Samuel Vijaykumar
>> <mad.vijay@gmail.com> wrote:
>> > I changes the "name" in the Host entry to "localhost" but did not reset
>> > the
>> > default_host in the "mongrel2" of mongrel2.conf. As you can see here...
>> >
>> > ...
>> > ...
>> > mongrel2 = Host(name="localhost", routes={
>> > '@chat': chat_demo,
>> > '/handlertest': handler_test,
>> > '/chat/': web_app_proxy,
>> > '/': web_app_proxy,
>> > '/tests/': test_directory,
>> > '/testsmulti/(.*.json)': test_directory,
>> > '/chatdemo/': chat_demo_dir,
>> > '/static/': chat_demo_dir,
>> > '/mp3stream': Handler(
>> > send_spec='tcp://127.0.0.1:9995',
>> > send_ident='53f9f1d1-1116-4751-b6ff-4fbe3e43d142',
>> > recv_spec='tcp://127.0.0.1:9994', recv_ident='')
>> > })
>> > main = Server(
>> > uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
>> > access_log="/logs/access.log",
>> > error_log="/logs/error.log",
>> > chroot="./",
>> > pid_file="/run/mongrel2.pid",
>> > default_host="mongrel2.org",
>> > name="main",
>> > port=6767,
>> > hosts=[mongrel2]
>> > )
>> > ...
>> > And then i loaded this config, and ...
>> > [sam@sam test]$ m2sh load
>> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
>> > default.
>> > [WARN] (errno: None) No option --config given, using "mongrel2.conf" as
>> > the
>> > default.
>> >
>> > it loads without errors. And when i list the servers i see this...
>> > [sam@sam test]$ m2sh servers
>> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
>> > default.
>> > SERVERS:
>> > ------
>> > main mongrel2.org 2f62bd5-9e59-49cd-993c-3b6013c28f05
>> >
>> > So i go ahead it try to start mongrel2.org(obviously not defined) i get
>> > the
>> > following error.
>> > [sam@sam test]$ m2sh start -host mongrel2.org
>> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
>> > default.
>> > [INFO] MAX limits.handler_stack=102400
>> > [INFO] Loaded handler 1 with send_spec=tcp://127.0.0.1:9999
>> > send_ident=54c6755b-9628-40a4-9a2d-cc82a816345e
>> > recv_spec=tcp://127.0.0.1:9998 recv_ident=
>> > [INFO] Loaded handler 2 with send_spec=tcp://127.0.0.1:9997
>> > send_ident=34f9ceee-cd52-4b7f-b197-88bf2f0ec378
>> > recv_spec=tcp://127.0.0.1:9996 recv_ident=
>> > [INFO] Loaded handler 3 with send_spec=tcp://127.0.0.1:9995
>> > send_ident=53f9f1d1-1116-4751-b6ff-4fbe3e43d142
>> > recv_spec=tcp://127.0.0.1:9994 recv_ident=
>> > [INFO] Loaded proxy 1 with address=127.0.0.1 port=8888
>> > [INFO] Loaded proxy 2 with address=127.0.0.1 port=8888
>> > [INFO] MAX limits.dir_send_buffer=16384, limits.dir_max_path=256
>> > [INFO] Loaded dir 1 with base=tests/ index=index.html
>> > def_ctype=text/plain
>> > [INFO] Loaded dir 2 with base=examples/chat/static/ index=index.html
>> > def_ctype=text/plain
>> > [INFO] Loaded dir 3 with base=examples/chat/static/ index=index.html
>> > def_ctype=text/plain
>> > [INFO] Loaded dir 4 with base=tests/ index=index.html
>> > def_ctype=text/plain
>> > [INFO] MAX limits.url_path=256, limits.host_name=256
>> > [INFO] Created proxy route 1:/ -> 127.0.0.1:8888
>> > [INFO] Created handler route 2:@chat ->
>> > 54c6755b-9628-40a4-9a2d-cc82a816345e:tcp://127.0.0.1:9999
>> > [INFO] Created proxy route 3:/chat/ -> 127.0.0.1:8888
>> > [INFO] Created directory route 4:/tests/ -> 1:tests/
>> > [INFO] Created directory route 5:/static/ -> 2:examples/chat/static/
>> > [INFO] Created directory route 6:/chatdemo/ -> 3:examples/chat/static/
>> > [INFO] Created handler route 7:/handlertest ->
>> > 34f9ceee-cd52-4b7f-b197-88bf2f0ec378:tcp://127.0.0.1:9997
>> > [INFO] Created handler route 8:/mp3stream ->
>> > 53f9f1d1-1116-4751-b6ff-4fbe3e43d142:tcp://127.0.0.1:9995
>> > [INFO] Created directory route 9:/testsmulti/(.*.json) -> 4:tests/
>> > [INFO] Adding host 1:localhost to server at pattern localhost
>> > [INFO] Loaded server 1:2f62bd5-9e59-49cd-993c-3b6013c28f05 on port 6767
>> > with
>> > default host mongrel2.org
>> > [INFO] MAX limits.mime_ext_len=128
>> > [INFO] Could not force NOFILE higher, you'll need to run as root:
>> > Operation
>> > not permitted
>> > [INFO] MAX open file descriptors is 1024 now.
>> > [ERROR] (errno: No such file or directory) Failed to open PID file
>> > .//run/mongrel2.pid for reading.
>> > [INFO] No previous Mongrel2 running, continuing on.
>> > [ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as
>> > root
>> > if this is what you want.
>> > [ERROR] (errno: None) Couldn't chroot too ./, assuming running in test
>> > mode.
>> > [ERROR] (errno: No such file or directory) Failed to open the access
>> > log:
>> > /logs/access.log
>> > [INFO] Starting 0MQ with 1 threads.
>> > [INFO] MAX limits.header_count=1280
>> > [INFO] MAX limits.content_length=20480, limits.buffer_size=4096,
>> > limits.connection_stack_size=32768
>> > [INFO] Starting Mongrel2/1.2-d5224c71cb. Copyright (C) Zed A. Shaw.
>> > Licensed
>> > BSD.
>> > [ERROR] (errno: None) No default_host set, you need one host named:
>> > mongrel2.org
>> > [ERROR] (errno: None) Server startup failed, aborting.
>> >
>> > and then i try to start localhost, and i end up with this...
>> >
>> > [sam@sam test]$ m2sh start -host localhost
>> > [WARN] (errno: None) No option --db given, using "config.sqlite" as the
>> > default.
>> > [ERROR] (errno: No such file or directory) Operation on server failed.
>> >
>> > I know the errors are legitimate but, i guess there needs to be better
>> > parsing mechanism of the conf file before a load. What do you think?
>> > Sam
>> >
>> >
>> > """
>> > Anyday...
>> > Above the ground and vertical
>> > ... is a good day!
>> > """
>> > http://megam.info
>> > :)~
>> >
>> >
>> >
>
>

Re: [mongrel2] Accepts default_host of an undefined host.

From:
joshua simmons
Date:
2010-09-28 @ 11:44
Yeah it doesn't, well, it completely parses the config but does not validate
everything. I don't know if this is something that would really work well in
practice since there's a lot of possibilities and you'll just end up copying
all the logic in mongrel2.

That said basic stuff like checking that there's a matching host for
default_host.

On Tue, Sep 28, 2010 at 9:18 PM, Boril Boyanov <borko.boyanov@gmail.com>wrote:

> oh ok...
>
> On 28 September 2010 14:13, Madireddy Samuel Vijaykumar
> <mad.vijay@gmail.com> wrote:
> > Thanks for your inline comments.
> > But my point is not clarify about the errors i have encountered but the
> fact
> > that "m2sh load" does not seem to complete parsing of the conf file
> before
> > it loads its into the database.
> >
> > Thanks again
> > Sam
> > """
> > Anyday...
> > Above the ground and vertical
> > ... is a good day!
> > """
> > http://megam.info
> > :)~
> >
> >
> >
> >
> > On Tue, Sep 28, 2010 at 4:36 PM, Boril Boyanov <borko.boyanov@gmail.com>
> > wrote:
> >>
> >> Your errors:
> >>
> >> >[ERROR] (errno: No such file or directory) Failed to open PID file
> >> > .//run/mongrel2.pid for reading.
> >> You need to create a blank pid file:
> >> touch ./run/mongrel2.pid
> >> sudo chown root:root ./run/mongrel2.pid
> >> sudo chmod ug+rw ./run/mongrel2.pid
> >>
> >> >[ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as
> >> > root if this is what you want.
> >> Set chroot to a _full_ path like this:
> >> chroot = "/var/www/mongrel2"
> >>
> >> >[ERROR] (errno: None) Couldn't chroot too ./, assuming running in test
> >> > mode.
> >> see above
> >>
> >> >[ERROR] (errno: No such file or directory) Failed to open the access
> log:
> >> > /logs/access.log
> >> mkdir ./logs
> >>
> >> >[ERROR] (errno: None) No default_host set, you need one host named:
> >> > mongrel2.org
> >> default_host = "yourhost" (localhost)
> >> don't try to bind it to mongrel2.org :) it's Zed's domain! :)
> >>
> >> >[ERROR] (errno: None) Server startup failed, aborting.
> >> Well failure was imminent :)
> >>
> >> >and then i try to start localhost, and i end up with this...
> >>
> >> >[sam@sam test]$ m2sh start -host localhost
> >> >[WARN] (errno: None) No option --db given, using "config.sqlite" as the
> >> > default.
> >> >[ERROR] (errno: No such file or directory) Operation on server failed.
> >> without -sudo (because it didn't worked on my Ubuntu)
> >>
> >> sudo m2sh load -config <your *.conf file> -db <your *.sqlite file>
> >> sudo m2sh start -db <your *.sqlite> -host <your hostname: localhost>
> >>
> >> This should work ...
> >> Take care.
> >>
> >> On 28 September 2010 13:46, Madireddy Samuel Vijaykumar
> >> <mad.vijay@gmail.com> wrote:
> >> > I changes the "name" in the Host entry to "localhost" but did not
> reset
> >> > the
> >> > default_host in the "mongrel2" of mongrel2.conf. As you can see
> here...
> >> >
> >> > ...
> >> > ...
> >> > mongrel2 = Host(name="localhost", routes={
> >> > '@chat': chat_demo,
> >> > '/handlertest': handler_test,
> >> > '/chat/': web_app_proxy,
> >> > '/': web_app_proxy,
> >> > '/tests/': test_directory,
> >> > '/testsmulti/(.*.json)': test_directory,
> >> > '/chatdemo/': chat_demo_dir,
> >> > '/static/': chat_demo_dir,
> >> > '/mp3stream': Handler(
> >> > send_spec='tcp://127.0.0.1:9995',
> >> > send_ident='53f9f1d1-1116-4751-b6ff-4fbe3e43d142',
> >> > recv_spec='tcp://127.0.0.1:9994', recv_ident='')
> >> > })
> >> > main = Server(
> >> > uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
> >> > access_log="/logs/access.log",
> >> > error_log="/logs/error.log",
> >> > chroot="./",
> >> > pid_file="/run/mongrel2.pid",
> >> > default_host="mongrel2.org",
> >> > name="main",
> >> > port=6767,
> >> > hosts=[mongrel2]
> >> > )
> >> > ...
> >> > And then i loaded this config, and ...
> >> > [sam@sam test]$ m2sh load
> >> > [WARN] (errno: None) No option --db given, using "config.sqlite" as
> the
> >> > default.
> >> > [WARN] (errno: None) No option --config given, using "mongrel2.conf"
> as
> >> > the
> >> > default.
> >> >
> >> > it loads without errors. And when i list the servers i see this...
> >> > [sam@sam test]$ m2sh servers
> >> > [WARN] (errno: None) No option --db given, using "config.sqlite" as
> the
> >> > default.
> >> > SERVERS:
> >> > ------
> >> > main mongrel2.org 2f62bd5-9e59-49cd-993c-3b6013c28f05
> >> >
> >> > So i go ahead it try to start mongrel2.org(obviously not defined) i
> get
> >> > the
> >> > following error.
> >> > [sam@sam test]$ m2sh start -host mongrel2.org
> >> > [WARN] (errno: None) No option --db given, using "config.sqlite" as
> the
> >> > default.
> >> > [INFO] MAX limits.handler_stack=102400
> >> > [INFO] Loaded handler 1 with send_spec=tcp://127.0.0.1:9999
> >> > send_ident=54c6755b-9628-40a4-9a2d-cc82a816345e
> >> > recv_spec=tcp://127.0.0.1:9998 recv_ident=
> >> > [INFO] Loaded handler 2 with send_spec=tcp://127.0.0.1:9997
> >> > send_ident=34f9ceee-cd52-4b7f-b197-88bf2f0ec378
> >> > recv_spec=tcp://127.0.0.1:9996 recv_ident=
> >> > [INFO] Loaded handler 3 with send_spec=tcp://127.0.0.1:9995
> >> > send_ident=53f9f1d1-1116-4751-b6ff-4fbe3e43d142
> >> > recv_spec=tcp://127.0.0.1:9994 recv_ident=
> >> > [INFO] Loaded proxy 1 with address=127.0.0.1 port=8888
> >> > [INFO] Loaded proxy 2 with address=127.0.0.1 port=8888
> >> > [INFO] MAX limits.dir_send_buffer=16384, limits.dir_max_path=256
> >> > [INFO] Loaded dir 1 with base=tests/ index=index.html
> >> > def_ctype=text/plain
> >> > [INFO] Loaded dir 2 with base=examples/chat/static/ index=index.html
> >> > def_ctype=text/plain
> >> > [INFO] Loaded dir 3 with base=examples/chat/static/ index=index.html
> >> > def_ctype=text/plain
> >> > [INFO] Loaded dir 4 with base=tests/ index=index.html
> >> > def_ctype=text/plain
> >> > [INFO] MAX limits.url_path=256, limits.host_name=256
> >> > [INFO] Created proxy route 1:/ -> 127.0.0.1:8888
> >> > [INFO] Created handler route 2:@chat ->
> >> > 54c6755b-9628-40a4-9a2d-cc82a816345e:tcp://127.0.0.1:9999
> >> > [INFO] Created proxy route 3:/chat/ -> 127.0.0.1:8888
> >> > [INFO] Created directory route 4:/tests/ -> 1:tests/
> >> > [INFO] Created directory route 5:/static/ -> 2:examples/chat/static/
> >> > [INFO] Created directory route 6:/chatdemo/ -> 3:examples/chat/static/
> >> > [INFO] Created handler route 7:/handlertest ->
> >> > 34f9ceee-cd52-4b7f-b197-88bf2f0ec378:tcp://127.0.0.1:9997
> >> > [INFO] Created handler route 8:/mp3stream ->
> >> > 53f9f1d1-1116-4751-b6ff-4fbe3e43d142:tcp://127.0.0.1:9995
> >> > [INFO] Created directory route 9:/testsmulti/(.*.json) -> 4:tests/
> >> > [INFO] Adding host 1:localhost to server at pattern localhost
> >> > [INFO] Loaded server 1:2f62bd5-9e59-49cd-993c-3b6013c28f05 on port
> 6767
> >> > with
> >> > default host mongrel2.org
> >> > [INFO] MAX limits.mime_ext_len=128
> >> > [INFO] Could not force NOFILE higher, you'll need to run as root:
> >> > Operation
> >> > not permitted
> >> > [INFO] MAX open file descriptors is 1024 now.
> >> > [ERROR] (errno: No such file or directory) Failed to open PID file
> >> > .//run/mongrel2.pid for reading.
> >> > [INFO] No previous Mongrel2 running, continuing on.
> >> > [ERROR] (errno: Operation not permitted) Can't chroot to ./, rerun as
> >> > root
> >> > if this is what you want.
> >> > [ERROR] (errno: None) Couldn't chroot too ./, assuming running in test
> >> > mode.
> >> > [ERROR] (errno: No such file or directory) Failed to open the access
> >> > log:
> >> > /logs/access.log
> >> > [INFO] Starting 0MQ with 1 threads.
> >> > [INFO] MAX limits.header_count=1280
> >> > [INFO] MAX limits.content_length=20480, limits.buffer_size=4096,
> >> > limits.connection_stack_size=32768
> >> > [INFO] Starting Mongrel2/1.2-d5224c71cb. Copyright (C) Zed A. Shaw.
> >> > Licensed
> >> > BSD.
> >> > [ERROR] (errno: None) No default_host set, you need one host named:
> >> > mongrel2.org
> >> > [ERROR] (errno: None) Server startup failed, aborting.
> >> >
> >> > and then i try to start localhost, and i end up with this...
> >> >
> >> > [sam@sam test]$ m2sh start -host localhost
> >> > [WARN] (errno: None) No option --db given, using "config.sqlite" as
> the
> >> > default.
> >> > [ERROR] (errno: No such file or directory) Operation on server failed.
> >> >
> >> > I know the errors are legitimate but, i guess there needs to be better
> >> > parsing mechanism of the conf file before a load. What do you think?
> >> > Sam
> >> >
> >> >
> >> > """
> >> > Anyday...
> >> > Above the ground and vertical
> >> > ... is a good day!
> >> > """
> >> > http://megam.info
> >> > :)~
> >> >
> >> >
> >> >
> >
> >
>