Link to home
Start Free TrialLog in
Avatar of indianbill007
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.JobClient.getUGI(JobClient.java:717)
        at org.apache.hadoop.mapred.JobClient.configureCommandLineOptions(JobClient.java:592)
        at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:788)
        at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1142)
        at org.apache.nutch.crawl.Injector.inject(Injector.java:160)
        at org.apache.nutch.crawl.Crawl.main(Crawl.java:113)
Caused by: javax.security.auth.login.LoginException: Login failed: Cannot run program "whoami": java.io.IOException: error=12, Cannot allocate memory
        at org.apache.hadoop.security.UnixUserGroupInformation.login(UnixUserGroupInformation.java:250)
        at org.apache.hadoop.security.UnixUserGroupInformation.login(UnixUserGroupInformation.java:275)
        at org.apache.hadoop.mapred.JobClient.getUGI(JobClient.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?
Avatar of jar3817
jar3817

"Caused by: javax.security.auth.login.LoginException: Login failed: Cannot run program "whoami":"

That's your problem. Do you have the whoami utility on your machine? Is it in $PATH?
Avatar of indianbill007

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.
I have tested it,It is replying 'root' as user.
Avatar of woolmilkporc

I think you will have to allow memory overcommitment -
echo 2 > /proc/sys/vm/overcommit_memory
and maybe
echo 80 > /proc/sys/vm/overcommit_ratio

Look here for an explanation -

http://www.win.tue.nl/~aeb/linux/lk/lk-9.html 
wmp

I have checked this,but after this command ,
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...
Well,
it might also be related to user limits.
Did you check ulimit -a ?
(I know it's root, but who knows?)
 
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
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.
what user is this program/java server running as?
I have tried this but there is no other output other than the exception.
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
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-authlib/aut
root      9797  9785  0 Jan09 ?        00:00:00 /usr/libexec/courier-authlib/aut
root      9798  9785  0 Jan09 ?        00:00:00 /usr/libexec/courier-authlib/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/libexec/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/libexec/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/libexec/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/libexec/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/httpd -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/httpd -DSS
nobody   18173 10091  0 08:52 ?        00:00:00 /usr/local/apache/bin/httpd -DSS
nobody   18174 10091  0 08:52 ?        00:00:03 /usr/local/apache/bin/httpd -DSS
nobody   18175 10091  0 08:52 ?        00:00:01 /usr/local/apache/bin/httpd -DSS
nobody   18176 10091  0 08:52 ?        00:00:02 /usr/local/apache/bin/httpd -DSS
nobody   19775 10091  0 08:53 ?        00:00:00 /usr/local/apache/bin/httpd -DSS
nobody   23553     1  0 Jan11 ?        00:00:44 httpds
nobody   23938 10091  0 08:55 ?        00:00:00 /usr/local/apache/bin/httpd -DSS
nobody   23941 10091  0 08:55 ?        00:00:00 /usr/local/apache/bin/httpd -DSS
nobody   23951 10091  0 08:55 ?        00:00:01 /usr/local/apache/bin/httpd -DSS
nobody   23974 10091  0 08:55 ?        00:00:02 /usr/local/apache/bin/httpd -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
ok, that possibility can be ruled out.
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_memory  
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
 
I have tried this but it still not running,
Are you giving me any another solution?
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have found lot of knowledge from this.