Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: SSL Soap Server daemon stopping

by Eyck (Priest)
on Aug 20, 2008 at 16:45 UTC ( [id://705551]=note: print w/replies, xml ) Need Help??


in reply to SSL Soap Server daemon stopping

Does the server actualy shut itself down, or does it just stop working ( hang )?

Running out of enthropy has this annoying property of SSL code waiting for more enthropy to become available, thus behaving similarly to what you describe.

Replies are listed 'Best First'.
Re^2: SSL Soap Server daemon stopping
by perlchild (Acolyte) on Aug 21, 2008 at 12:23 UTC

    Yes Eyck, the soap server process completely stops. Its no longer a running process and not listed in the ps output.

      If it's easy to reproduce, I would suggest trying to run your daemon under 'strace -f'

      If it takes more time to reproduce, I guess I would still try running it with strace via

      strace -o daemon.log -f -p $pid
      because it might be something inside your ssl library and segfault there won't be easy to catch just with logging from inside.

        I will try the strace -o daemon.log -f -p $pid tomorrow when I get the time to run it without it being in the background. Maybe I will get more information on the cause of the problem.

        Here is the output of the strace when the server stopped suddenly.

        6112 accept(3, {sa_family=AF_INET, sin_port=htons(34035), sin_addr=in +et_addr("62.148.165.251")}, [17547150056732229648]) = 4 6112 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffe4239720) = -1 EIN +VAL (Invalid argument) 6112 lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) 6112 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffe4239720) = -1 EIN +VAL (Invalid argument) 6112 lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) 6112 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 6112 brk(0x20511000) = 0x20511000 6112 read(4, "", 11) = 0 6112 shutdown(4, 2 /* send and receive */) = 0 6112 close(4) = 0 6112 close(3) = 0 6112 stat("certs/my-ca.pem", 0x1f934140) = -1 ENOENT (No such file or + directory) 6112 open("/etc/pki/tls/certs/server-key.pem", O_RDONLY) = 3 6112 fstat(3, {st_mode=S_IFREG|0644, st_size=887, ...}) = 0 6112 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS +, -1, 0) = 0x2aaaaaaad000 6112 read(3, "-----BEGIN RSA PRIVATE KEY-----\n"..., 4096) = 887 6112 close(3) = 0 6112 munmap(0x2aaaaaaad000, 4096) = 0 6112 open("/etc/pki/tls/certs/server-cert.pem", O_RDONLY) = 3 6112 fstat(3, {st_mode=S_IFREG|0644, st_size=1822, ...}) = 0 6112 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS +, -1, 0) = 0x2aaaaaaad000 6112 read(3, "-----BEGIN CERTIFICATE-----\nMIIF"..., 4096) = 1822 6112 read(3, "", 4096) = 0 6112 close(3) = 0 6112 munmap(0x2aaaaaaad000, 4096) = 0 6112 open("/etc/protocols", O_RDONLY) = 3 6112 fcntl(3, F_GETFD) = 0 6112 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 6112 fstat(3, {st_mode=S_IFREG|0644, st_size=6108, ...}) = 0 6112 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS +, -1, 0) = 0x2aaaaaaad000 6112 read(3, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 4096 6112 close(3) = 0 6112 munmap(0x2aaaaaaad000, 4096) = 0 6112 open("/etc/hosts", O_RDONLY) = 3 6112 fcntl(3, F_GETFD) = 0 6112 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 6112 fstat(3, {st_mode=S_IFREG|0644, st_size=232, ...}) = 0 6112 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS +, -1, 0) = 0x2aaaaaaad000 6112 read(3, "# Do not remove the following li"..., 4096) = 232 6112 read(3, "", 4096) = 0 6112 close(3) = 0 6112 munmap(0x2aaaaaaad000, 4096) = 0 6112 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3 6112 connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet +_addr("66.18.96.2")}, 28) = 0 6112 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR) 6112 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0 6112 poll([{fd=3, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1 6112 sendto(3, "\30\267\1\0\0\1\0\0\0\0\0\0\3www\20thetradingporta".. +., 42, MSG_NOSIGNAL, NULL, 0) = 42 6112 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 5000) = 1 6112 ioctl(3, FIONREAD, [139]) = 0 6112 recvfrom(3, "\30\267\205\200\0\1\0\1\0\2\0\2\3www\20thetradingpo +rta"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=in +et_addr("66.18.96.2")}, [16]) = 139 6112 close(3) = 0 6112 open("/etc/protocols", O_RDONLY) = 3 6112 fcntl(3, F_GETFD) = 0 6112 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 6112 fstat(3, {st_mode=S_IFREG|0644, st_size=6108, ...}) = 0 6112 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS +, -1, 0) = 0x2aaaaaaad000 6112 read(3, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 4096 6112 close(3) = 0 6112 munmap(0x2aaaaaaad000, 4096) = 0 6112 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3 6112 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffe423a750) = -1 EIN +VAL (Invalid argument) 6112 lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) 6112 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffe423a750) = -1 EIN +VAL (Invalid argument) 6112 lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) 6112 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 6112 bind(3, {sa_family=AF_INET, sin_port=htons(8443), sin_addr=inet_ +addr("66.18.103.186")}, 16) = -1 EADDRINUSE (Address already in use) 6112 close(3) = 0 6112 write(2, "Can\'t call method \"url\" on an un"..., 73) = -1 EIO +(Input/output error) 6112 stat("/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi +/auto/DBI/DESTROY.al", 0x1f934140) = -1 ENOENT (No such file or direc +tory) 6112 stat("/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi +/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or d +irectory) 6112 stat("/usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi +/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or d +irectory) 6112 stat("/usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi +/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or d +irectory) 6112 stat("/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi +/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or d +irectory) 6112 stat("/usr/lib/perl5/site_perl/5.8.8/auto/DBI/DESTROY.al", 0x7ff +fe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/site_perl/5.8.7/auto/DBI/DESTROY.al", 0x7ff +fe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/site_perl/5.8.6/auto/DBI/DESTROY.al", 0x7ff +fe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/site_perl/5.8.5/auto/DBI/DESTROY.al", 0x7ff +fe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/site_perl/auto/DBI/DESTROY.al", 0x7fffe423a +460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-mul +ti/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or + directory) 6112 stat("/usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-mul +ti/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or + directory) 6112 stat("/usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-mul +ti/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or + directory) 6112 stat("/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-mul +ti/auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or + directory) 6112 stat("/usr/lib/perl5/vendor_perl/5.8.8/auto/DBI/DESTROY.al", 0x7 +fffe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/vendor_perl/5.8.7/auto/DBI/DESTROY.al", 0x7 +fffe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/vendor_perl/5.8.6/auto/DBI/DESTROY.al", 0x7 +fffe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/vendor_perl/5.8.5/auto/DBI/DESTROY.al", 0x7 +fffe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/vendor_perl/auto/DBI/DESTROY.al", 0x7fffe42 +3a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DBI/ +DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No such file or directory) 6112 stat("/usr/lib/perl5/5.8.8/auto/DBI/DESTROY.al", 0x7fffe423a460) + = -1 ENOENT (No such file or directory) 6112 stat("./auto/DBI/DESTROY.al", 0x7fffe423a460) = -1 ENOENT (No su +ch file or directory) 6112 exit_group(5) = ?
        Any help with this is appreciated.

      Here's a fix :) If something dies, add some eval {};warn $@ if $@;
      #!/usr/bin/perl -w use HTTP::Daemon::SSL; use HTTP::Status; use SOAP::Lite; use SOAP::Transport::HTTP; use XML::Simple; use TTPSubmit; while(1){ # infinite loop, if Daemon stop for some reason # Make sure you have a certs/ directory with "server-cert.pem" # and "server-key.pem" in it before running this! my $daemon = new HTTP::Daemon::SSL SSL_key_file => '(takenout)server-key.pem', SSL_cert_file => '(takenout)server-cert.pem', LocalPort => 8080; my $soap = SOAP::Transport::HTTP::Server -> new ( ) -> dispatch_to('TTPSubmit'); print "Please contact me at: <URL:", $daemon->url, ">\n"; while (my $conn = $daemon->accept()) { while (my $request = $conn->get_request()) { $soap->request($request); $soap->handle(); my $response = $soap->response(); $conn->send_response($response); } $conn->close; undef($conn); } }

        Tried your loop fix, it is still stopping. I will try to move it to another port instead of 8080.

        Thanks Anonymous Monk and Eyck for all of the help you have provided, it really helped me to look at this problem differently. I should have thought of the infinite loop solution, but that is life. Sometimes you just have to have another brain in the mix! Thanks again! If I could vote yet I would give you two some votes but I'm still just an Initiate. I only have to get two more XP to be a Novice and I can vote then.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://705551]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2024-04-18 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found