{"id":1545,"date":"2025-04-22T21:13:21","date_gmt":"2025-04-22T21:13:21","guid":{"rendered":"https:\/\/adrianotanaka.com.br\/?p=1545"},"modified":"2025-04-22T21:15:55","modified_gmt":"2025-04-22T21:15:55","slug":"resolving-ora-01031-insufficient-privileges-when-using-utl_http","status":"publish","type":"post","link":"https:\/\/adrianotanaka.com.br\/index.php\/2025\/04\/22\/resolving-ora-01031-insufficient-privileges-when-using-utl_http\/","title":{"rendered":"Resolving ORA-01031: Insufficient Privileges When Using UTL_HTTP"},"content":{"rendered":"\n<p>If you&#8217;re using an Autonomous Database Serverless (ADB-S) and attempting to call HTTP (not HTTPS) endpoints, encountering the ORA-01031 error is common. While your first step might be to check the Access Control List (ACL) or grant permissions to the user calling the package, this alone won&#8217;t resolve the issue. Here&#8217;s how to fix it:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">From the Docs:<\/h2>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Public Endpoints<\/strong>: Only HTTPS is allowed. HTTP connections are disallowed.<\/li>\n\n\n\n<li><strong>Private Endpoints<\/strong>: Both HTTPS and HTTP_PROXY connections are permitted. HTTP connections remain disallowed for both public and private endpoints.<\/li>\n\n\n\n<li><strong>Port Restrictions<\/strong>: For public endpoints, only port 443 is allowed. This restriction does not apply to private endpoints.<\/li>\n<\/ol>\n\n\n\n<p>For more details, refer to the <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/autonomous-database-serverless\/doc\/autonomous-plsql-packages.html\">Oracle Documentation<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solutions:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p><span><strong>Adjust Your Application<\/strong>: Configure your application to expose the endpoint using the HTTPS protocol on port 443.<\/span><\/p>\n\n\n\n<p>OR<\/p>\n\n\n\n<p><span><strong>Move to a Private Subnet<\/strong> (Recommended): Transition your Autonomous Database to a private subnet with a NAT Gateway and update the ACL accordingly.After moving the database to the private subnet and configuring routes to use the NAT Gateway, update the <code>ROUTE_OUTBOUND_CONNECTIONS<\/code> parameter:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span><strong>Enable Private Endpoint Routing<\/strong>:<\/span><\/li>\n<\/ul>\n\n\n\n<p>ALTER DATABASE PROPERTY SET ROUTE_OUTBOUND_CONNECTIONS = &#8216;PRIVATE_ENDPOINT&#8217;;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Disable Private Endpoint Routing<\/strong>(if you want to revert to default):<\/li>\n<\/ul>\n\n\n\n<p>ALTER DATABASE PROPERTY SET ROUTE_OUTBOUND_CONNECTIONS = &#8221;;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Update the ACL<\/strong> (just an example):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>begin\n  dbms_network_acl_admin.create_acl (\n    acl         =&gt; 'acl_ai.xml',\n    description =&gt; 'Enable ACL to XYZ Host',\n    principal   =&gt; 'USER_THAT_NEEDS_ACL',\n    is_grant    =&gt; TRUE,\n    privilege   =&gt; 'connect',\n    start_date  =&gt; null,\n    end_date    =&gt; null\n  );\n \n  dbms_network_acl_admin.add_privilege (\n    acl        =&gt; 'acl_ai.xml',\n    principal  =&gt; 'USER_THAT_NEEDS_ACL',\n    is_grant   =&gt; TRUE,\n    privilege  =&gt; 'resolve',\n    start_date =&gt; null,\n    end_date   =&gt; null\n  );\n \n  dbms_network_acl_admin.assign_acl (\n    acl        =&gt; 'acl_ai.xml',\n    host       =&gt; '*.YOUR_DOMAIN',\n    lower_port =&gt; 80,\n    upper_port =&gt; 80\n  );\n  commit;\nend;\n\/\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re using an Autonomous Database Serverless (ADB-S) and attempting to call HTTP (not HTTPS) endpoints, encountering the ORA-01031 error is common. While your first step might be to check the Access Control List (ACL) or grant permissions to the user calling the package, this alone won&#8217;t resolve the issue. Here&#8217;s how to fix it: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"material-hide-sections":[],"footnotes":""},"categories":[56,45,8,6],"tags":[5,29,4,3],"class_list":["post-1545","post","type-post","status-publish","format-standard","hentry","category-atp","category-database","category-oci","category-oracle","tag-banco-de-dados","tag-cloud","tag-database","tag-oracle"],"_links":{"self":[{"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/posts\/1545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=1545"}],"version-history":[{"count":7,"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/posts\/1545\/revisions"}],"predecessor-version":[{"id":1552,"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/posts\/1545\/revisions\/1552"}],"wp:attachment":[{"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=1545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=1545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrianotanaka.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=1545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}