?
Solved

How can i slove whoami exception on linux?

Posted on 2010-01-11
22
Medium Priority
?
736 Views
Last Modified: 2012-05-08
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?
0
Comment
Question by:indianbill007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 5
  • 4
  • +1
22 Comments
 
LVL 26

Expert Comment

by:jar3817
ID: 26282427
"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?
0
 

Author Comment

by:indianbill007
ID: 26282433
How can i check for whoami utility?, I am newer with  linux.
0
 
LVL 26

Expert Comment

by:jar3817
ID: 26282484
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.
0
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

Author Comment

by:indianbill007
ID: 26282516
I have tested it,It is replying 'root' as user.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 26282651

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

0
 

Author Comment

by:indianbill007
ID: 26282965
I have checked this,but after this command ,
it is generating same exception as i have mention on the top.
0
 
LVL 10

Expert Comment

by:nabeelmoidu
ID: 26283228
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...
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 26283296
Well,
it might also be related to user limits.
Did you check ulimit -a ?
(I know it's root, but who knows?)
 
0
 

Author Comment

by:indianbill007
ID: 26283375
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
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 26283696
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.
0
 
LVL 10

Expert Comment

by:nabeelmoidu
ID: 26283983
what user is this program/java server running as?
0
 

Author Comment

by:indianbill007
ID: 26284026
I have tried this but there is no other output other than the exception.
0
 

Author Comment

by:indianbill007
ID: 26291036
i have logged in as a root user at server.
0
 
LVL 10

Expert Comment

by:nabeelmoidu
ID: 26291169
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
0
 

Author Comment

by:indianbill007
ID: 26305505
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
0
 
LVL 10

Expert Comment

by:nabeelmoidu
ID: 26307477
ok, that possibility can be ruled out.
0
 

Author Comment

by:indianbill007
ID: 26311616
Can you please tell me what i have to do to run nutch? I have tried every thing .
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 26311849
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
 
0
 

Author Comment

by:indianbill007
ID: 26313230
I have tried this but it still not running,
0
 

Author Comment

by:indianbill007
ID: 26321411
Are you giving me any another solution?
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 1500 total points
ID: 26321436
Alas no.
I would have bet that lowering -Xmx sharply would show some effect, but when you say it didn't ...
wmp
0
 

Author Closing Comment

by:indianbill007
ID: 31675452
I have found lot of knowledge from this.
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question