<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Nifi Upload XML Template 403 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/355419#M237093</link>
    <description>&lt;P&gt;I've solved it myself. I've updated to version 1.18, and updated the docker-compose.yml file with an additional environment variable:&amp;nbsp;NIFI_WEB_PROXY_HOST which equals a comma separated list of hosts that can access the system.&lt;/P&gt;&lt;P&gt;Then, using the following command I was able to upload a template:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;curl -XPOST -H "Authorization: Bearer {token}" https://{host}:{port}/nifi-api/process-groups/{process-group-ID}/templates/upload -k -v -F template=@{template-name}.xml&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 13:52:50 GMT</pubDate>
    <dc:creator>Kushisabishii</dc:creator>
    <dc:date>2022-10-19T13:52:50Z</dc:date>
    <item>
      <title>Nifi Upload XML Template 403</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/353596#M236755</link>
      <description>&lt;P&gt;I have a problem very similar to &lt;A title="Template import error" href="https://community.cloudera.com/t5/Support-Questions/Template-import-error/m-p/347055#M235047" target="_self"&gt;this one&lt;/A&gt;&amp;nbsp;which has been marked as solved. I have followed the instructions which did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to upload a Nifi XML template that I have previously exported, but am getting a 403.&lt;/P&gt;&lt;P&gt;I am running Nifi version 1.17.0 in a docker container.&lt;/P&gt;&lt;P&gt;The docker image is the latest, which should be 1.14.0&lt;/P&gt;&lt;P&gt;It is run using docker compose.&lt;/P&gt;&lt;P&gt;I am using Postman to send the REST requests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The steps I have taken are:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Generate an access token using: POST &lt;A href="https://localhost:8443/nifi-api/access/token" target="_blank" rel="noopener"&gt;https://localhost:8443/nifi-api/access/token&lt;/A&gt;&amp;nbsp;with an x-www.form-urlencoded body containing the username and password set in the .env file. This token is then used as the bearer token&lt;/LI&gt;&lt;LI&gt;Get the root process-group id using: GET&amp;nbsp;&lt;A href="https://localhost:8443/flow/process-group/root" target="_blank" rel="noopener"&gt;https://localhost:8443/nifi-api/flow/process-group/root&lt;/A&gt;&amp;nbsp;then taking the id from processGroupFlow:id&lt;/LI&gt;&lt;LI&gt;Failing to import an XML template using: POST &lt;A href="https://localhost:8443/nifi-api/process-groups/{id}/templates/import" target="_blank" rel="noopener"&gt;https://localhost:8443/nifi-api/process-groups/{id}/templates/import&lt;/A&gt;&amp;nbsp;where the body is raw XML, containing the previously exported template.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;The error I receive is:&lt;/STRONG&gt;&lt;/P&gt;&lt;H2&gt;HTTP ERROR 403 Forbidden&lt;/H2&gt;&lt;P&gt;URI:STATUS:MESSAGE:SERVLET:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;/nifi-api/process-groups/882f73b9-0183-1000-28e5-9508657cbe9f/templates/import&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;403&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Forbidden&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;jerseySpring&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My docker compose yaml file is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;version: '2.2'&lt;BR /&gt;services:&lt;BR /&gt;nifi:&lt;BR /&gt;image: apache/nifi:latest&lt;BR /&gt;container_name: nifi&lt;BR /&gt;ports:&lt;BR /&gt;- ${HTTP_EXTERNAL_PORT}:${HTTP_INTERNAL_PORT}&lt;BR /&gt;- ${HTTPS_EXTERNAL_PORT}:${HTTPS_INTERNAL_PORT}&lt;BR /&gt;environment:&lt;BR /&gt;- SINGLE_USER_CREDENTIALS_USERNAME=${NIFI_USERNAME}&lt;BR /&gt;- SINGLE_USER_CREDENTIALS_PASSWORD=${NIFI_PASSWORD}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My docker compose .env file is&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;HTTPS_EXTERNAL_PORT=8443&lt;BR /&gt;HTTPS_INTERNAL_PORT=8443&lt;/P&gt;&lt;P&gt;HTTP_EXTERNAL_PORT=8080&lt;BR /&gt;HTTP_INTERNAL_PORT=8080&lt;/P&gt;&lt;P&gt;NIFI_USERNAME=myUsername&lt;BR /&gt;NIFI_PASSWORD=myPassword&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 08:09:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/353596#M236755</guid>
      <dc:creator>Kushisabishii</dc:creator>
      <dc:date>2022-09-29T08:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Upload XML Template 403</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/353787#M236798</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/100733"&gt;@Kushisabishii&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What are you seeing in the nifi-user.log when you make this import attempt?&lt;BR /&gt;You may be getting the 403 because the user is not authorized properly to perform the import call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic"&gt;If you found that the provided solution(s) assisted you with your query, please take a moment to login and click&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Accept as Solution&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;below each response that helped.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;Matt&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:35:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/353787#M236798</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-09-30T21:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Upload XML Template 403</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/353837#M236809</link>
      <description>&lt;P&gt;Thank you for the reply&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree, the 403 on the REST Api pages suggests:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Client is not authorized to make this request. What I am trying to understand is why does this happen. The problem is I am new to Nifi and very much on a steep learning curve with limited time. The nifi-user.log you mentioned is below.&lt;BR /&gt;&lt;BR /&gt;nifi@228d7503eaae:/opt/nifi/nifi-current/logs$ more nifi-user.log&lt;BR /&gt;2022-10-03 07:56:07,890 INFO [main] o.a.n.a.single.user.SingleUserAuthorizer Initializing Authorizer&lt;BR /&gt;2022-10-03 07:56:07,986 INFO [main] o.a.n.a.FileUserGroupProvider Creating new users file at /opt/nifi/nifi-current/./conf/users.xml&lt;BR /&gt;2022-10-03 07:56:07,997 INFO [main] o.a.n.a.FileUserGroupProvider Users/Groups file loaded at Mon Oct 03 07:56:07 UTC 2022&lt;BR /&gt;2022-10-03 07:56:07,997 INFO [main] o.a.n.a.FileAccessPolicyProvider Creating new authorizations file at /opt/nifi/nifi-current/./conf/authorizations.xml&lt;BR /&gt;2022-10-03 07:56:08,011 INFO [main] o.a.n.a.FileAccessPolicyProvider Authorizations file loaded at Mon Oct 03 07:56:08 UTC 2022&lt;BR /&gt;2022-10-03 07:56:08,014 INFO [main] o.a.n.a.single.user.SingleUserAuthorizer Configuring Authorizer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for taking the time to respond&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 08:05:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/353837#M236809</guid>
      <dc:creator>Kushisabishii</dc:creator>
      <dc:date>2022-10-03T08:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Upload XML Template 403</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/355419#M237093</link>
      <description>&lt;P&gt;I've solved it myself. I've updated to version 1.18, and updated the docker-compose.yml file with an additional environment variable:&amp;nbsp;NIFI_WEB_PROXY_HOST which equals a comma separated list of hosts that can access the system.&lt;/P&gt;&lt;P&gt;Then, using the following command I was able to upload a template:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;curl -XPOST -H "Authorization: Bearer {token}" https://{host}:{port}/nifi-api/process-groups/{process-group-ID}/templates/upload -k -v -F template=@{template-name}.xml&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:52:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/355419#M237093</guid>
      <dc:creator>Kushisabishii</dc:creator>
      <dc:date>2022-10-19T13:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Upload XML Template 403</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/358438#M237850</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/100733"&gt;@Kushisabishii&lt;/a&gt;&amp;nbsp; could you please advise what list of host needs to be provided on the&amp;nbsp;&lt;SPAN&gt;NIFI_WEB_PROXY_HOST I have added the docker host and port that I access the NiFi UI.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;For example my NiFi is accessible via&amp;nbsp;&lt;A href="https://docker-host.comp.com/nifi/" target="_blank"&gt;https://docker-host.comp.com/nifi/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hence I have added the&amp;nbsp;NIFI_WEB_PROXY_HOST = docker-host.comp.com:443 into my docker compose file. Do I need to consider any other hosts to be added ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 11:39:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Upload-XML-Template-403/m-p/358438#M237850</guid>
      <dc:creator>jojejoby</dc:creator>
      <dc:date>2022-11-28T11:39:58Z</dc:date>
    </item>
  </channel>
</rss>

