Kannel: Cannot Send or receive SMS - linux

I am trying to send and receive SMS via kannel. I have set everything, no errors but still it cannot send or receive any sms.
I am using Huawei E160 modem and Ubuntu 11 as my OS.
Here is the log file:
2012-02-25 14:25:34 [9913] [0] INFO: HTTP: Opening server at port 13000.
2012-02-25 14:25:34 [9913] [0] INFO: BOXC: 'smsbox-max-pending' not set, using default (100).
2012-02-25 14:25:34 [9913] [0] INFO: Set SMS resend frequency to 60 seconds.
2012-02-25 14:25:34 [9913] [0] INFO: SMS resend retry set to unlimited.
2012-02-25 14:25:34 [9913] [0] INFO: DLR rerouting for smsc id <(null)> disabled.
2012-02-25 14:25:34 [9913] [0] INFO: AT2[/dev/ttyUSB0]: configuration shows modemtype <huawei>
2012-02-25 14:25:34 [9913] [0] INFO: AT2[/dev/ttyUSB0]: read modem definition for <huawei-e160>
2012-02-25 14:25:34 [9913] [6] INFO: AT2[/dev/ttyUSB0]: opening device
2012-02-25 14:25:34 [9913] [0] INFO: Adding interface *
2012-02-25 14:25:34 [9913] [0] INFO: ----------------------------------------
2012-02-25 14:25:34 [9913] [0] INFO: Kannel bearerbox II version 1.4.3 starting
2012-02-25 14:25:34 [9913] [0] INFO: MAIN: Start-up done, entering mainloop
2012-02-25 14:25:34 [9913] [6] INFO: AT2[/dev/ttyUSB0]: Logging in
2012-02-25 14:25:34 [9913] [6] INFO: AT2[/dev/ttyUSB0]: init device
2012-02-25 14:25:34 [9913] [6] INFO: AT2[/dev/ttyUSB0]: speed set to 115200
2012-02-25 14:25:35 [9913] [6] INFO: AT2[/dev/ttyUSB0]: AT SMSC successfully opened.
2012-02-25 14:26:28 [9913] [13] INFO: Client connected from <127.0.0.1>
My kannel.conf file
group = core
admin-port = 13000
admin-password = 123
status-password = 123
smsbox-port = 13003
wapbox-port = 13004
log-file = "/home/eclipse/kannel_core.log"
log-level = 1
wdp-interface-name = "*"
#group = smsc
#smsc = fake
#port = 1000
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-file = "/home/eclipse/kannel_smsbox.log"
log-level = 1
group = smsc
smsc = at
modemtype = huawei
device = /dev/ttyUSB0
speed=115200
log-level = 0
pin = 1442
group = modems
id = huawei
name = "huawei-e160"
detect-string = "huawei"
init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
speed = 115200
group = wapbox
bearerbox-host = 127.0.0.1
log-file = "/home/eclipse/kannel_wapbox.log"
group = sendsms-user
username = 123
password = 123
user-allow-ip = "127.0.0.1"
group = sms-service
keyword = default
get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b"
accept-x-kannel-headers = true
max-messages = 3
concatenation = true
catch-all = true
My receivesms.php file is coded as
<?php
define("DBHOST","localhost",true);
define("DBUSERNAME","root",true);
define("DBPASSWORD","xxxxxx",true);
define("DBNAME","kannel_sms",true);
function insertSms($sender,$text)
{
$con = 'mysql:dbname='.DBNAME.';host='.DBHOST;
try {
$cmd = new PDO($con,DBUSERNAME,DBPASSWORD);
$stmt = $cmd->prepare("INSERT INTO kannel_tuto (number,message) VALUES (:sender,:message)");
$stmt->bindParam(':sender',$sender);
$stmt->bindParam(':message',$text);
$stmt->execute();
$cmd = null;
if($stmt->rowCount()>0)
{
echo "Hello ".$text.". Thank you for your registration.";
}
else
{
echo "Sorry an error has occured";
}
}
catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
}
insertSms($_GET['sender'],$_GET['text']);
?>

As I indicated above, my script and configurations are correct. I just figured out that the E160 modem is not good for sms and kannel. There is loss of signals, I don't know why though. I used E173 and E220 huawei modems and they work well.

Related

Cassandra HeartBeat logs

I am using cassandra in my spring application. Everytime a request comes or connection is idle, cassandra is printing heartbeat DEBUG logs through logback of my application. I want to stop these heartbeat logs in my debug logs.
2016-11-03 11:37:27,241 DEBUG [cluster1-nio-worker-2] [com.datastax.driver.core.Connection] [line : 1093 ] [] - Connection[/10.41.123.31:9042-2, inFlight=0, closed=false] heartbeat query succeeded
2016-11-03 11:37:30,990 DEBUG [cluster1-nio-worker-6] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-6, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,991 DEBUG [cluster1-nio-worker-1] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-1, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,990 DEBUG [cluster1-nio-worker-5] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-5, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,990 DEBUG [cluster1-nio-worker-7] [com.datastax.driver.core.Connection] [line : 1023 ] [] - Connection[/10.41.123.31:9042-7, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
2016-11-03 11:37:30,993 DEBUG [cluster1-nio-worker-5] [com.datastax.driver.core.Connection] [line : 1093 ] [] - Connection[/10.41.123.31:9042-5, inFlight=0, closed=false] heartbeat query succeeded
2016-1
What logger are you using?
If you are using log4j you can configure the debug level like this:
import org.apache.log4j.PropertyConfigurator;
private static final org.slf4j.Logger log = LoggerFactory.getLogger(Application.class);
public Application() {
final Properties properties = new Properties();
properties.put("log4j.rootLogger", "INFO, A1");
PropertyConfigurator.configure(properties);
}
Then the heartbeats should not longer be printed out.

tshark SIP protocol display collapse

I'm using tshark protocol filter as I need to parse the contents of the SIP Packets.
tshark -r df32c2248fe646a6793ce9a63b124b34#0.0.0.0.pcap -O sip
I get this:
Frame 14: 553 bytes on wire (4424 bits), 553 bytes captured (4424 bits)
Linux cooked capture
Internet Protocol Version 4, Src: 4.4.4.4 (4.4.4.4), Dst: 3.3.3.3 (3.3.3.3)
User Datagram Protocol, Src Port: 5060 (5060), Dst Port: 5060 (5060)
Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Status-Code: 200
[Resent Packet: False]
[Request Frame: 11]
[Response Time (ms): 115]
[Release Time (ms): 115]
Message Header
Via: SIP/2.0/UDP 2.2.2.2:5060;received=3.3.3.3;branch=z9hG4bK18f6609d-1c76-4a8b-a96b-2cf7d8036d36_6772d868_3067109296759172
Transport: UDP
Sent-by Address: 2.2.2.2
Sent-by port: 5060
Received: 3.3.3.3
Branch: z9hG4bK18f6609d-1c76-4a8b-a96b-2cf7d8036d36_6772d868_3067109296759172
Contact: <sip:14082186500#1.1.1.1:17060>
Contact URI: sip:14082186500#1.1.1.1:17060
Contact URI User Part: 14082186500
Contact URI Host Part: 1.1.1.1
Contact URI Host Port: 17060
To: <sip:14082186500#spicyramen.ippbx.com;user=phone>;tag=83174026
SIP to address: sip:14082186500#spicyramen.ippbx.com;user=phone
SIP to address User Part: 14082186500
SIP to address Host Part: spicyramen.ippbx.com
SIP To URI parameter: user=phone
SIP to tag: 83174026
From: <sip:anonymous#sip.ie1.sipprovider.com>;tag=87638703_6772d868_18f6609d-1c76-4a8b-a96b-2cf7d8036d36
SIP from address: sip:anonymous#sip.ie1.sipprovider.com
SIP from address User Part: anonymous
SIP from address Host Part: sip.ie1.sipprovider.com
SIP from tag: 87638703_6772d868_18f6609d-1c76-4a8b-a96b-2cf7d8036d36
Call-ID: df32c2248fe646a6793ce9a63b124b34#0.0.0.0
CSeq: 44365 BYE
Sequence Number: 44365
Method: BYE
User-Agent: 3CXPhoneSystem 14.0.44198.522 (44097)
Content-Length: 0
As you can see output is not collapse. I want to see something like this:
Frame 14: 553 bytes on wire (4424 bits), 553 bytes captured (4424 bits)
Linux cooked capture
Internet Protocol Version 4, Src: 4.4.4.4 (4.4.4.4), Dst: 3.3.3.3 (3.3.3.3)
User Datagram Protocol, Src Port: 5060 (5060), Dst Port: 5060 (5060)
Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Via: SIP/2.0/UDP 2.2.2.2:5060;received=3.3.3.3;branch=z9hG4bK18f6609d-1c76-4a8b-a96b-2cf7d8036d36_6772d868_3067109296759172
Contact: <sip:14082186500#1.1.1.1:17060>
To: <sip:14082186500#spicyramen.ippbx.com;user=phone>;tag=83174026
From: <sip:anonymous#sip.ie1.sipprovider.com>;tag=87638703_6772d868_18f6609d-1c76-4a8b-a96b-2cf7d8036d36
Call-ID: df32c2248fe646a6793ce9a63b124b34#0.0.0.0
CSeq: 44365 BYE
User-Agent: 3CXPhoneSystem 14.0.44198.522 (44097)
Content-Length: 0
WiresharkYou can use Wireshark to do the job.
Apply a display filter:
sip
Go to the the Packet Details pane.
Expand "Session Initiation Protocol"
Expand Request-Line, Message Header and Message Body* (do not Expand Subtrees)
Go to File - Export - Export Packet Dissections... - As "Plain Text" File...
Packet Format section: select "Packet Summery Line" and "Packet Details: As Displayed"
Add a file name and save the file
*Note
I have used sample file: aaa.pcap
Message Body: see packet 223
TShark
You can use -T Fields and add all the fields you need.
For example:
tshark -r aaa.pcap -Y sip -E header=y -E separator="?" -T fields -e frame.number -e sip.Request-Line -e sip.r-uri -e sip.Via -e sip.From -e sip.To -e sip.Call-ID -e sip.Contact -e sip.Expires -e sip.CSeq -e sip.User-Agent -e sip.Content-Length > aaa.csv

Java card weird response to long AID and Short AID applets

I create a package that contains 22 equal applets.(The applets are equal in program and different in AID.)
When I set the package AID and applet's AIDs as below, everything is OK. (I can install it and I can see it in the response of gp -list command)
Package AID = 0102030405
App1 AID = 010203040501
App2 AID = 010203040502
App3 AID = 010203040503
App4 AID = 010203040504
App5 AID = 010203040505
App6 AID = 010203040506
App7 AID = 010203040507
App8 AID = 010203040508
App9 AID = 010203040509
App10 AID = 01020304050a
App11 AID = 01020304050b
App12 AID = 01020304050c
App13 AID = 01020304050d
App14 AID = 01020304050e
App15 AID = 01020304050f
App16 AID = 010203040510
App17 AID = 010203040511
App18 AID = 010203040512
App19 AID = 010203040513
App20 AID = 010203040514
App21 AID = 010203040515
App22 AID = 010203040516
Look :
gp: gp -list
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
gp: gp -install e:\PackageWithShortAIDs.cap
gp: gp -list
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: 010203040507 (|......|)
App SELECTABLE: (none)
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
AID: 0102030405 (|.....|)
ExM LOADED: (none)
010203040507 (|......|)
010203040506 (|......|)
010203040505 (|......|)
010203040504 (|......|)
010203040503 (|......|)
010203040502 (|......|)
010203040501 (|......|)
010203040513 (|......|)
010203040512 (|......|)
010203040511 (|......|)
010203040510 (|......|)
01020304050F (|......|)
01020304050E (|......|)
01020304050D (|......|)
01020304050C (|......|)
01020304050B (|......|)
01020304050A (|......|)
010203040516 (|......|)
010203040515 (|......|)
010203040514 (|......|)
010203040509 (|......|)
010203040508 (|......|)
gp:
Now,I change I change the AID of Applets as below (everything else is the same as for before) :
Package AID = 0102030405
App1 AID = 0102030405060708090001
App2 AID = 0102030405060708090002
App3 AID = 0102030405060708090003
App4 AID = 0102030405060708090004
App5 AID = 0102030405060708090005
App6 AID = 0102030405060708090006
App7 AID = 0102030405060708090007
App8 AID = 0102030405060708090008
App9 AID = 0102030405060708090009
App10 AID = 010203040506070809000a
App11 AID = 010203040506070809000b
App12 AID = 010203040506070809000c
App13 AID = 010203040506070809000d
App14 AID = 010203040506070809000e
App15 AID = 010203040506070809000f
App16 AID = 0102030405060708090010
App17 AID = 0102030405060708090011
App18 AID = 0102030405060708090012
App19 AID = 0102030405060708090013
App20 AID = 0102030405060708090014
App21 AID = 0102030405060708090015
App22 AID = 0102030405060708090016
In this case, I can load and install it. But I can't list my installed applets anymore!
gp: gp -list
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
gp: gp -install e:\PackageWithLongAIDs.cap
gp: gp -list
javax.smartcardio.CardException: Get Status failed, SW: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
Exception in thread "main" javax.smartcardio.CardException: Get Status failed, S
W: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
gp:
Why?!
Update :
Debug Mode - Short AIDs :
.
.
.
A>> T=1 (4+0008) 80500000 08 9F6EB47CB0E1F31F
A<< (0028+2) (70ms) 00004198001714974248FF0200BD548DC44808E7509B8AD3DEACC41F 900
0
Host challenge: 9F6EB47CB0E1F31F
Card challenge: 00BD548DC44808E7
Card reports SCP02 with version 255 keys
Master keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
Sequnce counter: 00BD
Derived session keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:DAED14FD3E4D7E6DC2A87F618D5A9EAC
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:59AEDE4C2E3E891BB50AE82028E44BF0
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:4DD4DBE895A5CFC590D4B190BF0547AC
Verified card cryptogram: 509B8AD3DEACC41F
Calculated host cryptogram: 85D04425E8C0A4BA
A>> T=1 (4+0016) 84820100 10 85D04425E8C0A4BAB5F40665FC1D88EE
A<< (0000+2) (66ms) 9000
A>> T=1 (4+0010) 84F28000 0A 4F009E0E0DBD266DC260
A<< (0011+2) (46ms) 08A000000151000000019E 9000
A>> T=1 (4+0010) 84F24000 0A 4F0078DB90059DC6D376
A<< (0009+2) (44ms) 060102030405070700 9000
A>> T=1 (4+0010) 84F22000 0A 4F000EA20738A58D27B1
A<< (0018+2) (48ms) 07A000000151535001000501020304050100 9000
A>> T=1 (4+0010) 84F21000 0A 4F0006BC7C18D19E7BDB
A<< (0183+2) (101ms) 07A000000151535001000108A0000001515350410501020304050100160
60102030405070601020304050606010203040505060102030405040601020304050306010203040
50206010203040501060102030405130601020304051206010203040511060102030405100601020
304050F0601020304050E0601020304050D0601020304050C0601020304050B0601020304050A060
1020304051606010203040515060102030405140601020304050906010203040508 9000
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: 010203040507 (|......|)
App SELECTABLE: (none)
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
AID: 0102030405 (|.....|)
ExM LOADED: (none)
010203040507 (|......|)
010203040506 (|......|)
010203040505 (|......|)
010203040504 (|......|)
010203040503 (|......|)
010203040502 (|......|)
010203040501 (|......|)
010203040513 (|......|)
010203040512 (|......|)
010203040511 (|......|)
010203040510 (|......|)
01020304050F (|......|)
01020304050E (|......|)
01020304050D (|......|)
01020304050C (|......|)
01020304050B (|......|)
01020304050A (|......|)
010203040516 (|......|)
010203040515 (|......|)
010203040514 (|......|)
010203040509 (|......|)
010203040508 (|......|)
SCardEndTransaction()
SCardDisconnect("ACS CCID USB Reader 0", false)
gp:
Debug Mode - Long AIDs :
.
.
.
A>> T=1 (4+0008) 80500000 08 E81EAC2B833E5DCF
A<< (0028+2) (70ms) 00004198001714974248FF0200B93785186688F163331EF41FA02CB8 900
0
Host challenge: E81EAC2B833E5DCF
Card challenge: 00B93785186688F1
Card reports SCP02 with version 255 keys
Master keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
Sequnce counter: 00B9
Derived session keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:1EC5FBCA9A5F21F727C14461A7D7E2C6
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:2688CFFD58CCF9EB52B5D5E786364C89
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:C181FE8094950965495E0D5023AFD65D
Verified card cryptogram: 63331EF41FA02CB8
Calculated host cryptogram: A269860A0E584230
A>> T=1 (4+0016) 84820100 10 A269860A0E5842301E0CBE71E485EA79
A<< (0000+2) (66ms) 9000
A>> T=1 (4+0010) 84F28000 0A 4F00DF01359AC330E966
A<< (0011+2) (46ms) 08A000000151000000019E 9000
A>> T=1 (4+0010) 84F24000 0A 4F003E447E78BC4DE5CC
A<< (0014+2) (45ms) 0B01020304050607080900070700 9000
A>> T=1 (4+0010) 84F22000 0A 4F00D20EAEA9E44363C1
A<< (0018+2) (48ms) 07A000000151535001000501020304050100 9000
A>> T=1 (4+0010) 84F21000 0A 4F003EA1383F26463052
A<< (0020+2) (54ms) 07A000000151535001000108A000000151535041 6310
A>> T=1 (4+0010) 84F21001 0A 4F002196E82C3A537F62
A<< (0000+2) (50ms) 6A88
javax.smartcardio.CardException: Get Status failed, SW: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
SCardEndTransaction()
SCardDisconnect("ACS CCID USB Reader 0", false)
Exception in thread "main" javax.smartcardio.CardException: Get Status failed, S
W: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
gp:
Test with another Card :
I upload this package on another card (another type), but it is OK!
gp: gp -list
AID: A000000003000000 (|........|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
gp: gp -install e:\PackageWithLongAIDs.cap
gp: gp -list
AID: A000000003000000 (|........|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: 0102030405060708090007 (|...........|)
App SELECTABLE: (none)
AID: 0102030405 (|.....|)
Exe LOADED: (none)
gp:
As you see above, the list of applets of my package doesn't appear in output(I think it is a feature of SD of my card), but I have output without any error.
I think the card is the origin of the error! No?
Note that, This problem appear only in cases that the package contains more than 20 applets.
If you have troubles with specific software, please follow the documentation of the software to get help (this includes posting to the right place and posting with sufficient information, like logs with -d -v for GlobalPlatformPro and do open a github issue if you think you have found a bug)
If you have questions about JavaCard or GlobalPlatform, please read the specifications before asking questions that are explained in the specs (like different VM limitations).

Selenium Webdriver requires restarts to function consistently

My testing stack consists of the latest version of Selenium Server (2.33.0, aka selenium-server-standalone-2.33.0.jar), Mocha, Node.js, and PhantomJS.
My question regards the following code:
var webdriver = require('../../../lib/selenium/node_modules/selenium-webdriver/'),
driver = new webdriver.Builder().
withCapabilities({'browserName': 'phantomjs'}).
build();
driver.manage().timeouts().implicitlyWait(15000);
describe('Wordpress', function() {
it('should be able to log in', function(done) {
driver.get('http://#### REDACTED ####/wp-login.php');
driver.findElement(webdriver.By.css('#user_login')).sendKeys('#### REDACTED ####');
driver.findElement(webdriver.By.css('#user_pass')).sendKeys('#### REDACTED ####');
driver.findElement(webdriver.By.css('#wp-submit')).click();
// #wpwrap is an element on the Wordpress dashboard that is displayed once
// the user is logged in. By testing for its presence, we can determine
// if the login attempt succeeded.
driver.findElement(webdriver.By.css('#wpwrap')).then(function(v) {
done();
});
});
});
On my local system, OS X, the test runs fine consistently. However, once the test is uploaded to our CentOS server (where we hope to do Continuous Integration testing), the test behaves extremely strangely.
After Selenium Server is started, the test runs successfully once. From that point on, the test only succeeds every one out of ten times or so. Restarting Selenium Server guarantees that the test will run successfully. In fact, if Selenium Server is restarted every time the test is run, the test will succeed every time.
How can I get this test to succeed without restarting Selenium Server every time?
Thank you so much for your help! :)
UPDATE: In addition to the error log below, I'm also occasionally getting the following error:
Exception in thread "Thread-21" java.lang.OutOfMemoryError: unable to create new native thread
Details on the error messages follow below:
A successful test yields the following output from Mocha:
[s5rich#host ~]$ mocha test/selenium/acceptance/simple.js
Wordpress
✓ should be able to log in (2604ms)
1 passing (3 seconds)
A successful test also yields the following output from Selenium Server:
23:21:50.517 INFO - Executing: [new session: {browserName=phantomjs}] at URL: /session)
23:21:50.527 INFO - Creating a new session for Capabilities [{browserName=phantomjs}]
23:21:50.547 INFO - executable: /usr/local/bin/phantomjs
23:21:50.547 INFO - port: 26515
23:21:50.547 INFO - arguments: [--webdriver=26515, --webdriver-logfile=/home/s5rich/phantomjsdriver.log]
23:21:50.547 INFO - environment: {}
PhantomJS is launching GhostDriver...
[INFO - 2013-07-24T05:21:50.923Z] GhostDriver - Main - running on port 26515
[INFO - 2013-07-24T05:21:51.435Z] Session [f235d040-f420-11e2-8d90-f50327bc3449] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
[INFO - 2013-07-24T05:21:51.435Z] Session [f235d040-f420-11e2-8d90-f50327bc3449] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.1","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"linux-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2013-07-24T05:21:51.435Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: f235d040-f420-11e2-8d90-f50327bc3449
23:21:51.495 INFO - Done: /session
23:21:51.504 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities#46b78d at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2)
23:21:51.505 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2
23:21:51.520 INFO - Executing: [get: http://#### REDACTED ####/wp-login.php] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/url)
23:21:51.821 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/url
23:21:51.827 INFO - Executing: [find element: By.selector: #user_login] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element)
23:21:51.874 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element
23:21:51.883 INFO - Executing: [send keys: 0 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement#20788bf8, [#### REDACTED ####]] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element/0/value)
23:21:51.939 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element/0/value
23:21:51.948 INFO - Executing: [find element: By.selector: #user_pass] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element)
23:21:51.965 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element
23:21:52.001 INFO - Executing: [send keys: 1 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement#20788bf9, [#### REDACTED ####]] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element/1/value)
23:21:52.065 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element/1/value
23:21:52.074 INFO - Executing: [find element: By.selector: #wp-submit] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element)
23:21:52.099 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element
23:21:52.106 INFO - Executing: [click: 2 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement#20788bfa] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element/2/click)
23:21:52.842 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element/2/click
23:21:52.850 INFO - Executing: [find element: By.selector: #wpwrap] at URL: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element)
23:21:52.871 INFO - Done: /session/8750a6b4-ec7d-4313-a86d-04ac344b74f2/element
A failed test yields the following output from Mocha:
[s5rich#host ~]$ mocha test/selenium/acceptance/simple.js
Wordpress
1) should be able to log in
0 passing (2 seconds)
1 failing
1) Wordpress should be able to log in:
Uncaught UnknownError: Error Message => 'Unable to find element with css selector '#wpwrap''
caused by Request => {"headers":{"Accept":"application/json, image/png","Connection":"Keep-Alive","Content-Length":"42","Content-Type":"application/json; charset=utf-8","Host":"localhost:2897"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"css selector\",\"value\":\"#wpwrap\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/77a0a110-f421-11e2-a6fd-61cd002d7d02/element"}
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-042stab076.8', java.version: '1.7.0'
Driver info: driver.version: unknown
at new bot.Error (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/atoms/error.js:108:18)
at Object.bot.response.checkResponse (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/atoms/response.js:106:9)
at /home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/webdriver.js:262:20
at /home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/goog/base.js:1112:15
at webdriver.promise.ControlFlow.runInNewFrame_ (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:1431:20)
at notify (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:315:12)
at notifyAll (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:284:7)
at fulfill (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:389:7)
at /home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:1298:10
at /home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/goog/base.js:1112:15
at webdriver.promise.ControlFlow.runInNewFrame_ (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:1431:20)
at notify (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:315:12)
at notifyAll (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:284:7)
at fulfill (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:389:7)
at /home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/goog/base.js:1112:15
at webdriver.promise.ControlFlow.runInNewFrame_ (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:1431:20)
at notify (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:315:12)
at notifyAll (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:284:7)
at fulfill (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:389:7)
at /home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/promise.js:600:51
at /home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/http/http.js:96:5
at IncomingMessage.<anonymous> (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/http/index.js:113:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:910:16
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.findElement(By.cssSelector("#wpwrap"))
at webdriver.WebDriver.schedule (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/webdriver.js:246:15)
at webdriver.WebDriver.findElement (/home/s5rich/lib/selenium/node_modules_osx/selenium-webdriver/lib/webdriver/webdriver.js:685:17)
at Context.<anonymous> (/home/s5rich/test/selenium/acceptance/simple.js:12:10)
at Test.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:194:15)
at Runner.runTest (/usr/local/lib/node_modules/mocha/lib/runner.js:355:10)
at /usr/local/lib/node_modules/mocha/lib/runner.js:401:12
at next (/usr/local/lib/node_modules/mocha/lib/runner.js:281:14)
at /usr/local/lib/node_modules/mocha/lib/runner.js:290:7
at next (/usr/local/lib/node_modules/mocha/lib/runner.js:234:23)
at Object._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:258:5)
at processImmediate [as _immediateCallback] (timers.js:330:15)
A failed test also yields the following output from Selenium Server:
23:25:34.742 INFO - Executing: [new session: {browserName=phantomjs}] at URL: /session)
23:25:34.743 INFO - Creating a new session for Capabilities [{browserName=phantomjs}]
23:25:34.744 INFO - executable: /usr/local/bin/phantomjs
23:25:34.744 INFO - port: 2897
23:25:34.744 INFO - arguments: [--webdriver=2897, --webdriver-logfile=/home/s5rich/phantomjsdriver.log]
23:25:34.744 INFO - environment: {}
PhantomJS is launching GhostDriver...
[INFO - 2013-07-24T05:25:34.879Z] GhostDriver - Main - running on port 2897
[INFO - 2013-07-24T05:25:35.270Z] Session [77a0a110-f421-11e2-a6fd-61cd002d7d02] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
[INFO - 2013-07-24T05:25:35.270Z] Session [77a0a110-f421-11e2-a6fd-61cd002d7d02] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.1","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"linux-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2013-07-24T05:25:35.270Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 77a0a110-f421-11e2-a6fd-61cd002d7d02
23:25:35.275 INFO - Done: /session
23:25:35.283 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities#13b4ce4 at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee)
23:25:35.284 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee
23:25:35.297 INFO - Executing: [get: http://#### REDACTED ####/wp-login.php] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/url)
23:25:35.592 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/url
23:25:35.597 INFO - Executing: [find element: By.selector: #user_login] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element)
23:25:35.619 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element
23:25:35.631 INFO - Executing: [send keys: 0 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement#240035bc, [#### REDACTED ####]] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element/0/value)
23:25:35.683 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element/0/value
23:25:35.695 INFO - Executing: [find element: By.selector: #user_pass] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element)
23:25:35.712 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element
23:25:35.723 INFO - Executing: [send keys: 1 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement#240035bd, [#### REDACTED ####]] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element/1/value)
23:25:35.783 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element/1/value
23:25:35.800 INFO - Executing: [find element: By.selector: #wp-submit] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element)
23:25:35.822 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element
23:25:35.832 INFO - Executing: [click: 2 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement#240035be] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element/2/click)
23:25:36.105 INFO - Done: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element/2/click
23:25:36.121 INFO - Executing: [find element: By.selector: #wpwrap] at URL: /session/b62d0c67-2000-439c-a0bd-f2c100350dee/element)
e = java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
23:25:36.285 WARN - Exception thrown
org.openqa.selenium.NoSuchElementException: Error Message => 'Unable to find element with css selector '#wpwrap''
caused by Request => {"headers":{"Accept":"application/json, image/png","Connection":"Keep-Alive","Content-Length":"42","Content-Type":"application/json; charset=utf-8","Host":"localhost:2897"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"css selector\",\"value\":\"#wpwrap\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/77a0a110-f421-11e2-a6fd-61cd002d7d02/element"}
Command duration or timeout: 149 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-042stab076.8', java.version: '1.7.0'
Session ID: 77a0a110-f421-11e2-a6fd-61cd002d7d02
Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver
Capabilities [{platform=LINUX, acceptSslCerts=false, javascriptEnabled=true, browserName=phantomjs, rotatable=false, driverVersion=1.0.3, locationContextEnabled=false, version=1.9.1, databaseEnabled=false, cssSelectorsEnabled=true, handlesAlerts=false, browserConnectionEnabled=false, proxy={proxyType=direct}, webStorageEnabled=false, nativeEvents=true, driverName=ghostdriver, applicationCacheEnabled=false, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:307)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:396)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:407)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:101)
at $Proxy1.findElement(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(EventFiringWebDriver.java:180)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:47)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.openqa.selenium.remote.ScreenshotException: Screen shot has been taken
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-042stab076.8', java.version: '1.7.0'
Driver info: driver.version: EventFiringWebDriver
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:125)
... 20 more
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Error Message => 'Unable to find element with css selector '#wpwrap''
caused by Request => {"headers":{"Accept":"application/json, image/png","Connection":"Keep-Alive","Content-Length":"42","Content-Type":"application/json; charset=utf-8","Host":"localhost:2897"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"css selector\",\"value\":\"#wpwrap\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/77a0a110-f421-11e2-a6fd-61cd002d7d02/element"}
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-042stab076.8', java.version: '1.7.0'
Driver info: driver.version: unknown
23:25:36.293 WARN - Exception: Error Message => 'Unable to find element with css selector '#wpwrap''
caused by Request => {"headers":{"Accept":"application/json, image/png","Connection":"Keep-Alive","Content-Length":"42","Content-Type":"application/json; charset=utf-8","Host":"localhost:2897"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"css selector\",\"value\":\"#wpwrap\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/77a0a110-f421-11e2-a6fd-61cd002d7d02/element"}
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-042stab076.8', java.version: '1.7.0'
Driver info: driver.version: unknown
From what I see, it is a simple problem to solve. You have a unhandled exception that is being thrown when there is a failure: NoSuchElementException . I don't think you need to restart your grid node every time (assuming you are running your grid hub separate from your grid node instances). It may be that successive runs of the browser from your Grid Node use just enough more memory to cause a minor delay in the page, breaking your script. All you need to do is handle the NoSuchElementException gracefully by wrapping it in a retry try loop. You can also effectively do similar using FluentWait with the .ignoring method.

Kannel: ERROR: System error 98: Address already in use

I cannot run kannel(an open source sms gateway) run properly. Everytime I try I get this error. ERROR: System error 98: Address already in use
Here is my kannel.conf
group = core
admin-port = 13000
admin-password = 123
status-password = 123
smsbox-port = 13003
wapbox-port = 13004
log-file = "/home/eclipse/kannel_core.log"
log-level = 1
wdp-interface-name = "*"
#group = smsc
#smsc = fake
#port = 1000
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-file = "/home/eclipse/kannel_smsbox.log"
log-level = 1
group = wapbox
bearerbox-host = 127.0.0.1
log-file = "/home/eclipse/kannel_wapbox.log"
group = sendsms-user
username = 123
password = 123
user-allow-ip = "127.0.0.1"
group = sms-service
url="http://localhost/sms/send.php?sender=%s&&text=%t"
accept-x-kannel-headers = true
and the log file for the core:
2012-02-23 21:26:36 [9194] [0] INFO: Added logfile `/home/eclipse/kannel_core.log' with level `1'.
2012-02-23 21:26:36 [9194] [0] INFO: HTTP: Opening server at port 13000.
2012-02-23 21:26:36 [9194] [0] ERROR: bind failed
2012-02-23 21:26:36 [9194] [0] ERROR: System error 98: Address already in use
2012-02-23 21:26:36 [9194] [0] INFO: Adding interface *
2012-02-23 21:26:36 [9194] [0] ERROR: Couldn't bind a UDP socket to port 9200
2012-02-23 21:26:36 [9194] [0] ERROR: System error 98: Address already in use
2012-02-23 21:26:36 [9194] [0] ERROR: Couldn't bind a UDP socket to port 9201
2012-02-23 21:26:36 [9194] [0] ERROR: System error 98: Address already in use
2012-02-23 21:26:36 [9194] [0] INFO: ----------------------------------------
2012-02-23 21:26:36 [9194] [0] INFO: Kannel bearerbox II version 1.4.3 starting
2012-02-23 21:26:36 [9194] [7] ERROR: bind failed
2012-02-23 21:26:36 [9194] [7] ERROR: System error 98: Address already in use
2012-02-23 21:26:36 [9194] [7] PANIC: Could not open wapbox port 13004
2012-02-23 21:26:36 [9194] [0] INFO: MAIN: Start-up done, entering mainloop
2012-02-23 21:26:36 [9194] [7] PANIC: /usr/sbin/bearerbox(gw_panic+0xd2) [0x80d1b62]
2012-02-23 21:26:36 [9194] [7] PANIC: /usr/sbin/bearerbox() [0x8055bc0]
2012-02-23 21:26:36 [9194] [7] PANIC: /usr/sbin/bearerbox() [0x80c8bbb]
2012-02-23 21:26:36 [9194] [7] PANIC: /lib/i386-linux-gnu/libpthread.so.0(+0x6d31) [0x7a5d31]
2012-02-23 21:26:36 [9194] [7] PANIC: /lib/i386-linux-gnu/libc.so.6(clone+0x5e) [0xbba0ce]
I have tried to do a lot of changes but none successful. Kindly let me know which point I am missing. Thanks.
Something else is running at ports 13000, 9200, 9201 and 13004 - most likely another instance of kannel.
do sudo netstat -lanp to see what process it is.
Try to stop kannel service /etc/init.d/kannel stop and start it /etc/init.d/kannel start after few seconds.
I found out that sometime if you stop kannel service, it takes some few seconds to shutdown completely.
I had this error occur without the kannel piece but the etc/hosts file had a bad host/ip configured and the DNS at the site was pointing to the wrong server so Oracle listener could not be reached.

Resources