I have a problem with APEX. We have two servers. One (with running Oracle APEX) is the university server, which we have only access to the workspace. The other is my Linux Computer at home, which acts as a server (running Tomcat with Jasperreports container). I want to send a UTL_HTTP request from the APEX machine to the Jasperreports machine. There is a button, which triggers a process with following code:
begin
xlib_jasperreports.set_report_url('http://X.X.X.X:8080/JasperReportsIntegration/report');
xlib_jasperreports.show_report (p_rep_name => :p5_rep_name,
p_rep_format => :p5_rep_format,
p_data_source => :p5_data_source,
p_out_filename => :p5_out_filename,
p_rep_locale => :p5_rep_locale,
p_rep_encoding => :p5_rep_encoding,
p_additional_params => :p5_additional_params);
-- stop rendering of the current APEX page
apex_application.g_unrecoverable_error := true;
end;
After 20 to 30 seconds after I pushed the triggering button I get following errormessage:
ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1029 ORA-12535: TNS:operation timed out
I checked the set_report_url function by setting a common url . And it worked. Does anyone have a clue?
Thanks in advance,
Haniball
The latter version of Oracle have Network ACL security, so it might be that the schema owner doesn't have privileges to access that particular URL. However I'd expect a security violation for that.
Another alternative is that it is being blocked by a firewall between the database server and your home machine. It is possible (likely) that the database server machine has been set up to only allow a small list of sites to be accessed (or none at all). You may also have a firewall on your home machine that prevents access from machines not on a list of IP addresses/ranges.
Try some basic UTL_HTTP actions against a variety of sites (eg the google.com home page), and see what response you get.
Missed the obvious UTL_HTTP.set_transfer_timeout. It may be that the job takes a bit too long at the home server.
Related
My production app is an APEX application already running in a custom domain (mydomain.com). I've already configured REST-enabled SQL Service, and connected to it successfully from another APEX installation on anther custom domain of mine. So that seems fine.
Now, I've spun up a new APEX Developer Service environment on oraclecloud, and I'm trying to create a REST-enabled SQL Service reference to point to the mydomain.com instance. I'm getting the typical error that says the endpoint does not point to a REST-enabled SQL Service.
In the past, when I've had this problem, I solved it by:
Creating an ACL for the remote domain, which allows responses to come back into the requester, and
Modifying the wallet on the requester to include the root CA certificate of the remote domain. This is needed because my custom remote instance is running HTTPS.
As far as I know, both of those require database and/or filesystem access, which I don't have in the APEX Developer Service environment on oraclecloud.
So, my question is: is it possible to do this and, if so, how?
you might execute the following in SQL Commands in order to test networking connectivity between the APEX service and your APEX instance within (yourdomain.com).
declare
l_result clob;
begin
l_result := apex_web_service.make_rest_request(
p_url => 'http://server.yourdomain.com/path/to/restenabledsql/_/sql',
p_http_method => 'GET' );
htp.p( 'Status: ' || apex_web_service.g_status_code );
end;
As this block does not pass credentials, it will never work correctly. However, based on the thrown error message, we will hopefully get a better indication about the actual cause.
I installed AOP and have now a little problem. I get the error
ORA-20000: AOP Server can not be found. Check if it is running at http://api.apexofficeprint.com/
when trying to create a template or report.
Oracle Database 18 XE
Apex 20.1
Apex Office Print 20.2
That's a general error you are receiving. This is more of a network issue than AOP.
The first step would be to check if you ACL has been set up properly. You could check this by executing the following through SQL Workshop -> SQL Commands:
select apex_web_service.make_rest_request('http://api.apexofficeprint.com/marco', 'GET') from dual;
if the ACL was configured properly you should get a "polo" string back.
If this does result in an error, you should be able to get the exact HTTP error by executing the following command:
select utl_http.get_detailed_sqlerrm from dual;
You should see something like this:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1577
ORA-24247: network access denied by access control list (ACL)
The code to configure ACL can be found on oracle documentation for 20.1
I've pasted the code below to make it easier. You will need to connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => 'api.apexofficeprint.com',
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => 'APEX_200100',
principal_type => xs_acl.ptype_db));
END;
/
For completeness I am also hyperlinking it here for other versions of APEX.
: APEX 5.0, APEX 5.1, APEX 18.1, APEX 18.2, APEX 19.1, APEX 19.2
Once this has been setup, you should be able to connect to api.apexofficeprint.com without issues. However please note that you are currently using http protocol which is unsecure and we recommend you to use https.
In order for you to use https, you will have to add the root certificate of AOP server. This blog capture the method in detail.
Furthermore if you have installed the AOP sample application, you can debug connection issues from connection test page (Debugging -> Test Connection). This page will detect the URL you have used for the plugin and allow you to check the connection. This detects ACL, wallet issues, certificate validation issue and if the server is running in the provided URL.
PS: Could it be that you used other email than support#apexofficeprint.com to contact us? I see that one of your email and the feedback were both answered within an hour.
After rebooting my Windows Server 2016 Standard (SQL Server 2016) my SSIS process that runs this query:
select * from openquery(HRMPROD, 'SELECT QUERY HERE' )
started failing with this error:
I get the same error if I try to run the query in SSMS. I have the same linked server set up on my test instance and the query is successful when I run it there. I have compared the linked server create script on both instances and it is the same.
Any idea where I should look for what is causing the connection issue on the one server but not the other?
Thank you.
Saying the answer is on the Oracle side is just like pointing fingers across the way. Let's just fix the issue here.
There is a connection string that is used from SSIS, (which you also used in SSMS) The connection string contains three main components to connect and would result in the 12154 error if any of them were incorrect:
Host
Instance name (different than Instance on Sql Server, think database name)
port
The port most likely hasn't change, neither has the database name, but the host...No, hasn't changed, but the DNS server used to connect most likely has! I would ping the host and see what returns from the SSIS and your SSMS host that you're using. I would expect it to fail. Find out what IP address the host is using and ping that - see if it returns. I'm guessing that's the change that needs to be updated or your Network folks need to fix a DNS configuration/server issue.
Hope this helps!
Kellyn
Since you are getting a response from the TNS Listener, the problem lies on the Oracle side. See Architecture of Oracle Network Services for an overview of how the Oracle networking handles things. Keep in mind that based on the error message you've reached the TNS Listener, so you only need to check things between TNS and the Oracle database... In other words, your networking and SQL Server settings are fine or you wouldn't be able to get this error message.
I would agree with above that the issue might have to do with the network. I have come across that a few times, where we can set everything up, but a firewall is blocking communication between the two servers.
Open up powershell on the new server and run a tracert to the target to see the hops and identify if is connecting across the network.
If it is, then run a test-netconnect on the specific port, to see if the port is open from the firewalls.
Cheers!
I have a Tableau (reporting) server on Windows 10 that internally uses PostgresDB. Besides I have a PostgresDB, where my data is located, so reports are aggregated using this data.
What should our end-user experience? - He or she opens in a web browser a report by url and see the data.
For some reason from time to time our end-users face with the problem:
could not receive data from server: Software caused connection abort
(0x00002745/10053) Unable to connect to the server "server_name".
Check that the server is running and that you have access privileges
to the requested database.
This problem arises with different reports and in different time. Moreover, when I do not fix it for a long time, this report may start to work again.
There is no firewall or antivirus on Windows where Tableau server is, but there is a VPN.
What has helped?
Pgbouncer has solved it problem partially. By partially I mean that during 2 weeks of exploitation this error has only once occurred instead of 3 times per day by using pure Postgres.
Restart of Tableau server solves this problem as well.
Accidental loose of Internet connection on Tableau server also may help with this problem.
What have I also checked?
1) When everything is fine, in Pgbouncer logs I can see that queries are loading when I interact with a report, otherwise (when there is this error) no logs are recorded. So Tableau Postgres can't connect to Postgres with data for some reasons.
2) When I connect manually to PostgresDB from the Tableau Postgres, then everything is fine and all queries were executed, while end-clients face with the problem interacting via web browser.
3) When I type in CMD in Tableau Server (windows): netstat -nao | find PostgresDB:5432, in normal case I see many TCP connections with different PIDs except one PID which is executed from 2 different ports on Tableau Server, however all of them are tabprotosrv.exe; in case when it fails I see only one PID which is executed from 2 different ports on Tableau Server.
So I have 2 main questions
1. How to solve it normally?
2. Or what should I check else?
What configuration change do I need to make?
Hello, recently upgraded my laptop to windows7, I pulled down our site from subversion to make some updates. I always test the changes on localhost before I move them to our beta site. Now, I was able to set up IIS on windows 7 to run our site, but it seems only the non-dynamic asp pages are working. Any page that tries to connect to the DB returns an error message.
Microsoft OLE DB Provider for ODBC
Drivers error '80040e4d'
[Microsoft][SQL Native Client][SQL
Server]Login failed for user 'NT
AUTHORITY\ANONYMOUS LOGON'.
/include/chooseyear.inc, line 15
Here is the Global.asa file
'Added Lock to Session Onstart to
protect Current Year variable ' from
becoming corrupted
If isEmpty(Application("CURRENT_YEAR"))
then
Application.lock Application("CURRENT_YEAR") =
Year(now()) Application.Unlock END
IF 'Doug Chamberlain 'continue to use ODBC connection to access data
Session("DBConnection")= "DSN=WITHHELD;UID=USER_NAME_WITHHELD;PWD=PASSWORD_WITHHELD;DATABASE=master;APP=www"
Session("ConnectionTimeout") = 120
Session("CommandTimeout") = 102 'Doug Chamberlain '09/10/2010
Update:
Here is the line of code that fails. but worked prior to upgrading to windows 7 and IIS7.5
PropConnection.Open Session("SCPAASPConnection")
I did a debug on the website when it failed, and the value of that variable is
"DSN=WITHHELD;UID=USER_NAME_WITHHELD;PWD=PASSWORD_WITHHELD;DATABASE=master;APP=www"
but the error message is the same as below, it seems to just ignore the user/pass in the connection string variable. I did get the site to work slightly better by turning on windows auth & anonymous auth. However, other things break when I do that. Like the link scanner I use.
This isn't anything to do with ASP, as all ASP pages are dynamic (in that they will be parsed through by IIS), from what you're saying (and from the error message), it's only the ones with a database connection in that are failing.
This is because the user account the IIS application pool process runs under by default would not have access on the SQL box. You could add a SQL login for that account, or if it's only a local machine you're running it on then just change the app pool identity to run as NetworkService.
In IIS, select the app pool for the site, click Edit Application Pool > Advanced Settings and change Process Model > Identity from ApplicationPoolIdentity to NetworkService.