I finally discovered the issue and how to solve it.

My first version of the service *MyService* was packaged on myprocessors-nar.
I added it as a service and in Controller Services it appears as Bundle
with com.foo - my-processors-nar. I developed some stuff and I used the
service. After that I repackaged the service in another NAR file although I
did not remove the controller service. It was working without removing it
and the Bundle value shows com.foo - my-processors-nar instead of com.foo -
my-service-nar.

If I add the service again, it shows the correct bundle. So the workaround
is remove old services (although they was working fine) and add them again.
That fix the Bundle value and I am able to rollback changes.

Thanks,
Juan


On Mon, 5 Oct 2020 at 17:33, Juan Pablo Gardella <
gardellajuanpa...@gmail.com> wrote:

> These are my pom.xml files:
>
> *myprocessor nar:*
> <project xmlns="http://maven.apache.org/POM/4.0.0";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>   <modelVersion>4.0.0</modelVersion>
>   <parent>
>     <groupId>xx</groupId>
>     <artifactId>xx</artifactId>
>     <version>xx</version>
>   </parent>
>   <artifactId>myprocessors-nar</artifactId>
>   <properties>
>     <maven.javadoc.skip>true</maven.javadoc.skip>
>     <source.skip>true</source.skip>
>   </properties>
>   <packaging>nar</packaging>
>   <dependencies>
>     <dependency>
>       <artifactId>my-processors</artifactId>
>       <groupId>${project.groupId}</groupId>
>       <version>${project.version}</version>
>     </dependency>
>     <dependency>
>       <groupId>${project.groupId}</groupId>
>       <version>${project.version}</version>
>       <artifactId>myservices-nar</artifactId>
>       <type>nar</type>
>     </dependency>
>   </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.nifi</groupId>
>         <artifactId>nifi-nar-maven-plugin</artifactId>
>       </plugin>
>     </plugins>
>   </build>
> </project>
>
> *myservice-nar:*
> <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance";
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>   <modelVersion>4.0.0</modelVersion>
>
>   <parent>
>     <artifactId>xxx</artifactId>
>     <groupId>xxx</groupId>
>     <version>xxx</version>
>   </parent>
>
>   <artifactId>myservices-nar</artifactId>
>   <packaging>nar</packaging>
>   <properties>
>     <maven.javadoc.skip>true</maven.javadoc.skip>
>     <source.skip>true</source.skip>
>   </properties>
>
>   <dependencies>
>     <dependency>
>       <groupId>org.apache.nifi</groupId>
>       <artifactId>nifi-standard-services-api-nar</artifactId>
>       <version>${nifi.version}</version>
>       <type>nar</type>
>     </dependency>
>     <dependency>
>       <groupId>${project.groupId}</groupId>
>       <artifactId>my-services</artifactId>
>       <version>${project.version}</version>
>     </dependency>
>   </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.nifi</groupId>
>         <artifactId>nifi-nar-maven-plugin</artifactId>
>       </plugin>
>     </plugins>
>   </build>
>
> </project>
>
> Also the other modules are jars:
>
> *my-services:* Here com.foo.MyService is implemented
>   <artifactId>my-services</artifactId>
>  <packaging>jar</packaging>
>   <dependencies>
>     <dependency>
>       <groupId>${project.groupId}</groupId>
>       <artifactId>my-services-api</artifactId>
>       <version>${project.version}</version>
>     </dependency>
>
> *my-processors:*
>   <artifactId>my-processors</artifactId>
>  <packaging>jar</packaging>
>   <dependencies>
>     <dependency>
>       <groupId>${project.groupId}</groupId>
>       <artifactId>my-services-api</artifactId>
>       <version>${project.version}</version>
>     </dependency>
>
> *my-service-api:* A jar with one interface: com.foo.MyService
>
> That set of libraries and NAR files don't fail in Nifi and also there is
> no issues during the package. Is that type of NAR dependencies an issue for
> Nifi Registry?
>
> Thanks,
> Juan
>
>
>
>
>
> On Mon, 5 Oct 2020 at 16:44, Bryan Bende <bbe...@gmail.com> wrote:
>
>> I don't know exactly what is in each of your NARs, but it is saying
>> that in the version of the flow being rolled back to, there exists
>> this:
>>
>> type: "com.foo.MyService",
>> bundle":{
>>   "group": "com.foo",
>>   "artifact": "myprocessor-nar",
>>   "version": "0.1.0-SNAPSHOT"
>> }
>>
>> So then NiFi goes to the NAR with that bundle coordinate and checks if
>> it contains that type, and in this case it doesn't, so it doesn't know
>> what to do because the versioned flow said to get a type from a bundle
>> that doesn't contain the type.
>>
>> On Mon, Oct 5, 2020 at 3:15 PM Juan Pablo Gardella
>> <gardellajuanpa...@gmail.com> wrote:
>> >
>> > Hi Bryan,
>> >
>> > Thanks, I will try to isolate the issue although myprocessor-nar does
>> not have a class implementing com.foo.MyService, it contains only the
>> interface, because the implementation is part of myservices-nar. IFor Nifi
>> there is no issues, it is working as expected, maybe some checks in Nifi
>> registry are causing problems.
>> >
>> > I will try to investigate and debug a little bit on it and file an
>> issue if I find it and I hope a PR.
>> >
>> > Thanks
>> >
>> > On Mon, 5 Oct 2020 at 16:06, Bryan Bende <bbe...@gmail.com> wrote:
>> >>
>> >> Seems the version of the flow you are rolling back to has a component
>> >> in it with class name "com.foo.MyService", but the current
>> >> myprocessor-nar that you are running does not have that service in it.
>> >>
>> >> On Mon, Oct 5, 2020 at 3:00 PM Juan Pablo Gardella
>> >> <gardellajuanpa...@gmail.com> wrote:
>> >> >
>> >> > Hi all,
>> >> >
>> >> > Does anyone know about this issue? What does it mean?
>> >> >
>> >> > Thanks,
>> >> > Juan
>> >> >
>> >> >
>> >> > On Sun, 4 Oct 2020 at 11:25, Juan Pablo Gardella <
>> gardellajuanpa...@gmail.com> wrote:
>> >> >>
>> >> >> Hi all,
>> >> >>
>> >> >> I am starting to play with Nifi Registry. I am using Nifi 1.12.1
>> and Nifi Registry 0.7.0 almost with all default configurations. No security
>> on both. My flow has some custom processors and services which were
>> generated by nifi-nar-maven-plugin/1.3.2.
>> >> >>
>> >> >> I was able to create a bucket in Nifi Registry and started the
>> version control and committed some changes.  The problem appeared when I
>> tested roll back local changes and following error appears in the UI
>> >> >>
>> >> >> Found bundle com.foo:myprocessr-nar:0.1.0-SNAPSHOT but does not
>> support com.foo.MyService
>> >> >>
>> >> >> There are no errors in Nifi Registry and Nifi logs. A 409 conflict
>> issue appears in the browser developer console: POST
>> http://localhost:8000/nifi-api/versions/revert-requests/process-groups/e8ff381c-0174-1000-b8ce-873a9ad9bd47
>> operation.
>> >> >>
>> >> >> I uploaded two NARs files to Nifi Registry using upload bundle to
>> test if that was the problem but it didn't work also.
>> >> >>
>> >> >> I cannot find too much in google, anyone has an idea what does this
>> error mean? and also, how I can fix it? Notice the processors and services
>> are working without issues on Nifi. Both NAR files were packed using
>> >> >>
>> >> >> I tried change to true  "allowBundleRedeploy":
>>  "allowPublicRead":  but still failed (it is created with false).
>> >> >>
>> >> >> Thanks
>>
>

Reply via email to