Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

utl_http and tns:destination unreachable

trentOct 16 2012 — edited Oct 16 2012
I am running the OTN Dev Days VM in VirtualBox. Typically at home with the network settings specified as bridged with the interface set as wlan0. However, yesterday, I connected it up on the work network - so the settings remained the same except for the interface was changed to eth0, since that is the interface used. All is fine.

However, after returning home, and starting up the machine, I seem no longer be able to use utl_http to issue http requests. I get the following error:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-12543: TNS:destination host unreachable
ORA-06512: at line 6
29273. 00000 - "HTTP request failed"
*Cause: The UTL_HTTP package failed to execute the HTTP request.
*Action: Use get_detailed_sqlerrm to check the detailed error message.
Fix the error and retry the HTTP request.>

And that is with running the following sample code (or anything for that matter):
declare
  req utl_http.req;
  res utl_http.resp;
begin

  req := utl_http.begin_request('http://google.com');
  res := utl_http.get_response(req);
  utl_http.end_response(res);

end;
I have had a little look around, but the only other examples I see is people having troubles connecting to the database, however, there is no trouble there.

In case it is of any use, here is the tnsname.ora:
# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))


ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

TTORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
and listener.ora:
# listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST = 
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    )

    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 80))
      (PROTOCOL_STACK =
         (PRESENTATION = HTTP)
         (SESSION = RAW)
      )
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 21))
      (PROTOCOL_STACK =
         (PRESENTATION = FTP)
         (SESSION = RAW)
      )
    )
  )
ADR_BASE_LISTENER = /home/oracle/app/oracle
Networking works fine. I can verify this with:
$ ping google.com
PING google.com (74.125.237.8) 56(84) bytes of data.
64 bytes from syd01s04-in-f8.1e100.net (74.125.237.8): icmp_seq=1 ttl=57 time=12.2 ms
64 bytes from syd01s04-in-f8.1e100.net (74.125.237.8): icmp_seq=2 ttl=57 time=13.3 ms>

and:
$ telnet google.com 80
Trying 2404:6800:4006:800::1001...
telnet: connect to address 2404:6800:4006:800::1001: No route to host
Trying 74.125.237.8...
Connected to google.com (74.125.237.8).
Escape character is '^]'.
^]
telnet> exit
?Invalid command
telnet> Connection closed.>

There's not much in the VM, that I could just re-create it, but figured it'd be better to figure out what is going on! Anyone have any ideas? Much appreciated!
This post has been answered by EdStevens on Oct 16 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2012
Added on Oct 16 2012
10 comments
5,696 views