indianbill007
asked on
How can i slove whoami exception on linux?
I am trying to run nutch on linux using ssh,I have logged in as root user.
I have setted all the environment variable and nutch file setting.
I have created a url.txt file which content the url to crawl, When i am trying to run nutch using following command,
bin/nutch crawl urls -dir crawlresult
it generates following exception.
crawl started in: crawlresult
rootUrlDir = urls
threads = 10
depth = 5
Injector: starting
Injector: crawlDb: crawlresult/crawldb
Injector: urlDir: urls
Injector: Converting injected urls to crawl db entries.
Exception in thread "main" java.io.IOException: Failed to get the current user's information.
at org.apache.hadoop.mapred.J obClient.g etUGI(JobC lient.java :717)
at org.apache.hadoop.mapred.J obClient.c onfigureCo mmandLineO ptions(Job Client.jav a:592)
at org.apache.hadoop.mapred.J obClient.s ubmitJob(J obClient.j ava:788)
at org.apache.hadoop.mapred.J obClient.r unJob(JobC lient.java :1142)
at org.apache.nutch.crawl.Inj ector.inje ct(Injecto r.java:160 )
at org.apache.nutch.crawl.Cra wl.main(Cr awl.java:1 13)
Caused by: javax.security.auth.login. LoginExcep tion: Login failed: Cannot run program "whoami": java.io.IOException: error=12, Cannot allocate memory
at org.apache.hadoop.security .UnixUserG roupInform ation.logi n(UnixUser GroupInfor mation.jav a:250)
at org.apache.hadoop.security .UnixUserG roupInform ation.logi n(UnixUser GroupInfor mation.jav a:275)
at org.apache.hadoop.mapred.J obClient.g etUGI(JobC lient.java :715)
... 5 more
Is it problem of Memory or of User Authentication?
In the first line it is giving the exception that
Exception in thread "main" java.io.IOException: Failed to get the current user's information.
but after that it,says "Cannot run program "whoami": java.io.IOException: error=12, Cannot allocate memory"
Server has enough memory space .The statics of memory on the server is as follows:
total used free
Mem: 524320 252000 272320
-/+ buffers/cache: 252000 272320
Swap: 2475680 0 2475680
Total: 3000000 252000 2748000
I am not able to get the reason of this.
Please Some body help me?
I have setted all the environment variable and nutch file setting.
I have created a url.txt file which content the url to crawl, When i am trying to run nutch using following command,
bin/nutch crawl urls -dir crawlresult
it generates following exception.
crawl started in: crawlresult
rootUrlDir = urls
threads = 10
depth = 5
Injector: starting
Injector: crawlDb: crawlresult/crawldb
Injector: urlDir: urls
Injector: Converting injected urls to crawl db entries.
Exception in thread "main" java.io.IOException: Failed to get the current user's information.
at org.apache.hadoop.mapred.J
at org.apache.hadoop.mapred.J
at org.apache.hadoop.mapred.J
at org.apache.hadoop.mapred.J
at org.apache.nutch.crawl.Inj
at org.apache.nutch.crawl.Cra
Caused by: javax.security.auth.login.
at org.apache.hadoop.security
at org.apache.hadoop.security
at org.apache.hadoop.mapred.J
... 5 more
Is it problem of Memory or of User Authentication?
In the first line it is giving the exception that
Exception in thread "main" java.io.IOException: Failed to get the current user's information.
but after that it,says "Cannot run program "whoami": java.io.IOException: error=12, Cannot allocate memory"
Server has enough memory space .The statics of memory on the server is as follows:
total used free
Mem: 524320 252000 272320
-/+ buffers/cache: 252000 272320
Swap: 2475680 0 2475680
Total: 3000000 252000 2748000
I am not able to get the reason of this.
Please Some body help me?
ASKER
How can i check for whoami utility?, I am newer with linux.
Type "whoami" in a console, see if it spits out your username. If it says something like "command not found" then you don't have it, and I'm guessing that nutch requires it.
ASKER
I have tested it,It is replying 'root' as user.
I think you will have to allow memory overcommitment -
echo 2 > /proc/sys/vm/overcommit_me
and maybe
echo 80 > /proc/sys/vm/overcommit_ra
Look here for an explanation -
http://www.win.tue.nl/~aeb/linux/lk/lk-9.html
wmp
ASKER
I have checked this,but after this command ,
it is generating same exception as i have mention on the top.
it is generating same exception as i have mention on the top.
what's this app running as ? I mean which user?
Probably that user might have shell disabled and could be the issue.(not sure about this though)
check /etc/passwd and verify that the user has a proper shel etc...
Probably that user might have shell disabled and could be the issue.(not sure about this though)
check /etc/passwd and verify that the user has a proper shel etc...
Well,
it might also be related to user limits.
Did you check ulimit -a ?
(I know it's root, but who knows?)
it might also be related to user limits.
Did you check ulimit -a ?
(I know it's root, but who knows?)
ASKER
Output of ulimit -a is as follows:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 50176
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 50176
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 50176
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 50176
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
OK, looks good.
Next you could try to reduce the heapsize (in variable NUTCH_HEAPSIZE , I can't recommend any value, however),
and you could try to reduce Java's max. memory ( -Xmx parameter in variable JAVA_OPTS).
-Xmx defaults to 400m, afaik. Try to lower it piece by piece and see what happens.
Next you could try to reduce the heapsize (in variable NUTCH_HEAPSIZE , I can't recommend any value, however),
and you could try to reduce Java's max. memory ( -Xmx parameter in variable JAVA_OPTS).
-Xmx defaults to 400m, afaik. Try to lower it piece by piece and see what happens.
what user is this program/java server running as?
ASKER
I have tried this but there is no other output other than the exception.
ASKER
i have logged in as a root user at server.
that needn't mean your app is running as root.
it could be a different user.
do a ps -ef when the app is running
it could be a different user.
do a ps -ef when the app is running
ASKER
output of the command is as follows:
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Jan09 ? 00:00:00 init [3]
root 9443 1 0 Jan09 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --d
mysql 9478 9443 0 Jan09 ? 00:07:03 /usr/sbin/mysqld --basedir=/ --d
root 9762 1 0 Jan09 ? 00:00:02 syslogd -m 0
root 9767 1 0 Jan09 ? 00:00:00 klogd -2
root 9784 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9785 9784 0 Jan09 ? 00:00:00 /usr/libexec/courier-authl ib/aut
root 9797 9785 0 Jan09 ? 00:00:00 /usr/libexec/courier-authl ib/aut
root 9798 9785 0 Jan09 ? 00:00:00 /usr/libexec/courier-authl ib/aut
root 9801 1 0 Jan09 ? 00:00:00 /usr/local/sbin/openvpn --daemon
named 9857 1 0 Jan09 ? 00:00:51 /usr/sbin/named -u named
root 9876 1 0 Jan09 ? 00:00:02 /usr/sbin/sshd
root 9893 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9894 9893 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe xec/co
root 9900 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9901 9900 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe xec/co
root 9906 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9907 9906 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe xec/co
root 9912 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9913 9912 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe xec/co
mailnull 9994 1 0 Jan09 ? 00:00:00 /usr/sbin/exim -bd -oX 2525
mailnull 10001 1 0 Jan09 ? 00:00:02 /usr/sbin/exim -bd -q60m
mailnull 10010 1 0 Jan09 ? 00:00:00 /usr/sbin/exim -tls-on-connect -
root 10037 1 0 Jan09 ? 00:00:00 /usr/local/bin/svnserve -d -r /s
root 10091 1 0 Jan09 ? 00:00:04 /usr/local/apache/bin/http d -DSS
root 10120 1 0 Jan09 ? 00:00:03 crond
xfs 10151 1 0 Jan09 ? 00:00:00 xfs -droppriv -daemon
root 11356 9797 0 Jan09 ? 00:00:01 /etc/authlib/authProg
dbus 11501 1 0 Jan09 ? 00:00:00 dbus-daemon-1 --system
root 11525 1 0 Jan09 ? 00:00:19 python /usr/bin/denyhosts.py --d
root 11558 1 0 Jan09 ? 00:00:00 /usr/sbin/portsentry -tcp
root 11583 1 0 Jan09 ? 00:00:00 /usr/bin/perl /usr/libexec/webmi
root 13766 1 0 Jan11 ? 00:00:00 pure-ftpd (SERVER)
root 13769 1 0 Jan11 ? 00:00:00 /usr/sbin/pure-authd -s /var/run
root 15875 9876 0 09:27 ? 00:00:00 sshd: root@pts/0
root 15962 15875 0 09:27 ? 00:00:00 login -- root
root 15973 15962 0 09:27 pts/0 00:00:00 -bash
nobody 18172 10091 0 08:52 ? 00:00:00 /usr/local/apache/bin/http d -DSS
nobody 18173 10091 0 08:52 ? 00:00:00 /usr/local/apache/bin/http d -DSS
nobody 18174 10091 0 08:52 ? 00:00:03 /usr/local/apache/bin/http d -DSS
nobody 18175 10091 0 08:52 ? 00:00:01 /usr/local/apache/bin/http d -DSS
nobody 18176 10091 0 08:52 ? 00:00:02 /usr/local/apache/bin/http d -DSS
nobody 19775 10091 0 08:53 ? 00:00:00 /usr/local/apache/bin/http d -DSS
nobody 23553 1 0 Jan11 ? 00:00:44 httpds
nobody 23938 10091 0 08:55 ? 00:00:00 /usr/local/apache/bin/http d -DSS
nobody 23941 10091 0 08:55 ? 00:00:00 /usr/local/apache/bin/http d -DSS
nobody 23951 10091 0 08:55 ? 00:00:01 /usr/local/apache/bin/http d -DSS
nobody 23974 10091 0 08:55 ? 00:00:02 /usr/local/apache/bin/http d -DSS
root 26387 1 0 Jan11 ? 00:00:04 tailwatchd
mailman 26413 1 0 Jan11 ? 00:00:00 /usr/local/bin/python2.4 /usr/lo
root 26422 1 0 Jan11 ? 00:00:00 cPhulkd - processor
mailman 26424 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26425 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26426 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26429 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26430 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26433 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26434 26413 0 Jan11 ? 00:00:02 /usr/local/bin/python2.4 /usr/lo
mailman 26435 26413 0 Jan11 ? 00:00:00 /usr/local/bin/python2.4 /usr/lo
root 26465 1 0 Jan11 ? 00:00:00 cpdavd - accepting connections o
root 26469 1 0 Jan11 ? 00:00:09 queueprocd - wait to process a t
root 26490 1 0 Jan11 ? 00:00:00 cpanellogd - sleeping for logs
root 26557 1 0 Jan11 ? 00:00:00 cpsrvd - waiting for connections
root 27774 15973 0 09:34 pts/0 00:00:00 ps -ef
root 28557 9798 0 Jan09 ? 00:00:01 /etc/authlib/authProg
root 32208 1 0 Jan09 ? 00:02:00 /usr/local/jdk/bin/java -Djava.u
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Jan09 ? 00:00:00 init [3]
root 9443 1 0 Jan09 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --d
mysql 9478 9443 0 Jan09 ? 00:07:03 /usr/sbin/mysqld --basedir=/ --d
root 9762 1 0 Jan09 ? 00:00:02 syslogd -m 0
root 9767 1 0 Jan09 ? 00:00:00 klogd -2
root 9784 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9785 9784 0 Jan09 ? 00:00:00 /usr/libexec/courier-authl
root 9797 9785 0 Jan09 ? 00:00:00 /usr/libexec/courier-authl
root 9798 9785 0 Jan09 ? 00:00:00 /usr/libexec/courier-authl
root 9801 1 0 Jan09 ? 00:00:00 /usr/local/sbin/openvpn --daemon
named 9857 1 0 Jan09 ? 00:00:51 /usr/sbin/named -u named
root 9876 1 0 Jan09 ? 00:00:02 /usr/sbin/sshd
root 9893 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9894 9893 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe
root 9900 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9901 9900 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe
root 9906 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9907 9906 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe
root 9912 1 0 Jan09 ? 00:00:00 /usr/sbin/courierlogger -pid=/va
root 9913 9912 0 Jan09 ? 00:00:00 /usr/lib/courier-imap/libe
mailnull 9994 1 0 Jan09 ? 00:00:00 /usr/sbin/exim -bd -oX 2525
mailnull 10001 1 0 Jan09 ? 00:00:02 /usr/sbin/exim -bd -q60m
mailnull 10010 1 0 Jan09 ? 00:00:00 /usr/sbin/exim -tls-on-connect -
root 10037 1 0 Jan09 ? 00:00:00 /usr/local/bin/svnserve -d -r /s
root 10091 1 0 Jan09 ? 00:00:04 /usr/local/apache/bin/http
root 10120 1 0 Jan09 ? 00:00:03 crond
xfs 10151 1 0 Jan09 ? 00:00:00 xfs -droppriv -daemon
root 11356 9797 0 Jan09 ? 00:00:01 /etc/authlib/authProg
dbus 11501 1 0 Jan09 ? 00:00:00 dbus-daemon-1 --system
root 11525 1 0 Jan09 ? 00:00:19 python /usr/bin/denyhosts.py --d
root 11558 1 0 Jan09 ? 00:00:00 /usr/sbin/portsentry -tcp
root 11583 1 0 Jan09 ? 00:00:00 /usr/bin/perl /usr/libexec/webmi
root 13766 1 0 Jan11 ? 00:00:00 pure-ftpd (SERVER)
root 13769 1 0 Jan11 ? 00:00:00 /usr/sbin/pure-authd -s /var/run
root 15875 9876 0 09:27 ? 00:00:00 sshd: root@pts/0
root 15962 15875 0 09:27 ? 00:00:00 login -- root
root 15973 15962 0 09:27 pts/0 00:00:00 -bash
nobody 18172 10091 0 08:52 ? 00:00:00 /usr/local/apache/bin/http
nobody 18173 10091 0 08:52 ? 00:00:00 /usr/local/apache/bin/http
nobody 18174 10091 0 08:52 ? 00:00:03 /usr/local/apache/bin/http
nobody 18175 10091 0 08:52 ? 00:00:01 /usr/local/apache/bin/http
nobody 18176 10091 0 08:52 ? 00:00:02 /usr/local/apache/bin/http
nobody 19775 10091 0 08:53 ? 00:00:00 /usr/local/apache/bin/http
nobody 23553 1 0 Jan11 ? 00:00:44 httpds
nobody 23938 10091 0 08:55 ? 00:00:00 /usr/local/apache/bin/http
nobody 23941 10091 0 08:55 ? 00:00:00 /usr/local/apache/bin/http
nobody 23951 10091 0 08:55 ? 00:00:01 /usr/local/apache/bin/http
nobody 23974 10091 0 08:55 ? 00:00:02 /usr/local/apache/bin/http
root 26387 1 0 Jan11 ? 00:00:04 tailwatchd
mailman 26413 1 0 Jan11 ? 00:00:00 /usr/local/bin/python2.4 /usr/lo
root 26422 1 0 Jan11 ? 00:00:00 cPhulkd - processor
mailman 26424 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26425 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26426 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26429 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26430 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26433 26413 0 Jan11 ? 00:00:01 /usr/local/bin/python2.4 /usr/lo
mailman 26434 26413 0 Jan11 ? 00:00:02 /usr/local/bin/python2.4 /usr/lo
mailman 26435 26413 0 Jan11 ? 00:00:00 /usr/local/bin/python2.4 /usr/lo
root 26465 1 0 Jan11 ? 00:00:00 cpdavd - accepting connections o
root 26469 1 0 Jan11 ? 00:00:09 queueprocd - wait to process a t
root 26490 1 0 Jan11 ? 00:00:00 cpanellogd - sleeping for logs
root 26557 1 0 Jan11 ? 00:00:00 cpsrvd - waiting for connections
root 27774 15973 0 09:34 pts/0 00:00:00 ps -ef
root 28557 9798 0 Jan09 ? 00:00:01 /etc/authlib/authProg
root 32208 1 0 Jan09 ? 00:02:00 /usr/local/jdk/bin/java -Djava.u
ok, that possibility can be ruled out.
ASKER
Can you please tell me what i have to do to run nutch? I have tried every thing .
Well,
you could try
echo 1 > /proc/sys/vm/overcommit_me mory
so that a malloc() will always succeed.
On the other hand I'm a bit astonished that manipulating -Xmx should have no effect at all. What values did you try? I'd suggest trying a real low value, such as 64 MB, to see what will happen (and to see whether we're changing at the right place).
wmp
you could try
echo 1 > /proc/sys/vm/overcommit_me
so that a malloc() will always succeed.
On the other hand I'm a bit astonished that manipulating -Xmx should have no effect at all. What values did you try? I'd suggest trying a real low value, such as 64 MB, to see what will happen (and to see whether we're changing at the right place).
wmp
ASKER
I have tried this but it still not running,
ASKER
Are you giving me any another solution?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have found lot of knowledge from this.
That's your problem. Do you have the whoami utility on your machine? Is it in $PATH?